@import "tailwindcss";
@config "../../tailwind.config.js";
@custom-variant dark (&:where(.dark, .dark *));

:root {
    --student-primary: 37 99 235;
    --student-primary-container: 147 197 253;
    --student-primary-light: 219 234 254;
    --student-primary-dark: 29 78 216;
}

[x-cloak] {
    display: none !important;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

html.dark ::-webkit-scrollbar-thumb {
    background: #3f3f46;
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

body[data-app-shell="student-portal"] {
    font-family: Cairo, sans-serif;
}

body[data-app-shell="student-portal"] .no-scrollbar::-webkit-scrollbar {
    display: none;
}

body[data-app-shell="student-portal"] .no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body[data-app-shell="student-portal"] .student-surface {
    background:
        radial-gradient(ellipse at 80% 0%, rgb(var(--student-primary) / 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 100%, rgba(253, 203, 110, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.04) 0%, transparent 60%),
        #eef2f7;
}

html.dark body[data-app-shell="student-portal"] .student-surface {
    background:
        radial-gradient(ellipse at 80% 0%, rgb(var(--student-primary) / 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 100%, rgba(253, 203, 110, 0.06) 0%, transparent 50%),
        #09090b;
}

body[data-app-shell="student-portal"] .student-card {
    border-radius: 1.75rem;
    border: 1px solid rgba(226, 232, 240, 1);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

body[data-app-shell="student-portal"] .student-card:hover {
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08), 0 1px 4px rgba(15, 23, 42, 0.06);
}

html.dark body[data-app-shell="student-portal"] .student-card {
    border-color: rgba(39, 39, 42, 1);
    background: rgba(24, 24, 27, 1);
    box-shadow: none;
}

/* Sidebar improvements */
body[data-app-shell="student-portal"] .app-sidebar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    border-inline-end: 1px solid rgba(226, 232, 240, 1);
}

html.dark body[data-app-shell="student-portal"] .app-sidebar {
    background: #18181b;
    border-inline-end-color: rgba(39, 39, 42, 1);
}

/* Header glass effect */
body[data-app-shell="student-portal"] header {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 1px 0 rgba(226, 232, 240, 0.5);
}

html.dark body[data-app-shell="student-portal"] header {
    background: rgba(9, 9, 11, 0.85) !important;
    border-bottom-color: rgba(39, 39, 42, 0.8) !important;
}

/* Active nav item glow */
body[data-app-shell="student-portal"] nav a.bg-blue-600 {
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* Smooth page transitions */
body[data-app-shell="student-portal"] main {
    animation: fadeInUp 0.25s ease both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Progress bars */
body[data-app-shell="student-portal"] .h-2,
body[data-app-shell="student-portal"] .h-2\.5 {
    border-radius: 9999px;
    overflow: hidden;
}

/* Card links hover lift */
body[data-app-shell="student-portal"] a.block.rounded-2xl {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

body[data-app-shell="student-portal"] a.block.rounded-2xl:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.10);
}

/* Stat cards */
body[data-app-shell="student-portal"] .rounded-\[1\.5rem\] {
    transition: transform 0.15s ease;
}

/* Points card gradient */
body[data-app-shell="student-portal"] a.bg-primary {
    background: linear-gradient(135deg, rgb(var(--student-primary)) 0%, rgb(var(--student-primary-dark)) 100%) !important;
    box-shadow: 0 8px 24px rgb(var(--student-primary) / 0.35);
}

/* Section headings */
body[data-app-shell="student-portal"] h1 {
    letter-spacing: -0.02em;
}

body[data-app-shell="student-portal"] h2 {
    letter-spacing: -0.01em;
}

/* Badge pill */
body[data-app-shell="student-portal"] .rounded-full.bg-secondary {
    background: linear-gradient(135deg, #FF8585, #ff6b6b) !important;
    box-shadow: 0 2px 8px rgba(255, 133, 133, 0.4);
}

/* Inline flex buttons */
body[data-app-shell="student-portal"] a.inline-flex.bg-primary {
    background: linear-gradient(135deg, rgb(var(--student-primary)) 0%, rgb(var(--student-primary-dark)) 100%) !important;
    box-shadow: 0 4px 14px rgb(var(--student-primary) / 0.30);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body[data-app-shell="student-portal"] a.inline-flex.bg-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgb(var(--student-primary) / 0.40);
}

/* Empty state dashed borders */
body[data-app-shell="student-portal"] .border-dashed {
    background: rgba(248, 250, 252, 0.8);
}

html.dark body[data-app-shell="student-portal"] .border-dashed {
    background: rgba(24, 24, 27, 0.5);
}

/* Notification dot pulse */
body[data-app-shell="student-portal"] .animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Sidebar logo area */
body[data-app-shell="student-portal"] .app-sidebar .text-primary {
    background: linear-gradient(135deg, rgb(var(--student-primary)), rgb(var(--student-primary-dark)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile bottom safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body[data-app-shell="student-portal"] main {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

body[data-app-shell="student-portal"] .app-sidebar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body[data-app-shell="student-portal"] .sidebar-expanded {
    width: 18rem;
}

body[data-app-shell="student-portal"] .sidebar-collapsed {
    width: 5.5rem;
}

body[data-app-shell="student-portal"] .sidebar-hidden {
    width: 0;
    overflow: hidden;
    border: 0 !important;
}

@media (max-width: 1023px) {
    body[data-app-shell="student-portal"] .app-sidebar {
        position: fixed;
        z-index: 50;
        height: 100vh;
    }

    body[data-app-shell="student-portal"] .sidebar-expanded {
        transform: translateX(0);
    }

    body[data-app-shell="student-portal"] .sidebar-collapsed,
    body[data-app-shell="student-portal"] .sidebar-hidden {
        transform: translateX(-100%);
    }

    html[dir="rtl"] body[data-app-shell="student-portal"] .sidebar-collapsed,
    html[dir="rtl"] body[data-app-shell="student-portal"] .sidebar-hidden {
        transform: translateX(100%);
    }
}

/* ── Main Dashboard (SFA-matching design) ─────────────────────── */

body[data-app-shell="main-dashboard"] {
    font-family: Cairo, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sidebar mobile */
body[data-app-shell="main-dashboard"] .app-sidebar {
    width: 16rem;
    transform: translateX(-100%);
    transition: none;
}

html[dir="rtl"] body[data-app-shell="main-dashboard"] .app-sidebar {
    transform: translateX(100%);
}

body[data-app-shell="main-dashboard"] .app-sidebar.sidebar-animated {
    transition: width 300ms ease-in-out, opacity 300ms ease-in-out;
}

body[data-app-shell="main-dashboard"] .app-sidebar.sidebar-open {
    transform: translateX(0) !important;
}

/* Sidebar desktop */
@media (min-width: 1024px) {
    body[data-app-shell="main-dashboard"] .app-sidebar {
        transform: translateX(0) !important;
    }
}

/* Smooth page transitions */
body[data-app-shell="main-dashboard"] .page-content {
    animation: lmsFadeInUp 0.2s ease-out;
}

@keyframes lmsFadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Active nav indicator */
body[data-app-shell="main-dashboard"] .nav-active-indicator {
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 4px 4px 0;
    background: #4f46e5;
}

html[dir="rtl"] body[data-app-shell="main-dashboard"] .nav-active-indicator {
    inset-inline-start: auto;
    inset-inline-end: 0;
    border-radius: 4px 0 0 4px;
}

/* Stat card gradients */
body[data-app-shell="main-dashboard"] .stat-gradient-blue    { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); }
body[data-app-shell="main-dashboard"] .stat-gradient-emerald { background: linear-gradient(135deg, #059669 0%, #0891b2 100%); }
body[data-app-shell="main-dashboard"] .stat-gradient-amber   { background: linear-gradient(135deg, #d97706 0%, #dc2626 100%); }
body[data-app-shell="main-dashboard"] .stat-gradient-rose    { background: linear-gradient(135deg, #e11d48 0%, #9333ea 100%); }
body[data-app-shell="main-dashboard"] .stat-gradient-cyan    { background: linear-gradient(135deg, #0891b2 0%, #4f46e5 100%); }
body[data-app-shell="main-dashboard"] .stat-gradient-violet  { background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%); }

/* Card */
body[data-app-shell="main-dashboard"] .card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04);
}

html.dark body[data-app-shell="main-dashboard"] .card {
    background: #0f172a;
    border-color: #1e293b;
}

/* Table headers */
body[data-app-shell="main-dashboard"] table thead tr th {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

html.dark body[data-app-shell="main-dashboard"] table thead tr th { color: #94a3b8; }

/* Form inputs */
body[data-app-shell="main-dashboard"] input[type="text"],
body[data-app-shell="main-dashboard"] input[type="email"],
body[data-app-shell="main-dashboard"] input[type="password"],
body[data-app-shell="main-dashboard"] input[type="number"],
body[data-app-shell="main-dashboard"] input[type="date"],
body[data-app-shell="main-dashboard"] input[type="tel"],
body[data-app-shell="main-dashboard"] input[type="url"],
body[data-app-shell="main-dashboard"] input[type="search"],
body[data-app-shell="main-dashboard"] input[type="time"],
body[data-app-shell="main-dashboard"] textarea,
body[data-app-shell="main-dashboard"] select {
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.15s;
}

/* Primary button */
body[data-app-shell="main-dashboard"] .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: #4f46e5;
    color: #fff;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    transition: background 0.15s;
}

body[data-app-shell="main-dashboard"] .btn-primary:hover { background: #4338ca; }

/* Badge */
body[data-app-shell="main-dashboard"] .badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Pagination active */
body[data-app-shell="main-dashboard"] nav[aria-label="Pagination"] span[aria-current="page"] > span,
body[data-app-shell="main-dashboard"] nav[aria-label="pagination"] span[aria-current="page"] > span {
    background: #4f46e5 !important;
    color: #fff !important;
    border-color: #4f46e5 !important;
    border-radius: 0.5rem;
}

/* Select arrow */
body[data-app-shell="main-dashboard"] 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 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2rem;
    appearance: none;
}

html[dir="rtl"] body[data-app-shell="main-dashboard"] select {
    background-position: left 0.5rem center;
    padding-right: 0.75rem;
    padding-left: 2rem;
}

body[data-app-shell="main-dashboard"] .page-hero-unified {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    border: 1px solid rgba(191, 219, 254, 0.92);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.96) 0%, rgba(255, 255, 255, 0.99) 100%) !important;
    color: #0f172a !important;
    box-shadow: 0 16px 36px -28px rgba(37, 99, 235, 0.28);
}

html.dark body[data-app-shell="main-dashboard"] .page-hero-unified {
    border-color: rgba(59, 130, 246, 0.18);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(9, 9, 11, 0.98) 100%) !important;
    color: #f8fafc !important;
    box-shadow: none;
}

body[data-app-shell="main-dashboard"] .page-hero-unified::before {
    content: "";
    position: absolute;
    inset-inline-end: -3rem;
    top: -3rem;
    width: 10rem;
    height: 10rem;
    border-radius: 9999px;
    background: rgba(59, 130, 246, 0.08);
    filter: blur(30px);
    pointer-events: none;
}

body[data-app-shell="main-dashboard"] .page-hero-unified > * {
    position: relative;
    z-index: 1;
}

body[data-app-shell="main-dashboard"] .page-hero-unified a.inline-flex,
body[data-app-shell="main-dashboard"] .page-hero-unified button.inline-flex {
    border-radius: 1rem !important;
}

body[data-app-shell="main-dashboard"] .page-hero-unified a.bg-sky-600,
body[data-app-shell="main-dashboard"] .page-hero-unified a.bg-brand-600,
body[data-app-shell="main-dashboard"] .page-hero-unified button.bg-sky-600,
body[data-app-shell="main-dashboard"] .page-hero-unified button.bg-brand-600 {
    background: #fff !important;
    color: #1d4ed8 !important;
}

body[data-app-shell="main-dashboard"] .page-hero-unified a.border,
body[data-app-shell="main-dashboard"] .page-hero-unified button.border {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

body[data-app-shell="main-dashboard"] .page-hero-unified a:hover,
body[data-app-shell="main-dashboard"] .page-hero-unified button:hover {
    transform: translateY(-1px);
}

body[data-app-shell="main-dashboard"] .sidebar-module {
    position: relative;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

body[data-app-shell="main-dashboard"] .sidebar-module.is-dragging {
    opacity: 0.45;
    transform: scale(0.985);
}

body[data-app-shell="main-dashboard"] .sidebar-module.is-drop-target {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
    border-radius: 1.5rem;
}

body[data-app-shell="main-dashboard"] .sidebar-module-handle {
    cursor: grab;
}

body[data-app-shell="main-dashboard"] .sidebar-module-handle:active {
    cursor: grabbing;
}
