/* 
    ICOFP LMS - Global Styling System
    A unified CSS framework for the entire application.
    Includes: Design tokens, components, animations, and typography enhancements.
*/

:root {
    /* Color Palette - Primary */
    --primary-color: #ed1b24; /* Deep Red */
    --primary-light: rgba(237, 27, 36, 0.1);
    --primary-hover: #c9101a;

    /* Color Palette - Accents */
    --accent-color: #f8d905; /* Bright Gold */
    --accent-light: rgba(248, 217, 5, 0.1);

    /* Backgrounds */
    --bg-light: #ffffff;
    --bg-dark: #f8fafc;

    /* Slate / Neutral Scale */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;

    /* Rich Theme (Light) */
    --rich-black: #0f172a;
    --rich-dark: #f8fafc;
    --rich-glass: rgba(255, 255, 255, 0.8);
    --neon-blue: #3b82f6;
    --neon-purple: #8b5cf6;
    --gold-accent: #f8d905;

    /* Fonts */
    --font-display: 'Montserrat', sans-serif;
    --font-sans: 'Inter', sans-serif;
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */

body {
    font-family: var(--font-sans);
    background-color: #ffffff;
    color: var(--slate-900);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    width: 100%;
}

a {
    text-decoration: none !important;
    color: inherit;
    transition: all 0.3s ease;
}

.font-display {
    font-family: var(--font-display);
}

/* Smooth property transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Material Symbols Standardization */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Dashboard Component Library (Global)
   ========================================================================== */

/* Modern Dashboard Cards */
.dashboard-card {
    background: #ffffff;
    border-radius: 1.5rem !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    border-top: .5rem solid #f8d905 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.institution-card {
    border-top: .5rem solid #f8d905 !important;
}

.dark .dashboard-card {
    background: var(--slate-900) !important;
    border-color: var(--slate-800) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3) !important;
}

.dashboard-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    border-color: #3b82f6 !important;
    /* Blue-500 */
}

/* Container fixes for horizontal overflow */
.max-w-7xl {
    width: 100% !important;
    max-width: 80rem !important;
    margin-left: auto;
    margin-right: auto;
}

section {
    position: relative;
    overflow-x: hidden;
    width: 100%;
}

/* Glassmorphic Effects */
.card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .card-glass {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(30, 41, 59, 0.5);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.card-glass:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.08);
}

/* Status Indicators */
.status-dot {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.3);
    animation: pulse-ring 2s infinite;
}

.status-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    background-color: var(--primary-color);
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 700;
    border: 2px solid white;
}

.dark .status-badge {
    border-color: var(--slate-800);
}

/* ==========================================================================
   Navigation & UI Elements
   ========================================================================== */

/* Tab Buttons */
.tab-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: var(--slate-500);
    transition: all 0.3s ease;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    white-space: nowrap;
}

.tab-btn.is-active {
    background: var(--slate-900);
    color: #ffffff !important;
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.2);
}

.dark .tab-btn.is-active {
    background: var(--accent-color);
    color: var(--slate-900) !important;
    box-shadow: 0 10px 15px -3px rgba(250, 204, 21, 0.2);
}

.tab-btn:not(.is-active):hover {
    background: rgba(226, 232, 240, 0.5);
    color: var(--slate-800);
}

.dark .tab-btn:not(.is-active):hover {
    background: rgba(30, 41, 59, 0.5);
    color: var(--slate-100);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: tabFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dropdown Shadow */
.dropdown-shadow {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    50% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 3s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loader-pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.blink-soft {
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes glow-pulse {
    0% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.8); }
    100% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.5); }
}

@keyframes border-draw {
    0% { border-color: transparent; }
    100% { border-color: var(--neon-blue); }
}

@keyframes slide-up-subtle {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-glow {
    animation: glow-pulse 3s infinite;
}

.animate-slide-up {
    animation: slide-up-subtle 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.rich-dark-bg {
    background-color: var(--rich-black);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.05) 0px, transparent 50%);
}

.institution-card {
    background: var(--rich-glass);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
}

.institution-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.institution-card:hover img {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.institution-card img {
    transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

.text-gradient-gold {
    background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   SPA & Loading Progress
   ========================================================================== */

.spa-loading {
    opacity: 0.5;
    pointer-events: none;
    cursor: wait;
}

#spa-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #6366f1, #facc15);
    z-index: 9999;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

#spa-loader.active {
    transform: scaleX(1);
    animation: loader-pulse 2s infinite linear;
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--slate-200);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--slate-700);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--slate-300);
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--slate-600);
}

/* ==========================================================================
   Special Buttons
   ========================================================================== */

.townhall-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff !important;
    font-weight: 900 !important;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Premium Form UI Components (Shared)
   ========================================================================== */

.premium-box {
    display: flex;
    align-items: center;
    background-color: var(--slate-50);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.dark .premium-box {
    background-color: rgba(30, 41, 59, 0.5);
    border-color: rgba(51, 65, 85, 0.6);
}

.premium-box:focus-within {
    border-color: rgba(79, 70, 229, 0.5);
    box-shadow: 0 5px 15px -5px rgba(79, 70, 229, 0.15);
    background-color: #ffffff;
}

.dark .premium-box:focus-within {
    background-color: var(--slate-800);
}

.p-book-input {
    width: 100%;
    background: transparent;
    padding: 0.625rem 1rem;
    font-size: 13px;
    font-weight: 700;
    color: var(--slate-800);
    outline: none;
    border: none;
}

.dark .p-book-input {
    color: var(--slate-200);
}

.p-book-input::placeholder {
    color: var(--slate-400);
    font-weight: 500;
}

/* Premium Buttons */
.premium-p-button {
    position: relative;
    overflow: hidden;
    background-color: var(--slate-900);
    color: white;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 10px;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .premium-p-button {
    background-color: #4f46e5;
    /* Indigo-600 */
}

.premium-p-button:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.premium-p-button:active {
    transform: scale(0.95);
}

.premium-p-button-bg {
    position: absolute;
    inset: 0;
    background-color: #4f46e5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dark .premium-p-button-bg {
    background-color: white;
}

.premium-p-button:hover .premium-p-button-bg {
    opacity: 0.1;
}

.dark .premium-p-button:hover .premium-p-button-bg {
    opacity: 1;
}

.dark .premium-p-button:hover {
    color: var(--slate-900);
}

/* ==========================================================================
   Accordion Library (Global)
   ========================================================================== */

.accordion-group.is-open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-group.is-open .accordion-icon-bg {
    background-color: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 10px 15px -3px rgba(26, 34, 127, 0.2) !important;
}

.accordion-group.is-open .accordion-title {
    color: var(--primary-color) !important;
}

.accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, visibility 0.4s;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
}

.accordion-content.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
}

.accordion-inner {
    min-height: 0;
}

.accordion-group.is-open {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(79, 70, 229, 0.2) !important;
    outline: 1px solid rgba(79, 70, 229, 0.2);
}

/* Shimmer Animation Utils */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

/* Media Elements */
iframe {
    width: 100%;
    height: 60vh;
    border-radius: 1rem;
}

video {
    width: 100%;
    height: auto;
    border-radius: 1rem;
}