/* Modern Page Load Animations - No Blink Effect */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Remove animation completely to eliminate blink */
.animate-fade-in {
    opacity: 1;
    transform: none;
    animation: none;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Alternative: Very subtle animation if needed */
.animate-subtle-fade {
    animation: fadeIn 0.2s ease-in;
}

/* Page transition for smooth navigation */
body {
    transition: opacity 0.15s ease-in-out;
}

body.page-loading {
    opacity: 0.7;
}

/* Alternative modern animations */
.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

.animate-fade-smooth {
    animation: fadeInSmooth 0.6s ease-out forwards;
}

/* Hover lift effect */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Category Headers - Refined Pill Design */
.pro-header-pill {
    display: inline-block !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #57534e !important;
    background-color: #f5f5f4 !important;
    padding: 2px 12px !important;
    border-radius: 9999px !important;
    margin-top: 24px !important;
    margin-bottom: 8px !important;
    margin-left: 12px !important;
    border: 1px solid #e7e5e4 !important;
}

/* assets/css/premium-ui.css - Karma Academy Color Scheme */

:root {
    /* Primary - Navy Blue */
    --primary-color: #1e3a8a;
    --primary-hover: #1e40af;
    --primary-light: #dbeafe;
    --primary-dark: #1e293b;

    /* Secondary - Teal */
    --secondary-color: #0891b2;
    --secondary-hover: #0e7490;
    --secondary-light: #cffafe;

    /* Accent - Amber */
    --accent-color: #f59e0b;
    --accent-hover: #d97706;
    --accent-light: #fef3c7;

    /* Semantic */
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    /* Backgrounds - Warm Neutrals */
    --bg-white: #ffffff;
    --bg-gray-50: #fafaf9;
    --bg-gray-100: #f5f5f4;
    --bg-gray-900: #1c1917;

    /* Text - Stone Tones */
    --text-gray-900: #1c1917;
    --text-gray-800: #292524;
    --text-gray-700: #44403c;
    --text-gray-600: #57534e;
    --text-gray-500: #78716c;
    --text-white: #ffffff;

    /* Legacy aliases */
    --bg-main-pro: #f5f5f4;
    --bg-sidebar-pro: #fafaf9;
    --indigo-pro: #1e3a8a;
    --indigo-active-bg: rgba(30, 58, 138, 0.08);
    --slate-pro-text: #1c1917;
    --border-pro-soft: #e7e5e4;
}

body {
    background-color: var(--bg-main-pro);
    color: var(--slate-pro-text);
    font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
}

/* Sidebar Active States - High Prominence (SaaS Edition) */
.nav-link-active {
    font-weight: 600 !important;
    color: #1e3a8a !important;
    background-color: #dbeafe !important;
    border-radius: 12px;
    position: relative;
    margin-left: 16px; /* Indented 4px relative to header (12px) */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Top-level navigation links overrides (no indent, pill shape) */
.top-level-nav.nav-link-active,
.top-level-nav.nav-link-inactive {
    margin-left: 0 !important;
}

.top-level-nav.nav-link-active {
    border-radius: 9999px !important;
}

.top-level-nav.nav-link-active::before {
    display: none !important;
}

.nav-link-active span {
    color: #1e3a8a !important;
}

/* 3px vertical indicator bar */
.nav-link-active::before {
    content: '';
    position: absolute;
    left: -12px; /* Positioned relative to the indented link */
    top: 20%;
    height: 60%;
    width: 3px;
    background-color: #1e3a8a;
    border-radius: 9999px;
}

.nav-link-inactive {
    font-weight: 400 !important;
    color: #78716c !important;
    border-left: 4px solid transparent;
    margin-left: 16px; /* Indented 4px relative to header (12px) */
    transition: all 0.2s ease;
}

.nav-link-inactive:hover {
    background-color: #fafaf9 !important;
    color: #1c1917 !important;
}

/* Footer & Logout Refinement */
.sidebar-footer {
    border-top: 1px solid #e7e5e4;
    padding-top: 16px;
    margin-top: 16px;
}

.logout-text {
    color: #EF4444 !important;
    font-weight: 600;
}

.premium-subtitle {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #78716c;
    text-align: center;
    margin-top: 4px;
}

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

/* ========== Print Styles ========== */
@media print {
    /* Hide non-printable elements */
    #sidebar, #sidebar-overlay, #sidebar-open,
    #grk-toast, #grk-modal, #grk-loader,
    footer, .no-print,
    button, a[href*="page="],
    nav, .hover-lift {
        display: none !important;
    }

    /* Reset layout to full-width */
    body {
        opacity: 1 !important;
        background: white !important;
        font-size: 11pt;
        color: #000 !important;
    }

    main, .main-content, [class*="ml-"] {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Reset card styles for print */
    .glass, [class*="rounded-"] {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        border-radius: 4px !important;
    }

    /* Make timetable tables print-friendly */
    table {
        border-collapse: collapse !important;
        width: 100% !important;
        font-size: 9pt;
    }

    table th, table td {
        border: 1px solid #333 !important;
        padding: 4px 6px !important;
        color: #000 !important;
        background: white !important;
    }

    table th {
        background: #f0f0f0 !important;
        font-weight: bold;
    }

    /* Ensure colored subject cells print with background */
    .draggable-item, [style*="background"] {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Page breaks */
    .page-break-before { page-break-before: always; }
    .page-break-after { page-break-after: always; }
    h1 { page-break-after: avoid; }
    table { page-break-inside: auto; }
    tr { page-break-inside: avoid; }
}

/* Premium Dropdown Styling */
.premium-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem !important;
    background-color: #f8fafc !important; /* bg-slate-50 */
    border: 1px solid #f1f5f9 !important; /* border-slate-100 */
    border-radius: 1rem !important; /* rounded-2xl */
    font-size: 0.75rem !important; /* text-xs */
    font-weight: 900 !important; /* font-black */
    color: #1e293b !important; /* text-slate-800 */
    transition: all 0.2s ease-in-out !important;
    cursor: pointer !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1rem !important;
    line-height: 1.25 !important;
}

.premium-select:focus {
    outline: none !important;
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.05) !important;
}

.premium-select:hover {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}

.premium-select:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background-color: #f1f5f9 !important;
}

/* ========== Global Loader Overlay Styles ========== */
.grk-loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeIn 0.4s ease;
}

.grk-loader-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.grk-loader-ring {
    width: 80px;
    height: 80px;
    border: 4px solid #eff6ff;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.grk-loader-inner-text {
    position: absolute;
    font-family: 'Harlow Solid Italic', 'Harlow Solid', cursive;
    font-size: 26px;
    font-weight: 900;
    font-style: italic;
    color: #2563eb;
    line-height: 1;
    letter-spacing: -0.05em;
}

.grk-loader-status {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 900;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    margin-top: 1.5rem;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Collapsible Sidebar Styles */
#sidebar {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, width 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@media (min-width: 768px) {
    body.sidebar-collapsed #sidebar {
        margin-left: -300px !important;
        opacity: 0;
        pointer-events: none;
    }
}

@media (min-width: 1024px) {
    body.sidebar-collapsed #sidebar-open {
        display: flex !important;
    }
}

