/* =============================
   GSWeb - Design System Moderne
   Composants UI professionnels
   ============================= */

/* ===== CARDS AMÉLIORÉES ===== */

.gs-card-modern {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.06);
    transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.gs-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #16a34a);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 300ms ease;
}

.gs-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
}

.gs-card-modern:hover::before {
    transform: scaleX(1);
}

/* Card avec icône */
.gs-card-icon {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.gs-card-icon__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.gs-card-icon__icon.primary {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
}

.gs-card-icon__icon.success {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #15803d;
}

.gs-card-icon__icon.danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #b91c1c;
}

.gs-card-icon__icon.warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #b45309;
}

.gs-card-icon__content h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.gs-card-icon__content p {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
}

/* ===== STATS CARDS ===== */

.gs-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.gs-stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.06);
    transition: transform 200ms, box-shadow 200ms;
    position: relative;
    overflow: hidden;
}

.gs-stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.gs-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.10);
}

.gs-stat-card__label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.gs-stat-card__value {
    font-size: 32px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.gs-stat-card__change {
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
}

.gs-stat-card__change.positive {
    background: #dcfce7;
    color: #15803d;
}

.gs-stat-card__change.negative {
    background: #fee2e2;
    color: #b91c1c;
}

/* ===== FORMS MODERNES ===== */

.gs-form-group {
    margin-bottom: 20px;
}

.gs-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gs-form-label .required {
    color: #dc2626;
}

.gs-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    color: #1f2937;
    transition: all 200ms;
    background: white;
}

.gs-form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

.gs-form-input:disabled {
    background: #f9fafb;
    cursor: not-allowed;
    opacity: 0.6;
}

.gs-form-input.error {
    border-color: #dc2626;
}

.gs-form-input.error:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.gs-form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.gs-form-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #dc2626;
    font-weight: 500;
}

/* Input avec icône */
.gs-input-group {
    position: relative;
}

.gs-input-group__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.gs-input-group .gs-form-input {
    padding-left: 48px;
}

/* ===== TABLEAUX MODERNES ===== */

.gs-table-wrapper {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.06);
    margin-bottom: 24px;
}

.gs-table-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.03), transparent);
}

.gs-table-header__title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.gs-table-header__actions {
    display: flex;
    gap: 12px;
}

.gs-table {
    width: 100%;
    border-collapse: collapse;
}

.gs-table thead {
    background: #f9fafb;
}

.gs-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

.gs-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
    font-size: 15px;
}

.gs-table tbody tr {
    transition: background-color 150ms;
}

.gs-table tbody tr:hover {
    background: #f9fafb;
}

.gs-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table responsive */
.gs-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== MODALS MODERNES ===== */

.gs-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1040;
    animation: fadeIn 0.2s ease-out;
}

.gs-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(17, 24, 39, 0.2);
    z-index: 1050;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: scaleIn 0.3s ease-out;
}

.gs-modal__header {
    padding: 24px 28px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gs-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.gs-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 150ms;
}

.gs-modal__close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.gs-modal__body {
    padding: 28px;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

.gs-modal__footer {
    padding: 20px 28px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f9fafb;
}

/* ===== ALERTS MODERNES ===== */

.gs-alert {
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.gs-alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.gs-alert-primary {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

.gs-alert-primary::before {
    background: #2563eb;
}

.gs-alert-success {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.gs-alert-success::before {
    background: #16a34a;
}

.gs-alert-danger {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.gs-alert-danger::before {
    background: #dc2626;
}

.gs-alert-warning {
    background: #fef3c7;
    border-color: #fde047;
    color: #92400e;
}

.gs-alert-warning::before {
    background: #f59e0b;
}

.gs-alert-info {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #075985;
}

.gs-alert-info::before {
    background: #0ea5e9;
}

.gs-alert__icon {
    font-size: 20px;
    flex-shrink: 0;
}

.gs-alert__content {
    flex: 1;
}

.gs-alert__title {
    font-weight: 700;
    margin: 0 0 4px;
    font-size: 15px;
}

.gs-alert__message {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== BREADCRUMB MODERNE ===== */

.gs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 14px;
}

.gs-breadcrumb__item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
}

.gs-breadcrumb__item a {
    color: #6b7280;
    text-decoration: none;
    transition: color 150ms;
}

.gs-breadcrumb__item a:hover {
    color: #2563eb;
}

.gs-breadcrumb__item.active {
    color: #1f2937;
    font-weight: 600;
}

.gs-breadcrumb__separator {
    color: #d1d5db;
}

/* ===== TABS MODERNES ===== */

.gs-tabs {
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
}

.gs-tabs__nav {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.gs-tabs__item {
    padding: 12px 24px;
    border: none;
    background: none;
    color: #6b7280;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 200ms;
    position: relative;
}

.gs-tabs__item:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
}

.gs-tabs__item.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* ===== PROGRESS BAR ===== */

.gs-progress {
    height: 12px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.gs-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #16a34a);
    border-radius: 12px;
    transition: width 400ms ease;
    position: relative;
    overflow: hidden;
}

.gs-progress__bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===== TOOLTIPS ===== */

.gs-tooltip {
    position: relative;
    display: inline-block;
}

.gs-tooltip__content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    transition: all 200ms;
    z-index: 1000;
}

.gs-tooltip__content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}

.gs-tooltip:hover .gs-tooltip__content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== DROPDOWN MODERNE ===== */

.gs-dropdown {
    position: relative;
    display: inline-block;
}

.gs-dropdown__menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
    min-width: 200px;
    margin-top: 8px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 200ms;
    z-index: 1000;
}

.gs-dropdown.active .gs-dropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gs-dropdown__item {
    display: block;
    padding: 10px 16px;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: all 150ms;
    font-size: 14px;
}

.gs-dropdown__item:hover {
    background: #f3f4f6;
    color: #2563eb;
}

.gs-dropdown__divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}
