/* ============================================
   Component Styles — Premium Design System
   Buttons, Forms, Cards, Tables, Badges, etc.
   ============================================ */

/* ════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════ */
   .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-family);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* Primary — gradient with glow */
.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    box-shadow: var(--shadow-primary-lg);
    color: #fff;
}

/* Shimmer on primary hover */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.btn-primary:hover::after {
    left: 100%;
}

/* Secondary */
.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

/* Danger */
.btn-danger {
    background: var(--gradient-danger);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-danger);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
    color: #fff;
}

/* Success */
.btn-success {
    background: var(--gradient-jade);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-jade);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    color: #fff;
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--text-primary);
    box-shadow: none;
    transform: none;
}

/* Outline */
.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary-300);
}

.btn-outline-primary:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
    color: var(--primary-700);
}

/* Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    border-radius: var(--radius-xl);
}

.btn-icon {
    padding: var(--space-2);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-lg);
}


/* ════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════ */
.form-group {
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea,
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-family);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    appearance: none;
    -webkit-appearance: none;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    appearance: auto;
    -webkit-appearance: auto;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right var(--space-3) center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: var(--space-10);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group input[readonly],
.form-group input[disabled],
.form-group input:disabled {
    background: var(--gray-50);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--gray-100);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-light);
}


/* ════════════════════════════════════════════
   CARDS (Glassmorphism / Premium)
   ════════════════════════════════════════════ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    pointer-events: none;
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.card-body {
    padding: var(--space-6);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-light);
}

/* ── Stat Card (Dashboard Metric) ── */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease-out both;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.stat-card.stat-primary::before { background: var(--gradient-primary); }
.stat-card.stat-jade::before    { background: var(--gradient-jade); }
.stat-card.stat-accent::before  { background: var(--gradient-accent); }
.stat-card.stat-plum::before    { background: linear-gradient(135deg, #9333ea, #a855f7, #c084fc); }
.stat-card.stat-danger::before  { background: var(--gradient-danger); }

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-4);
}

.stat-primary .stat-card-icon { background: var(--primary-50); color: var(--primary-600); }
.stat-jade .stat-card-icon    { background: var(--jade-50);    color: var(--jade-600); }
.stat-accent .stat-card-icon  { background: var(--accent-50);  color: var(--accent-600); }
.stat-plum .stat-card-icon    { background: var(--plum-50);    color: var(--plum-600); }
.stat-danger .stat-card-icon  { background: var(--danger-50);  color: var(--danger-600); }

.stat-card-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-none);
    margin-bottom: var(--space-1);
    animation: countUp 0.6s ease-out both;
}

.stat-card-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: var(--font-medium);
}

/* ── Welcome Banner (Gradient Hero Card) ── */
.welcome-banner {
    background: var(--gradient-hero);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    border: none;
    border-radius: var(--radius-2xl);
    padding: var(--space-8) var(--space-10);
    position: relative;
    overflow: hidden;
    color: #fff;
    margin-bottom: var(--space-8);
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.2) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-banner h2 {
    color: #fff;
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
    position: relative;
    z-index: 1;
}

.welcome-banner p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-size: var(--text-base);
    position: relative;
    z-index: 1;
}

/* ── Feature Card (Dashboard action cards) ── */
.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-slow);
}

.feature-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
}

.feature-card:hover::after {
    transform: scaleX(1);
}

.feature-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: var(--space-5);
    background: var(--gradient-card-glow);
}

.feature-card h3 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
    font-weight: var(--font-semibold);
}

.feature-card p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-5);
    line-height: var(--leading-relaxed);
}


/* ════════════════════════════════════════════
   TABLES
   ════════════════════════════════════════════ */
.table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Wrapper for tables with many columns: allows horizontal scroll so all columns are visible */
.table-scroll-wrap {
    padding: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%; /* never exceed card when zoomed */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

/* Table inside scroll wrap: use content width so horizontal scroll appears */
.table-scroll-wrap .data-table {
    min-width: max-content;
}

/* Wide table: keep natural column widths so horizontal scroll works; columns after Status stay visible */
.data-table--wide {
    min-width: max-content;
}

/* Compact table: smaller padding and font so more columns fit in the card */
.data-table--compact th,
.data-table--compact td {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8125rem;
}

.data-table--compact th {
    font-size: 0.6875rem;
}

/* Leads table: limit Message and Comments width with ellipsis; full text on hover via title */
.leads-table .col-message {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leads-table .col-comments {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leads-table .col-actions {
    white-space: nowrap;
}

/* Keep table card inside viewport; scroll happens inside .table-scroll-wrap */
.card--no-pad {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

/* Card with responsive padding so it scales with display size (e.g. leads table) */
.card--no-pad .card-body {
    padding: clamp(var(--space-2), 2vw, var(--space-4));
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.data-table th {
    padding: var(--space-3) var(--space-5);
    font-size: 0.6875rem;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-muted);
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.02);
}

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

.data-table td strong {
    color: var(--text-primary);
    font-weight: var(--font-semibold);
}


/* ════════════════════════════════════════════
   STATUS BADGES (Gradient Pills)
   ════════════════════════════════════════════ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* Dot indicator before text */
.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-ACTIVE, .status-active {
    background: var(--success-50);
    color: var(--success-700);
}
.status-ACTIVE::before, .status-active::before { background: var(--success-500); }

.status-COMPLETED, .status-completed {
    background: var(--info-50);
    color: var(--info-600);
}
.status-COMPLETED::before, .status-completed::before { background: var(--info-500); }

.status-CANCELLED, .status-cancelled {
    background: var(--danger-50);
    color: var(--danger-700);
}
.status-CANCELLED::before, .status-cancelled::before { background: var(--danger-500); }

.status-ON_HOLD, .status-on_hold {
    background: var(--warning-50);
    color: var(--warning-600);
}
.status-ON_HOLD::before, .status-on_hold::before { background: var(--warning-500); }

.status-SCHEDULED, .status-scheduled {
    background: var(--plum-50);
    color: var(--plum-700);
}
.status-SCHEDULED::before, .status-scheduled::before { background: var(--plum-500); }

.status-ongoing {
    background: var(--accent-50);
    color: var(--accent-600);
}
.status-ongoing::before { background: var(--accent-500); }

/* Lead status (admin leads) */
.status-NEW {
    background: var(--gray-100);
    color: var(--gray-700);
}
.status-NEW::before { background: var(--gray-500); }
.status-ENROLLED {
    background: var(--success-50);
    color: var(--success-700);
}
.status-ENROLLED::before { background: var(--success-500); }
.status-REJECTED {
    background: var(--danger-50);
    color: var(--danger-600);
}
.status-REJECTED::before { background: var(--danger-500); }


/* ════════════════════════════════════════════
   ROLE BADGES
   ════════════════════════════════════════════ */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
}

.role-ADMIN {
    background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(239,68,68,0.05));
    color: var(--danger-700);
    border: 1px solid rgba(239,68,68,0.15);
}

.role-TEACHER {
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(59,130,246,0.05));
    color: var(--info-600);
    border: 1px solid rgba(59,130,246,0.15);
}

.role-STUDENT {
    background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(16,185,129,0.05));
    color: var(--success-700);
    border: 1px solid rgba(16,185,129,0.15);
}

.role-RM {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(99,102,241,0.05));
    color: var(--primary-700);
    border: 1px solid rgba(99,102,241,0.15);
}


/* ════════════════════════════════════════════
   PROGRESS BAR
   ════════════════════════════════════════════ */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--space-1);
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Animated shimmer on progress */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}


/* ════════════════════════════════════════════
   ALERTS
   ════════════════════════════════════════════ */
.alert {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    animation: fadeInDown 0.3s ease-out;
}

.alert-success {
    background: linear-gradient(135deg, var(--success-50), rgba(16,185,129,0.05));
    color: var(--success-700);
    border: 1px solid var(--success-100);
}

.alert-error {
    background: linear-gradient(135deg, var(--danger-50), rgba(239,68,68,0.05));
    color: var(--danger-700);
    border: 1px solid var(--danger-100);
}

.alert-warning {
    background: linear-gradient(135deg, var(--warning-50), rgba(245,158,11,0.05));
    color: var(--warning-600);
    border: 1px solid var(--warning-100);
}

.alert-info {
    background: linear-gradient(135deg, var(--info-50), rgba(59,130,246,0.05));
    color: var(--info-600);
    border: 1px solid var(--info-100);
}


/* ════════════════════════════════════════════
   INFO BOX
   ════════════════════════════════════════════ */
.info-box {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
    border-left: 4px solid var(--primary);
    background: linear-gradient(135deg, var(--primary-50), rgba(99,102,241,0.03));
    color: var(--primary-700);
}


/* ════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: var(--z-modal);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background: var(--bg-surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    max-width: 500px;
    width: 90%;
    padding: var(--space-8);
    position: relative;
    animation: modalSlideDown 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideDown {
    from { transform: translateY(-40px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0) scale(1);        opacity: 1; }
}

.modal-close {
    position: absolute;
    right: var(--space-5);
    top: var(--space-5);
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--text-primary);
}


/* ════════════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
    color: var(--text-muted);
}

.empty-state h3 {
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: var(--space-6);
}


/* ════════════════════════════════════════════
   PAGE HEADER
   ════════════════════════════════════════════ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
    min-width: 0;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.page-header h1 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    letter-spacing: var(--tracking-tight);
}

.page-header-actions {
    display: flex;
    gap: var(--space-3);
}


/* ════════════════════════════════════════════
   AVATAR
   ════════════════════════════════════════════ */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    font-weight: var(--font-semibold);
    color: #fff;
    background: var(--gradient-primary);
    text-transform: uppercase;
    box-shadow: var(--shadow-primary);
}

.avatar-sm {
    width: 34px;
    height: 34px;
    font-size: var(--text-xs);
}

.avatar-md {
    width: 44px;
    height: 44px;
    font-size: var(--text-sm);
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: var(--text-lg);
}


/* ════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════ */
.toast {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-toast);
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 420px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    backdrop-filter: blur(var(--glass-blur-sm));
    -webkit-backdrop-filter: blur(var(--glass-blur-sm));
}

.toast-success {
    background: linear-gradient(135deg, rgba(16,185,129,0.95), rgba(5,150,105,0.95));
    color: #fff;
    box-shadow: var(--shadow-jade);
}

.toast-error {
    background: linear-gradient(135deg, rgba(239,68,68,0.95), rgba(220,38,38,0.95));
    color: #fff;
    box-shadow: var(--shadow-danger);
}

@keyframes toastSlideIn {
    from { transform: translateX(120%) scale(0.9); opacity: 0; }
    to   { transform: translateX(0) scale(1);       opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0) scale(1);       opacity: 1; }
    to   { transform: translateX(120%) scale(0.9); opacity: 0; }
}


/* ════════════════════════════════════════════
   SCHEDULE ITEM (Classes Page)
   ════════════════════════════════════════════ */
.schedule-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.schedule-item:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.schedule-item.upcoming {
    border-left: 4px solid var(--success);
}

.schedule-item.upcoming::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(16,185,129,0.02) 0%, transparent 50%);
    pointer-events: none;
}

.schedule-item.past {
    border-left: 4px solid var(--gray-300);
    opacity: 0.8;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

.schedule-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.schedule-detail-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-1);
    display: block;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    font-weight: var(--font-medium);
}

.schedule-detail-value {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.schedule-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-light);
}


/* ════════════════════════════════════════════
   FILTER TABS
   ════════════════════════════════════════════ */
.filter-tabs {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-8);
    background: var(--gray-100);
    border-radius: var(--radius-xl);
    padding: 4px;
    width: fit-content;
}

.filter-tab {
    padding: var(--space-2) var(--space-5);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-muted);
    transition: all var(--transition-normal);
    border-radius: var(--radius-lg);
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    color: var(--primary);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    font-weight: var(--font-semibold);
}


/* ════════════════════════════════════════════
   CLASS NUMBER BADGE
   ════════════════════════════════════════════ */
.class-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #fff;
    padding: 4px var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    margin-right: var(--space-3);
    min-width: 28px;
    box-shadow: var(--shadow-primary);
}

.class-badge.past {
    background: var(--gray-400);
    box-shadow: none;
}


/* ════════════════════════════════════════════
   ENROLLMENT INFO BOX
   ════════════════════════════════════════════ */
.enrollment-info {
    background: linear-gradient(135deg, var(--info-50), rgba(59,130,246,0.03));
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
    border: 1px solid var(--info-100);
}

.enrollment-info p {
    margin: var(--space-1) 0;
    color: var(--text-secondary);
}


/* ════════════════════════════════════════════
   SECTION DIVIDER
   ════════════════════════════════════════════ */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: var(--space-8) 0;
    border: none;
}


/* ════════════════════════════════════════════
   GRID LAYOUTS
   ════════════════════════════════════════════ */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-6);
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.grid-full {
    grid-column: 1 / -1;
}


/* ════════════════════════════════════════════
   SEARCH & FILTER BAR
   ════════════════════════════════════════════ */
.search-filter-bar {
    margin-bottom: var(--space-4);
}

.search-filter-form {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    flex: 1;
}

.search-input {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.filter-select {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 140px;
    transition: border-color var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-select-sm {
    min-width: auto;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
}


/* ════════════════════════════════════════════
   SORTABLE TABLE HEADERS
   ════════════════════════════════════════════ */
.sort-header {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.sort-header:hover {
    color: var(--primary);
}

.sort-icon {
    font-size: 0.65em;
    line-height: 1;
    color: var(--primary);
}

.sort-icon-inactive {
    color: var(--text-muted);
    opacity: 0.4;
    font-size: 0.55em;
    letter-spacing: -2px;
}


/* ════════════════════════════════════════════
   PAGINATION
   ════════════════════════════════════════════ */
.pagination-wrapper {
    margin-top: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.pagination-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.page-size-form {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn-active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    cursor: default;
    font-weight: 700;
}

.pagination-btn-active:hover {
    background: var(--primary);
    color: white;
}

.pagination-btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Date/time inputs — open picker on click anywhere */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
    cursor: pointer;
}

/* Responsive */
@media (max-width: 640px) {
    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    .search-input {
        max-width: 100%;
    }
    .pagination-info {
        flex-direction: column;
        align-items: flex-start;
    }
    .pagination-controls {
        justify-content: flex-start;
    }
}

/* ════════════════════════════════════════════
   RESPONSIVE DATA TABLES
   On narrow screens, convert table rows to vertically-stacked
   card-like blocks using the data-label attribute on each <td>.
   Add data-label="Column Name" to your <td> elements.
   ════════════════════════════════════════════ */
@media (max-width: 768px) {
    table.responsive-table thead { display: none; }
    table.responsive-table, table.responsive-table tbody,
    table.responsive-table tr, table.responsive-table td { display: block; width: 100%; }
    table.responsive-table tr {
        padding: 14px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 8px;
        border-radius: 8px;
        background: var(--surface);
    }
    table.responsive-table td {
        padding: 4px 0;
        font-size: 0.84rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    table.responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        min-width: 100px;
        flex-shrink: 0;
    }
    table.responsive-table td:empty { display: none; }
}

/* ════════════════════════════════════════════
   MOBILE BLOCK OVERLAY — Premium Desktop-Only Gate
   Shows a stylish, animated "Desktop Only" experience
   on screens < 1024px for all pages except the public homepage.
   ════════════════════════════════════════════ */
.mobile-block-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #0a0a1a;
    color: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    gap: 0;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

/* ── Animated mesh gradient background ── */
.mobile-block-overlay::before {
    content: '';
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(99, 102, 241, 0.25) 0%, transparent 70%),
        radial-gradient(ellipse 500px 350px at 80% 70%, rgba(139, 92, 246, 0.2) 0%, transparent 70%),
        radial-gradient(ellipse 400px 300px at 50% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    animation: mobileBlockGradientDrift 12s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes mobileBlockGradientDrift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    50%  { transform: translate(-3%, 2%) rotate(2deg); }
    100% { transform: translate(2%, -3%) rotate(-1deg); }
}

/* ── Floating orbs ── */
.mobile-block-overlay .mb-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    z-index: 0;
    animation: mobileBlockOrbFloat 8s ease-in-out infinite alternate;
}
.mobile-block-overlay .mb-orb-1 {
    width: 200px; height: 200px;
    background: #6366f1;
    top: -60px; left: -40px;
    animation-duration: 10s;
}
.mobile-block-overlay .mb-orb-2 {
    width: 160px; height: 160px;
    background: #8b5cf6;
    bottom: -40px; right: -30px;
    animation-duration: 8s;
    animation-delay: -3s;
}
.mobile-block-overlay .mb-orb-3 {
    width: 120px; height: 120px;
    background: #3b82f6;
    top: 40%; left: 60%;
    animation-duration: 12s;
    animation-delay: -6s;
}

@keyframes mobileBlockOrbFloat {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, -25px) scale(1.15); }
}

/* ── Grid pattern overlay ── */
.mobile-block-overlay .mb-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.04;
    background-image:
        linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ── Content card (glassmorphism) ── */
.mobile-block-overlay .mb-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    max-width: 380px;
    padding: 2.5rem 2rem 2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    animation: mobileBlockCardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes mobileBlockCardIn {
    0%   { opacity: 0; transform: translateY(30px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Animated monitor icon ── */
.mobile-block-overlay .mb-icon-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.mobile-block-overlay .mb-icon-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(139,92,246,0.15));
    animation: mobileBlockIconPulse 3s ease-in-out infinite;
}

.mobile-block-overlay .mb-icon-wrap::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(99, 102, 241, 0.15);
    animation: mobileBlockIconRing 3s ease-in-out infinite;
}

@keyframes mobileBlockIconPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.08); opacity: 0.7; }
}

@keyframes mobileBlockIconRing {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50%      { transform: scale(1.15); opacity: 0; }
}

.mobile-block-overlay .mb-icon-wrap svg {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
}

/* ── Chip / badge ── */
.mobile-block-overlay .mb-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(165, 180, 252, 0.9);
}

.mobile-block-overlay .mb-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #818cf8;
    animation: mobileBlockDotBlink 2s ease-in-out infinite;
}

@keyframes mobileBlockDotBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

/* ── Typography ── */
.mobile-block-overlay .mb-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, rgba(199, 210, 254, 0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-block-overlay .mb-desc {
    font-size: 0.88rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    max-width: 320px;
    font-weight: 400;
}

/* ── Separator ── */
.mobile-block-overlay .mb-sep {
    width: 40px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.5), transparent);
    margin: 0.25rem 0;
}

/* ── CTA button ── */
.mobile-block-overlay .mb-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 0.5rem;
    padding: 12px 28px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
    box-shadow:
        0 4px 16px rgba(99, 102, 241, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.mobile-block-overlay .mb-cta:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(99, 102, 241, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.mobile-block-overlay .mb-cta svg {
    transition: transform 0.25s ease;
}
.mobile-block-overlay .mb-cta:hover svg {
    transform: translateX(3px);
}

/* ── Bottom branding ── */
.mobile-block-overlay .mb-brand {
    position: absolute;
    bottom: 2rem;
    z-index: 1;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.18);
}

/* ── Show on mobile (Teacher & RM only — controlled by th:if in layout) ── */
@media (max-width: 1023px) { .mobile-block-overlay { display: flex; } }
/* ── Language switcher ── */
.lang-switcher {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--surface-2, #232733);
    border: 1px solid var(--border, #2a2e3b);
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
}
.lang-switcher a {
    padding: 5px 10px;
    border-radius: 99px;
    color: var(--text-muted, #8b8f9e);
    text-decoration: none;
    transition: all 0.15s;
    min-width: 28px;
    text-align: center;
}
.lang-switcher a:hover { color: var(--text, #e4e5e9); }
.lang-switcher a.active { background: var(--primary, #6366f1); color: #fff; }

/* RTL adjustments */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .app-sidebar { left: auto; right: 0; border-right: none; border-left: 1px solid var(--border); }
html[dir="rtl"] .app-main { margin-left: 0; margin-right: 260px; }
@media (max-width: 1023px) { html[dir="rtl"] .app-main { margin-right: 0; } }

/* ── Cookie consent banner ── */
.cookie-banner {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 9999;
    background: var(--surface, #1a1d27);
    border: 1px solid var(--border, #2a2e3b);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    padding: 18px 22px;
    max-width: 900px;
    margin: 0 auto;
}
.cookie-banner-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.cookie-banner-text {
    flex: 1;
    color: var(--text, #e4e5e9);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
    min-width: 250px;
}
.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.cookie-banner-link {
    color: var(--text-muted, #8b8f9e);
    font-size: 0.85rem;
    text-decoration: underline;
}
.cookie-banner-link:hover { color: var(--text, #e4e5e9); }
.cookie-banner-btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.cookie-banner-decline {
    background: transparent;
    color: var(--text-muted, #8b8f9e);
    border: 1px solid var(--border, #2a2e3b);
}
.cookie-banner-decline:hover { color: var(--text, #e4e5e9); border-color: var(--text-muted); }
.cookie-banner-accept {
    background: var(--primary, #6366f1);
    color: #fff;
}
.cookie-banner-accept:hover { background: var(--primary-light, #818cf8); }
