/* Custom Styles for LSB Applied AI Studio */

/* ========================================
   TYPOGRAPHY SYSTEM WITH VARIABLE FONTS
   ======================================== */

:root {
    /* Color Tokens - Light Mode (Default) */
    --color-primary: #73000a;
    --color-primary-rgb: 115, 0, 10;
    --color-accent: #b59a57;
    --color-accent-rgb: 181, 154, 87;
    --color-text: #212121;
    --color-text-rgb: 33, 33, 33;
    --color-bg: #ffffff;
    --color-bg-rgb: 255, 255, 255;
    --color-surface: #f5f5f5;
    --color-surface-rgb: 245, 245, 245;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-shadow: rgba(0, 0, 0, 0.1);

    /* Typography Scale - Fluid Sizing */
    --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --font-size-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --font-size-lg: clamp(1.125rem, 1rem + 0.625vw, 1.5rem);
    --font-size-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.875rem);
    --font-size-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2.25rem);
    --font-size-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 3rem);
    --font-size-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3.75rem);
    --font-size-5xl: clamp(3rem, 2rem + 5vw, 4.5rem);
    --font-size-6xl: clamp(3.75rem, 2.5rem + 6.25vw, 6rem);
    --font-size-7xl: clamp(4.5rem, 3rem + 7.5vw, 7.5rem);

    /* Font Weights - Variable */
    --font-weight-thin: 100;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    --font-weight-black: 900;

    /* Line Heights */
    --line-height-tight: 1.2;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;

    /* Letter Spacing */
    --letter-spacing-tighter: -0.05em;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;

    /* Transitions */
    --transition-theme: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --color-primary: #b59a57;
    --color-primary-rgb: 181, 154, 87;
    --color-accent: #d4b87b;
    --color-accent-rgb: 212, 184, 123;
    --color-text: #e5e5e5;
    --color-text-rgb: 229, 229, 229;
    --color-bg: #1a1a1a;
    --color-bg-rgb: 26, 26, 26;
    --color-surface: #2a2a2a;
    --color-surface-rgb: 42, 42, 42;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-shadow: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', sans-serif;
    color: #212121;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    font-feature-settings: 'cv11', 'ss01';
    font-optical-sizing: auto;
    /* Safe area insets for notched devices (iPhone X+) */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Typography Classes */
.text-display {
    font-size: var(--font-size-7xl);
    font-weight: var(--font-weight-black);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tighter);
}

.text-headline {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
}

.text-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-snug);
}

.text-body {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
}

.text-caption {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-normal);
}

/* Dynamic font-weight on scroll */
.dynamic-weight {
    transition: font-weight 0.3s ease-out;
}

/* ========================================
   DYNAMIC THEME SYSTEM
   ======================================== */

/* Theme transitions */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 2px solid var(--color-border);
    cursor: pointer;
    box-shadow: 0 4px 12px var(--color-shadow);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px var(--color-shadow);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: white;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(180deg);
}

/* Ambient glow effects */
.ambient-glow {
    position: relative;
}

.ambient-glow::before {
    content: '';
    position: absolute;
    inset: -30px;
    background: radial-gradient(
        circle at center,
        rgba(var(--color-accent-rgb), 0.15) 0%,
        transparent 70%
    );
    filter: blur(40px);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    z-index: -1;
}

.ambient-glow:hover::before {
    opacity: 1;
}

/* Apply themed colors to body */
body {
    background-color: var(--color-bg);
    color: var(--color-text);
}

/* Override Tailwind classes with theme variables */
.bg-white {
    background-color: var(--color-bg) !important;
}

.text-elonMaroon {
    color: var(--color-primary) !important;
}

.text-elonGold {
    color: var(--color-accent) !important;
}

.text-elonGray {
    color: var(--color-text) !important;
}

.bg-elonSmoke {
    background-color: var(--color-surface) !important;
}

/* Dark mode specific adjustments */
[data-theme="dark"] .bg-elonMaroon {
    background-color: var(--color-primary) !important;
}

[data-theme="dark"] #main-header {
    background-color: rgba(var(--color-surface-rgb), 0.8);
    border-bottom-color: var(--color-border);
}

[data-theme="dark"] .pillar-card {
    background-color: var(--color-surface) !important;
}

[data-theme="dark"] .shadow-xl {
    box-shadow: 0 20px 50px var(--color-shadow);
}

/* ========================================
   ENHANCED HEADER STYLES
   ======================================== */

/* Header base styles with glassmorphism */
#main-header {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background-color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

/* Header scrolled state */
#main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0;
}

/* Logo scaling on scroll */
#header-logo {
    transform-origin: left center;
}

#main-header.scrolled #header-logo {
    transform: scale(0.9);
}

/* Navigation link hover effect with underline */
.nav-link {
    position: relative;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #73000a 0%, #b59a57 100%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile menu animations */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.show {
    max-height: 500px;
}

/* Mobile menu button animation */
#mobile-menu-btn svg {
    transition: transform 0.3s ease;
}

#mobile-menu-btn.active svg {
    transform: rotate(90deg);
}

/* ========================================
   ENHANCED HERO SECTION
   ======================================== */

/* Video background styles */
#hero-video {
    filter: brightness(0.7) contrast(1.1);
    transform: scale(1.05); /* Slight zoom for cinematic effect */
}

/* Video fallback */
.hero-video-fallback {
    display: none;
}

video:not([src]) + .hero-video-fallback {
    display: block;
}

.hero-bg-alt {
    background-image: url('https://images.pexels.com/photos/546819/pexels-photo-546819.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2');
    background-size: cover;
    background-position: center;
}

/* Ken Burns effect for mobile (when video is disabled) */
@media (max-width: 768px) {
    .hero-bg-alt {
        animation: kenBurns 20s ease-in-out infinite alternate;
    }
}

@keyframes kenBurns {
    0% {
        transform: scale(1) translateX(0);
    }
    100% {
        transform: scale(1.1) translateX(-5%);
    }
}

/* Hero content parallax container */
#hero-content {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* Split-text animation for hero title */
.hero-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px) rotateX(-90deg);
    transform-style: preserve-3d;
    animation: splitTextIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-word[data-word="1"] { animation-delay: 0.1s; }
.hero-word[data-word="2"] { animation-delay: 0.2s; }
.hero-word[data-word="3"] { animation-delay: 0.3s; }
.hero-word[data-word="4"] { animation-delay: 0.4s; }
.hero-word[data-word="5"] { animation-delay: 0.5s; }

@keyframes splitTextIn {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* Hero subtitle fade in */
#hero-subtitle {
    animation: fadeInUp 1s ease-out 0.7s forwards;
}

/* CTA button animation */
#cta-button {
    animation: fadeInScale 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1s forwards;
}

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

/* Scroll indicator styles */
.scroll-indicator {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: border-color 0.3s ease;
    /* Add padding to increase touch target */
    padding: 8px;
    margin: -8px; /* Compensate for padding */
}

.scroll-indicator:hover {
    border-color: rgba(181, 154, 87, 0.8);
}

/* Mobile touch target enhancement */
@media (max-width: 768px) {
    .scroll-indicator {
        padding: 12px; /* Larger touch area on mobile */
        margin: -12px;
    }
}

.scroll-indicator-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) translateY(20px);
        opacity: 0.3;
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn 1s ease-out forwards;
}

/* ========================================
   3D CARD HOVER EFFECTS
   ======================================== */

/* Pillar card base styles */
.pillar-card {
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    transition: transform 0.1s ease-out, box-shadow 0.3s ease-out;
    will-change: transform;
    overflow: hidden;
    min-height: 320px; /* Ensure consistent card height */
    display: flex;
    flex-direction: column;
}

/* 4-card layout responsive adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    /* 2-column layout on tablets */
    .pillar-card {
        min-height: 340px;
    }
}

@media (min-width: 1024px) {
    /* 4-column layout on desktop */
    .pillar-card {
        min-height: 360px;
    }

    /* Adjust font sizes for 4-column layout */
    .pillar-card h3 {
        font-size: 1.125rem; /* Slightly smaller than default */
    }

    .pillar-card p {
        font-size: 0.875rem; /* Ensure readability in narrow columns */
    }
}

/* Multi-layer shadow system for depth */
.pillar-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none;
    box-shadow:
        0 2px 8px rgba(115, 0, 10, 0.05),
        0 4px 16px rgba(115, 0, 10, 0.08),
        0 8px 32px rgba(115, 0, 10, 0.12);
}

.pillar-card:hover::before {
    opacity: 1;
}

/* Enhanced shadow on hover - lifted effect */
.pillar-card:hover {
    box-shadow:
        0 10px 40px rgba(115, 0, 10, 0.15),
        0 20px 60px rgba(115, 0, 10, 0.1),
        0 30px 80px rgba(115, 0, 10, 0.08),
        0 0 0 1px rgba(181, 154, 87, 0.1);
}

/* Card content wrapper */
.card-content {
    position: relative;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    flex: 1; /* Take full height of parent */
}

.card-content p {
    flex-grow: 1; /* Push the link to the bottom */
}

.card-content a {
    pointer-events: auto;
    margin-top: auto; /* Align link to bottom */
    display: inline-block; /* Better touch target */
    padding: 0.5rem 0; /* 8px vertical padding for touch */
    min-height: 44px; /* Ensure minimum touch target height */
    line-height: 1.75; /* Improve vertical centering */
}

/* Mobile-specific adjustments for card links */
@media (max-width: 768px) {
    .card-content a {
        padding: 0.75rem 0; /* Increased padding on mobile */
        width: 100%; /* Full width for easier tapping */
        text-align: left;
    }
}

/* Shine overlay effect */
.card-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(181, 154, 87, 0.1) 40%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(181, 154, 87, 0.1) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    opacity: 0;
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: opacity 0.5s ease, transform 0.8s ease;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

.pillar-card:hover .card-shine {
    opacity: 1;
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

/* Gradient border glow on hover */
.pillar-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(115, 0, 10, 0.2),
        rgba(181, 154, 87, 0.3),
        rgba(115, 0, 10, 0.2)
    );
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none;
    z-index: -1;
}

.pillar-card:hover::after {
    opacity: 1;
}

/* Subtle scale on hover for emphasis */
.pillar-card:hover {
    transform: perspective(1000px) scale3d(1.02, 1.02, 1.02);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .pillar-card {
        transform: none !important;
        transition: box-shadow 0.3s ease-out;
    }

    .card-shine {
        display: none;
    }
}

/* ========================================
   MICRO-INTERACTIONS & HAPTIC FEEDBACK
   ======================================== */

/* Spring physics button animation */
.spring-button {
    position: relative;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

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

.spring-button:hover {
    transform: scale(1.05);
    animation: spring-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes spring-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1.05); }
}

/* Magnetic hover effect */
.magnetic-button {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.magnetic-button::before {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: inherit;
    pointer-events: none;
}

/* Ripple effect container */
.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Enhanced CTA button with all effects */
#cta-button,
.cta-enhanced {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 48px; /* Ensure minimum touch target */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#cta-button:hover,
.cta-enhanced:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 30px rgba(181, 154, 87, 0.4);
}

#cta-button:active,
.cta-enhanced:active {
    transform: translateY(0) scale(0.98);
}

/* Mobile button optimizations */
@media (max-width: 768px) {
    #cta-button,
    .cta-enhanced,
    button,
    .spring-button {
        min-height: 48px; /* iOS/Android recommended minimum */
        padding-top: 0.875rem; /* 14px */
        padding-bottom: 0.875rem; /* 14px */
    }

    /* Newsletter button on mobile */
    #newsletter-form button {
        width: 100%; /* Full width on very small screens */
        min-height: 48px;
    }
}

/* Animation Keyframes */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes subtlePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Animation classes */
.animate-fadeInScale {
    animation: fadeInScale 0.8s ease-out forwards;
}

.animate-slideInUp {
    animation: slideInUp 0.7s ease-out forwards;
}

.animate-subtlePulse {
    animation: subtlePulse 2s infinite ease-in-out;
}

/* GSAP scroll animations - initial state */
.hidden-scroll {
    /* Initial state is now handled by GSAP, not CSS */
    /* Keeping class for selector purposes only */
}
.show-scroll {
    /* Legacy class - no longer needed with GSAP */
}

/* Connecting line animation - DEPRECATED (removed journey line) */
/* @keyframes draw-line {
    from { width: 0%; }
    to { width: 100%; }
}
.animate-draw-line {
    animation: draw-line 1s ease-out forwards;
} */

/* Canvas style */
#network-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6;
}

/* Mobile performance optimizations */
@media (max-width: 768px) {
    /* Reduce particle network opacity on mobile for better performance */
    #network-canvas {
        opacity: 0.3;
    }

    /* Simplify animations on mobile */
    .pillar-card {
        will-change: opacity; /* Reduce GPU layers */
    }

    /* Disable 3D transforms on mobile for better performance */
    @supports (-webkit-touch-callout: none) {
        .pillar-card {
            transform: none !important;
        }

        .card-shine {
            display: none; /* Disable shine effect on iOS */
        }
    }

    /* Reduce animation complexity */
    .hero-word {
        animation-duration: 0.6s; /* Faster animations on mobile */
    }

    /* Optimize backdrop blur for mobile */
    #main-header {
        backdrop-filter: blur(10px); /* Reduced from 20px */
        -webkit-backdrop-filter: blur(10px);
    }
}

/* Smooth scrolling and overflow prevention */
html {
    scroll-behavior: smooth;
    /* Removed overflow-x: hidden from html to prevent iOS scrolling issues */
}

body {
    overflow-x: clip; /* Better than hidden - allows vertical scroll but clips horizontal */
    max-width: 100vw; /* Ensure body doesn't exceed viewport width */
    position: relative; /* Establish containing block for clipping */
}

/* Prevent specific elements from causing horizontal scroll */
main,
section,
header,
footer {
    max-width: 100%;
    overflow-x: clip; /* Better than hidden for scroll performance */
    position: relative;
}

/* Specific fix for faculty section */
#faculty-section {
    overflow: visible; /* Allow vertical overflow for dropdowns/modals */
    overflow-x: clip; /* But clip horizontal overflow */
}

/* Ensure all containers respect viewport boundaries */
.max-w-7xl,
.max-w-5xl,
.max-w-4xl,
.max-w-3xl,
.max-w-2xl,
.max-w-lg {
    max-width: 100%;
    width: 100%;
}

@media (min-width: 640px) {
    .max-w-lg { max-width: 32rem; }
}

@media (min-width: 768px) {
    .max-w-2xl { max-width: 42rem; }
    .max-w-3xl { max-width: 48rem; }
    .max-w-4xl { max-width: 56rem; }
}

@media (min-width: 1024px) {
    .max-w-5xl { max-width: 64rem; }
    .max-w-7xl { max-width: 80rem; }
}

/* ========================================
   VERY SMALL SCREEN OPTIMIZATIONS (320px)
   ======================================== */

@media (max-width: 375px) {
    /* Header logo scaling */
    #header-logo {
        font-size: 1rem; /* Smaller logo text on tiny screens */
    }

    /* Hero section adjustments */
    #hero-content {
        padding: 1rem; /* Reduce padding */
    }

    #hero-title {
        font-size: clamp(1.75rem, 8vw, 2.25rem); /* More aggressive scaling */
    }

    #hero-subtitle {
        font-size: clamp(0.875rem, 4vw, 1rem);
    }

    #cta-button {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        font-size: 0.875rem; /* Slightly smaller text */
    }

    /* Pillar cards */
    .pillar-card {
        padding: 1.25rem; /* Reduce padding on tiny screens */
    }

    /* Footer */
    #premium-footer {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .footer-column h4 {
        font-size: 1rem;
    }

    /* Newsletter form */
    #newsletter-form input,
    #newsletter-form button {
        font-size: 0.875rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ========================================
   PROGRESSIVE LOADING & SKELETON SCREENS
   ======================================== */

/* Skeleton base styles */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-surface) 0%,
        rgba(var(--color-accent-rgb), 0.08) 50%,
        var(--color-surface) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Skeleton variants */
.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-text:last-child {
    width: 80%;
    margin-bottom: 0;
}

.skeleton-heading {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
    border-radius: 8px;
}

.skeleton-card {
    height: 300px;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.skeleton-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 1rem;
}

/* Loading container */
.loading-container {
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

.loading-container.loaded {
    opacity: 0;
    pointer-events: none;
}

/* Content fade in after loading */
.content-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.content-section.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Lazy loading images */
img[data-src] {
    filter: blur(10px);
    transition: filter 0.3s ease-out;
}

img.lazy-loaded {
    filter: blur(0);
}

/* Image loading skeleton */
.image-skeleton {
    background: linear-gradient(
        90deg,
        var(--color-surface) 0%,
        rgba(var(--color-accent-rgb), 0.1) 50%,
        var(--color-surface) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Pulse animation for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Spinner for async loading */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-surface);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--color-bg-rgb), 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Progressive reveal classes */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   PREMIUM FOOTER STYLES
   ======================================== */

/* Newsletter section */
#newsletter-form input {
    transition: all 0.3s ease;
}

#newsletter-form input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(181, 154, 87, 0.2);
}

#newsletter-success {
    animation: slideInUp 0.5s ease-out;
}

#newsletter-success.show {
    display: block !important;
    animation: slideInUp 0.5s ease-out, pulse 2s ease-in-out 0.5s;
}

/* Footer columns */
.footer-column {
    position: relative;
}

.footer-heading {
    text-align: left;
    padding: 0;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

/* Footer links - hidden by default on mobile */
.footer-links {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 1;
}

/* Mobile accordion behavior */
@media (max-width: 768px) {
    .footer-links {
        max-height: 0;
        opacity: 0;
    }

    .footer-links.active {
        max-height: 500px;
        opacity: 1;
        margin-top: 0.5rem;
    }

    .footer-heading {
        cursor: pointer;
    }

    .footer-icon {
        transition: transform 0.3s ease;
    }

    .footer-heading.active .footer-icon {
        transform: rotate(180deg);
    }
}

/* Desktop - always show links */
@media (min-width: 769px) {
    .footer-links {
        max-height: none !important;
        opacity: 1 !important;
    }

    .footer-heading {
        pointer-events: none;
    }

    .footer-icon {
        display: none;
    }
}

/* Footer link hover effects */
.footer-links a {
    position: relative;
    display: inline-block;
}

.footer-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

/* Social media icon effects */
#premium-footer a[aria-label] svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), fill 0.3s ease;
}

#premium-footer a[aria-label]:hover svg {
    transform: scale(1.1) rotate(5deg);
}

/* Footer reveal animation enhancement */
#premium-footer {
    position: relative;
}

#premium-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(181, 154, 87, 0.5) 50%,
        transparent 100%
    );
}

/* ========================================
   FACULTY SECTION STYLES
   ======================================== */

/* Faculty Carousel Wrapper */
.faculty-carousel-wrapper {
    position: relative;
    overflow: hidden;
    padding: 2rem 0;
    /* Removed negative margins that cause horizontal overflow */
    margin: 0 auto;
    max-width: 100vw; /* Ensure it doesn't exceed viewport width */
}

/* Gradient Overlays for Carousel Edges */
.carousel-gradient-left,
.carousel-gradient-right {
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.carousel-gradient-left {
    left: 0;
    background: linear-gradient(to right, var(--color-bg) 0%, transparent 100%);
}

.carousel-gradient-right {
    right: 0;
    background: linear-gradient(to left, var(--color-bg) 0%, transparent 100%);
}

/* Carousel Track */
.faculty-carousel-track {
    display: flex;
    gap: 2rem;
    animation: scrollCarousel 40s linear infinite;
    /* Remove will-change when not animating to save memory */
    will-change: auto;
    /* Add GPU acceleration hint */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Animation state control */
.faculty-carousel-track.paused {
    animation-play-state: paused;
}

/* Pause animation on hover */
.faculty-carousel-track:hover {
    animation-play-state: paused;
}

/* Carousel Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

.carousel-nav:hover {
    background: var(--color-accent);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(181, 154, 87, 0.3);
    opacity: 1;
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav.carousel-nav-left {
    left: 2rem;
}

.carousel-nav.carousel-nav-right {
    right: 2rem;
}

.carousel-nav svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.carousel-nav:hover svg {
    transform: scale(1.1);
}

.carousel-nav-left:hover svg {
    transform: translateX(-2px);
}

.carousel-nav-right:hover svg {
    transform: translateX(2px);
}

/* Disabled state for navigation arrows */
.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--color-border);
}

.carousel-nav:disabled:hover {
    transform: translateY(-50%);
    background: var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Infinite scroll animation */
@keyframes scrollCarousel {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Faculty Card */
.faculty-card {
    flex: 0 0 320px;
    background: var(--color-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.faculty-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.faculty-card:hover::before {
    transform: scaleX(1);
}

.faculty-card:hover {
    transform: translateY(-12px) scale(1.05);
    box-shadow: 0 12px 40px rgba(115, 0, 10, 0.15);
    border-color: var(--color-accent);
}

/* Faculty Photo */
.faculty-photo {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    position: relative;
}

.faculty-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--color-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    opacity: 0;
}

.faculty-photo-img.loaded {
    opacity: 1;
}

.faculty-card:hover .faculty-photo-img {
    transform: scale(1.1) rotate(5deg);
    border-color: var(--color-primary);
    box-shadow: 0 8px 20px rgba(115, 0, 10, 0.2);
}

/* Placeholder for missing photos */
.faculty-photo-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    font-family: 'Merriweather', serif;
    border-radius: 50%;
    transition: opacity 0.3s ease;
}

.faculty-photo-img.loaded ~ .faculty-photo-placeholder {
    opacity: 0;
    pointer-events: none;
}

/* Faculty Card Content */
.faculty-card h3 {
    font-family: 'Merriweather', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    text-align: center;
    line-height: 1.3;
}

.faculty-card .faculty-title {
    font-size: 0.875rem;
    color: var(--color-accent);
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faculty-card .faculty-bio {
    font-size: 0.875rem;
    color: var(--color-text);
    line-height: 1.6;
    text-align: center;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.faculty-card .faculty-interests {
    font-size: 0.75rem;
    color: var(--color-accent);
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.faculty-card .faculty-research {
    font-size: 0.8rem;
    color: var(--color-text);
    text-align: center;
    font-style: italic;
    line-height: 1.4;
}

.faculty-card .learn-more {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: var(--color-primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 999px;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.faculty-card:hover .learn-more {
    background: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(181, 154, 87, 0.3);
}

/* ========================================
   FACULTY MODAL STYLES
   ======================================== */

/* Modal Container */
.faculty-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.faculty-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Overlay */
.faculty-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

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

/* Modal Content */
.faculty-modal-content {
    position: relative;
    background: var(--color-bg);
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInModal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Custom scrollbar for modal */
.faculty-modal-content::-webkit-scrollbar {
    width: 8px;
}

.faculty-modal-content::-webkit-scrollbar-track {
    background: var(--color-surface);
    border-radius: 10px;
}

.faculty-modal-content::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 10px;
}

.faculty-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Modal Close Button */
.faculty-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.faculty-modal-close:hover {
    background: var(--color-accent);
    transform: rotate(90deg) scale(1.1);
}

.faculty-modal-close svg {
    width: 20px;
    height: 20px;
}

/* Modal Body */
.faculty-modal-body {
    padding: 3rem 2.5rem;
}

/* Modal Header Section */
.modal-header-section {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--color-border);
}

.modal-faculty-photo {
    width: 256px;
    height: 256px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    position: relative;
}

.modal-faculty-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid var(--color-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.modal-faculty-photo-img.loaded {
    opacity: 1;
}

.modal-faculty-photo-img.loaded ~ .faculty-photo-placeholder {
    opacity: 0;
    pointer-events: none;
}

.modal-faculty-name {
    font-family: 'Merriweather', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.modal-faculty-title {
    font-size: 1.125rem;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-faculty-department {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.modal-contact-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.modal-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background: var(--color-primary);
    color: white;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.modal-contact-btn:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(181, 154, 87, 0.3);
}

.modal-contact-btn svg {
    width: 16px;
    height: 16px;
}

/* Modal Content Sections */
.modal-section {
    margin-bottom: 2rem;
}

.modal-section h4 {
    font-family: 'Merriweather', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-accent);
}

.modal-section p {
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.modal-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-section ul li {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.modal-section ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: bold;
    font-size: 1.1em;
}

.research-interests-tag {
    display: inline-block;
    background: rgba(var(--color-accent-rgb), 0.1);
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Responsive adjustments for Faculty Section */
@media (max-width: 768px) {
    .faculty-carousel-wrapper {
        margin: 0 auto;
        padding: 1.5rem 0;
    }

    /* Adjust arrow positions for mobile */
    .carousel-nav {
        width: 40px;
        height: 40px;
    }

    .carousel-nav.carousel-nav-left {
        left: 0.5rem;
    }

    .carousel-nav.carousel-nav-right {
        right: 0.5rem;
    }

    .carousel-nav svg {
        width: 20px;
        height: 20px;
    }

    .faculty-carousel-track {
        gap: 1rem;
    }

    .faculty-card {
        flex: 0 0 280px;
        padding: 1.5rem;
    }

    .faculty-photo {
        width: 96px;
        height: 96px;
    }
    
    .faculty-photo-img {
        border-width: 3px;
    }

    .carousel-gradient-left,
    .carousel-gradient-right {
        width: 80px;
    }

    /* Modal adjustments for mobile */
    .faculty-modal-body {
        padding: 2rem 1.5rem;
    }

    .modal-faculty-photo {
        width: 192px;
        height: 192px;
    }
    
    .modal-faculty-photo-img {
        border-width: 4px;
    }

    .modal-faculty-name {
        font-size: 1.5rem;
    }

    .modal-faculty-title {
        font-size: 1rem;
    }

    .modal-contact-buttons {
        flex-direction: column;
    }

    .modal-contact-btn {
        width: 100%;
        justify-content: center;
    }

    .faculty-modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .faculty-card {
        flex: 0 0 260px;
        padding: 1.25rem;
    }

    .faculty-card h3 {
        font-size: 1.1rem;
    }

    .faculty-card .faculty-title {
        font-size: 0.8rem;
    }
}

/* ========================================
   LEADERSHIP SECTION
   ======================================== */

.leadership-compact-card {
    position: relative;
    overflow: hidden;
}

.leadership-compact-card > div {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--color-bg);
}

.leadership-compact-card:hover > div {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(115, 0, 10, 0.1);
}

#dean-photo {
    transition: transform 0.4s ease;
}

#dean-name {
    font-family: 'Merriweather', serif;
}

#dean-vision {
    position: relative;
    quotes: """ """ "'" "'";
}

/* Quote styling */
#dean-vision::before,
#dean-vision::after {
    font-size: 1.5em;
    opacity: 0.3;
}

/* Profile link styling */
.dean-profile-link {
    text-decoration: none;
    position: relative;
}

.dean-profile-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.dean-profile-link:hover::after {
    width: 100%;
}

.dean-profile-link svg {
    transition: transform 0.3s ease;
}

.dean-profile-link:hover svg {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .leadership-compact-card > div {
        padding: 2rem;
    }

    #dean-vision {
        font-size: 1.125rem;
    }
}

[data-theme="dark"] .leadership-compact-card > div {
    background: var(--color-surface);
}

[data-theme="dark"] #dean-photo {
    border-color: rgba(var(--color-accent-rgb), 0.4);
}

/* Dark mode adjustments for faculty photos */
[data-theme="dark"] .faculty-photo-img,
[data-theme="dark"] .modal-faculty-photo-img {
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(181, 154, 87, 0.3);
}

[data-theme="dark"] .faculty-card:hover .faculty-photo-img {
    border-color: var(--color-primary);
    box-shadow: 0 8px 20px rgba(181, 154, 87, 0.4);
}
