/* Enhanced Design System */
:root {
    /* Brand Colors */
    --primary-purple: #6366f1;
    --primary-purple-light: #8b5cf6;
    --primary-purple-dark: #4f46e5;
    --ku-green: #16a34a;
    --ku-green-light: #22c55e;
    
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    
    /* Borders */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Base Styling */
* {
    font-family: 'Sarabun', 'Kanit', 'Inter', sans-serif;
}

.font-english {
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    letter-spacing: -0.01em;
}

/* Enhanced 3D Background */
.ai-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: 
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 60% 20%, rgba(217, 70, 239, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 25%, #f1f5f9 50%, #e2e8f0 75%, #cbd5e1 100%);
    animation: backgroundShift 20s ease-in-out infinite alternate;
}

@keyframes backgroundShift {
    0% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(10deg) brightness(1.02); }
    100% { filter: hue-rotate(20deg) brightness(0.98); }
}

/* Neural Network Grid - White Theme */
.neural-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
    background-image: 
        linear-gradient(rgba(102, 126, 234, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.15) 1px, transparent 1px);
    background-size: 100px 100px;
    animation: gridFloat 15s ease-in-out infinite;
}

@keyframes gridFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, -20px) scale(1.02); }
}

@keyframes gridFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, -20px) scale(1.02); }
}

/* Floating AI Orbs */
.ai-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(2px);
    animation: float-orb 12s ease-in-out infinite;
    z-index: -1;
}

.ai-orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.2) 0%, transparent 70%);
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.ai-orb-2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.15) 0%, transparent 70%);
    bottom: 20%;
    right: -5%;
    animation-delay: -4s;
}

.ai-orb-3 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    top: 60%;
    left: 70%;
    animation-delay: -8s;
}

@keyframes float-orb {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.3; }
    25% { transform: translateY(-30px) rotate(90deg); opacity: 0.6; }
    50% { transform: translateY(-60px) rotate(180deg); opacity: 0.4; }
    75% { transform: translateY(-30px) rotate(270deg); opacity: 0.7; }
}

/* Enhanced Glass Morphism */
.glass {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-strong {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* AI Neural Header */
.ai-neural-header {
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.95) 0%, 
        rgba(30, 41, 59, 0.9) 50%, 
        rgba(51, 65, 85, 0.85) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.ai-neural-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(102, 126, 234, 0.1), 
        transparent);
    animation: neural-sweep 3s ease-in-out infinite;
}

@keyframes neural-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* AI Logo Enhancement */
.ai-logo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-logo {
    width: 60px;
    height: 60px;
    background: var(--ku-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--neural-glow);
    animation: ai-pulse 3s ease-in-out infinite;
}

.ai-logo::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: logo-shine 2s ease-in-out infinite;
}

@keyframes ai-pulse {
    0%, 100% { transform: scale(1); box-shadow: var(--neural-glow); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(102, 126, 234, 0.5), 0 0 60px rgba(102, 126, 234, 0.3); }
}

@keyframes logo-shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
    100% { transform: translateX(200%) rotate(45deg); }
}

/* Holographic Brand Text */
.holographic {
    background: var(--neural-gradient);
    background-size: 400% 400%;
    animation: holographic 4s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

@keyframes holographic {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* AI Status Indicator */
.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: ai-heartbeat 2s ease-in-out infinite;
}

@keyframes ai-heartbeat {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Enhanced Menu Items */
.nav-item {
    position: relative;
    padding: 12px 24px;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.nav-item-mobile {
    position: relative;
    padding: 6px 6px;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid transparent;
}

.nav-item-mobile:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

/* Neural Network Footer */
.neural-footer {
    background: 
        linear-gradient(135deg, 
            rgba(15, 23, 42, 0.95) 0%, 
            rgba(30, 41, 59, 0.9) 100%),
        radial-gradient(circle at 50% 0%, rgba(102, 126, 234, 0.1) 0%, transparent 50%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.neural-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(102, 126, 234, 0.5), 
        rgba(217, 70, 239, 0.5), 
        rgba(16, 185, 129, 0.5), 
        transparent);
    animation: footer-glow 3s ease-in-out infinite;
}

@keyframes footer-glow {
    0%, 100% { opacity: 0.5; transform: translateX(-10px); }
    50% { opacity: 1; transform: translateX(10px); }
}

/* 3D Footer Elements */
.footer-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(3px);
    animation: footer-float 8s ease-in-out infinite;
}

.footer-orb-1 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.2) 0%, transparent 70%);
    top: -30%;
    left: 20%;
    animation-delay: 0s;
}

.footer-orb-2 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.15) 0%, transparent 70%);
    top: -50%;
    right: 30%;
    animation-delay: -3s;
}

@keyframes footer-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Logout Button Enhancement */
.ai-logout-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
    transition: all 0.3s ease;
}

.ai-logout-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

/* Data Stream Animation */
.data-stream {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, #10b981, transparent);
    animation: data-flow 2s linear infinite;
}

@keyframes data-flow {
    0% { top: -20px; opacity: 0; }
    50% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-orb { transform: scale(0.7); }
    .glass { backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); }
    .ai-logo { width: 48px; height: 48px; }
}

/* Particle System */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(102, 126, 234, 0.6);
    border-radius: 50%;
    animation: particleFloat 8s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}