/* =============================================
   VOX MASTERS ACADEMY - App Pages Styles
   ============================================= */

/* ===== Auth Page ===== */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, #122a6a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 520px;
}

.auth-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    height: 80px;
    margin-bottom: 20px;
}

.auth-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
}

.auth-form .form-control {
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.auth-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 165, 32, 0.1);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.9rem;
    z-index: 5;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--primary);
}

.auth-forgot {
    font-size: 0.85rem;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-forgot:hover {
    color: var(--accent);
}

.auth-switch a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.auth-switch span {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== Dashboard & Admin Layout ===== */
.app-layout {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-logo {
    height: 60px;
    margin-bottom: 8px;
}

.sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--accent);
    margin: 0;
}

.sidebar-nav {
    padding: 16px 0;
    list-style: none;
    margin: 0;
}

.sidebar-nav li {
    margin: 2px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--accent);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 0.9rem;
}

.app-main {
    flex: 1;
    margin-left: 260px;
    padding: 0;
    background: var(--bg-light);
    min-height: 100vh;
}

.app-topbar {
    background: var(--white);
    padding: 16px 30px;
    border-bottom: 1px solid #e8ecf4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-topbar h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-content {
    padding: 30px;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
}

/* ===== Cards ===== */
.stat-widget {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e8ecf4;
    transition: all 0.3s ease;
}

.stat-widget:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stat-widget-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--white);
}

.stat-widget-icon.blue { background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.stat-widget-icon.gold { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); }
.stat-widget-icon.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-widget-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }

.stat-widget h3 {
    font-size: 1.8rem;
    color: var(--primary);
    margin: 8px 0 2px;
    font-family: 'Playfair Display', serif;
}

.stat-widget p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 0;
}

/* ===== Data Table ===== */
.data-card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid #e8ecf4;
    overflow: hidden;
}

.data-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e8ecf4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.data-card-header h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin: 0;
    font-family: 'Playfair Display', serif;
    white-space: nowrap;
    flex-shrink: 0;
}

.data-table {
    width: 100%;
}

.data-table th {
    background: var(--bg-light);
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e8ecf4;
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--text);
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}

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

.data-table tr:hover td {
    background: rgba(242, 245, 251, 0.5);
}

/* ===== Badges ===== */
.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-active { background: #dcfce7; color: #16a34a; }
.badge-complete { background: #e0e7ff; color: #4f46e5; }
.badge-annulee { background: #fee2e2; color: #dc2626; }
.badge-en-attente { background: #fef3c7; color: #d97706; }
.badge-partiel { background: #dbeafe; color: #1d4ed8; }
.badge-paye { background: #dcfce7; color: #16a34a; }
.badge-annule { background: #fee2e2; color: #dc2626; }
.badge-admin { background: #e0e7ff; color: #4f46e5; }
.badge-super-admin { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: var(--white); }
.badge-user { background: #f0f2f5; color: var(--text-light); }

/* ===== Session Cards (Landing Page) ===== */
.session-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.session-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.session-card-image-wrap {
    position: relative;
    overflow: hidden;
}

.session-card-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.session-card:hover .session-card-image {
    transform: scale(1.04);
}

.session-img-placeholder {
    height: 240px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255,255,255,0.3);
    position: relative;
}

.session-flag {
    position: absolute;
    bottom: 10px;
    left: 12px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    z-index: 1;
}

.session-card-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 18px 22px;
    color: var(--white);
}

.session-card-header h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--white);
    line-height: 1.4;
}

.session-card-header span {
    font-size: 0.78rem;
    opacity: 0.8;
}

.session-card-body {
    padding: 20px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-light);
}

.session-info i {
    color: var(--accent);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.session-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Playfair Display', serif;
    margin: 8px 0 0;
}

.session-price small {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-light);
}

.session-price-sub {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
}

.session-price-sub small {
    font-size: 0.8rem;
    font-weight: 400;
}

.session-places {
    font-size: 0.82rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.session-places i { color: var(--accent); }

.session-card-footer {
    margin-top: auto;
    padding-top: 8px;
}

/* ===== Modal ===== */
.modal-content {
    border-radius: 16px;
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-radius: 16px 16px 0 0;
    padding: 20px 24px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-header h5 {
    color: var(--white);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e8ecf4;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.empty-state h4 {
    color: var(--primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== Pays Selector ===== */
.pays-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pays-option {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 2px solid #e8ecf4;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.82rem;
}

.pays-option:hover {
    border-color: var(--accent);
    background: rgba(212, 165, 32, 0.05);
}

.pays-option input[type="radio"] {
    display: none;
}

.pays-option input[type="radio"]:checked + img + span,
.pays-option input[type="radio"]:checked ~ span {
    font-weight: 600;
    color: var(--primary);
}

.pays-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(212, 165, 32, 0.1);
}

.pays-option img {
    width: 22px;
    height: auto;
    border-radius: 2px;
}

/* ===== Modules Checkbox Grid ===== */
.modules-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    padding: 12px;
}

.module-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.88rem;
}

.module-check-item:hover {
    background: var(--bg-light);
}

.module-check-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.module-check-item label {
    cursor: pointer;
    margin: 0;
    user-select: none;
}

@media (max-width: 767px) {
    .modules-checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Custom Dialog ===== */
.vma-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    animation: dialogFadeIn 0.25s ease forwards;
}

.vma-dialog-overlay.hiding {
    animation: dialogFadeOut 0.2s ease forwards;
}

@keyframes dialogFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes dialogFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.vma-dialog {
    background: var(--white);
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    transform: scale(0.9) translateY(10px);
    animation: dialogPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow: hidden;
}

.hiding .vma-dialog {
    animation: dialogPopOut 0.2s ease forwards;
}

@keyframes dialogPopIn {
    from { transform: scale(0.9) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes dialogPopOut {
    from { transform: scale(1) translateY(0); opacity: 1; }
    to { transform: scale(0.9) translateY(10px); opacity: 0; }
}

.vma-dialog-icon {
    text-align: center;
    padding: 28px 24px 12px;
}

.vma-dialog-icon i {
    font-size: 2.8rem;
}

.vma-dialog-icon.success i { color: #22c55e; }
.vma-dialog-icon.error i { color: #ef4444; }
.vma-dialog-icon.warning i { color: #f59e0b; }
.vma-dialog-icon.info i { color: var(--primary); }
.vma-dialog-icon.confirm i { color: var(--accent); }

.vma-dialog-body {
    text-align: center;
    padding: 8px 28px 24px;
}

.vma-dialog-body h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.vma-dialog-body p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

.vma-dialog-actions {
    padding: 14px 24px;
    display: flex;
    gap: 10px;
    justify-content: center;
    border-top: 1px solid #f0f2f5;
}

.vma-dialog-actions .btn {
    min-width: 110px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 10px 20px;
}

/* ===== Loading Spinner ===== */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.loading-spinner .spinner-border {
    color: var(--accent);
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .auth-card {
        padding: 28px 20px;
    }
}

@media (max-width: 767px) {
    .app-content {
        padding: 16px;
    }

    .app-topbar {
        padding: 12px 16px;
    }

    .app-topbar h1 {
        font-size: 1.2rem;
    }

    .data-table {
        font-size: 0.82rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

/* ===== Payment Provider Selector (Admin Settings) ===== */
.payment-provider-option {
    cursor: pointer;
    user-select: none;
}

.payment-provider-option input[type="radio"] {
    display: none;
}

.provider-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 32px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    transition: all 0.2s;
    min-width: 140px;
    color: var(--text-light);
}

.payment-provider-option input[type="radio"]:checked + .provider-card {
    border-color: var(--accent);
    background: #fffbf0;
    color: var(--accent-dark);
    box-shadow: 0 0 0 3px rgba(212, 168, 61, 0.15);
}

.payment-provider-option:hover .provider-card {
    border-color: #d1d5db;
    background: #f3f4f6;
}
