/* IGL Coatings - Optimized Design System */

/* ===== CORE VARIABLES ===== */
:root {
    --primary-500: #00b140;
    --glass-bg-light: rgba(255, 255, 255, 0.1);
    --glass-bg-dark: rgba(0, 0, 0, 0.3);
    --glass-border: rgba(255, 255, 255, 0.25);
    --shadow-light: 0 8px 32px rgba(31, 38, 135, 0.15);
    --shadow-dark: 0 12px 40px rgba(0, 0, 0, 0.2);
    --blur-base: blur(20px);
    --transition-base: all 0.3s ease;
    --header-height: 80px;
}

/* ===== GLOBAL LAYOUT ===== */
main {
    padding-top: calc(var(--header-height) + 2rem);
}

/* ===== LIGHT MODE - NEUMORPHIC ===== */
body {
    background: #e8f5ea;
    transition: var(--transition-base);
}

.glass-button {
    background: linear-gradient(145deg, #f0f7f1, #dff2e1);
    border-radius: 12px;
    box-shadow: 8px 8px 16px #c4d9c6, -8px -8px 16px #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.15s ease;
    cursor: pointer;
}

.glass-button:hover {
    box-shadow: 12px 12px 24px #c4d9c6, -12px -12px 24px #ffffff;
    transform: translateY(-2px) scale(1.02);
}

.glass {
    background: #e8f5ea;
    border-radius: 20px;
    box-shadow: 10px 10px 20px #c4d9c6, -10px -10px 20px #ffffff;
    transition: var(--transition-base);
}

.glass-card {
    background: #e8f5ea;
    border-radius: 24px;
    box-shadow: 15px 15px 30px #c4d9c6, -15px -15px 30px #ffffff;
    transition: var(--transition-base);
}

.glass-premium {
    background: #e8f5ea;
    border-radius: 32px;
    box-shadow: 20px 20px 40px #c4d9c6, -20px -20px 40px #ffffff;
    transition: var(--transition-base);
}

/* ===== DARK MODE - GLASSMORPHIC ===== */
.dark body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

.dark .glass-button {
    background: var(--glass-bg-light);
    backdrop-filter: var(--blur-base);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
}

.dark .glass {
    background: var(--glass-bg-light);
    backdrop-filter: var(--blur-base) saturate(180%);
    border: 1.5px solid var(--glass-border);
    box-shadow: var(--shadow-light);
}

.dark .glass-card {
    background: var(--glass-bg-dark);
    backdrop-filter: blur(25px) saturate(200%);
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow-dark);
}

.dark .glass-premium {
    background: var(--glass-bg-light);
    backdrop-filter: blur(30px) saturate(200%) brightness(120%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 35px rgba(31, 38, 135, 0.1);
}

/* ===== HOVER STATES ===== */
.glass:hover { transform: translateY(-2px); }
.glass-card:hover { transform: translateY(-4px); }
.glass-premium:hover { transform: translateY(-3px); }

/* ===== DARK MODE GLOW EFFECTS ===== */
.dark .glass:hover {
    box-shadow: 
        var(--shadow-light),
        0 0 20px rgba(0, 177, 64, 0.3);
}

.dark .glass-card:hover {
    box-shadow: 
        var(--shadow-dark),
        0 0 30px rgba(0, 177, 64, 0.4);
}

.dark .glass-premium:hover {
    box-shadow: 
        0 15px 35px rgba(31, 38, 135, 0.1),
        0 0 40px rgba(0, 177, 64, 0.5);
}

/* ===== BENTO GRID - OPTIMIZED ===== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 80px;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Grid Span Classes - 12x12 System */
.span-1x1 { grid-column: span 1; grid-row: span 1; }
.span-1x2 { grid-column: span 1; grid-row: span 2; }
.span-2x1 { grid-column: span 2; grid-row: span 1; }
.span-2x2 { grid-column: span 2; grid-row: span 2; }
.span-2x3 { grid-column: span 2; grid-row: span 3; }
.span-3x1 { grid-column: span 3; grid-row: span 1; }
.span-3x2 { grid-column: span 3; grid-row: span 2; }
.span-3x3 { grid-column: span 3; grid-row: span 3; }
.span-4x1 { grid-column: span 4; grid-row: span 1; }
.span-4x2 { grid-column: span 4; grid-row: span 2; }
.span-4x3 { grid-column: span 4; grid-row: span 3; }
.span-4x4 { grid-column: span 4; grid-row: span 4; }
.span-5x2 { grid-column: span 5; grid-row: span 2; }
.span-5x3 { grid-column: span 5; grid-row: span 3; }
.span-6x1 { grid-column: span 6; grid-row: span 1; }
.span-6x2 { grid-column: span 6; grid-row: span 2; }
.span-6x3 { grid-column: span 6; grid-row: span 3; }
.span-7x2 { grid-column: span 7; grid-row: span 2; }
.span-8x1 { grid-column: span 8; grid-row: span 1; }
.span-8x2 { grid-column: span 8; grid-row: span 2; }
.span-12x1 { grid-column: span 12; grid-row: span 1; }
.span-12x2 { grid-column: span 12; grid-row: span 2; }

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 60px;
    }
    .span-4x2, .span-4x4 { grid-column: span 4; }
}

/* ===== ANIMATIONS ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-15px); }
    70% { transform: translateY(-7px); }
    90% { transform: translateY(-3px); }
}

@keyframes slideUp {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 177, 64, 0.3); }
    50% { box-shadow: 0 0 40px rgba(0, 177, 64, 0.6); }
}

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-pulse { animation: pulse 3s ease-in-out infinite; }
.animate-bounce { animation: bounce 2s infinite; }
.animate-slide-up { animation: slideUp 0.8s ease-out; }
.animate-glow { animation: glow 2s ease-in-out infinite; }

/* ===== MOBILE TOUCH ANIMATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Auto-animate cards on mobile */
    .glass-card {
        animation: pulse 4s ease-in-out infinite;
        animation-delay: calc(var(--animation-delay, 0) * 0.5s);
    }
    
    .glass-premium {
        animation: float 5s ease-in-out infinite;
        animation-delay: calc(var(--animation-delay, 0) * 0.3s);
    }
    
    /* Stagger animations */
    .glass-card:nth-child(1) { --animation-delay: 0; }
    .glass-card:nth-child(2) { --animation-delay: 1; }
    .glass-card:nth-child(3) { --animation-delay: 2; }
    .glass-card:nth-child(4) { --animation-delay: 3; }
    .glass-card:nth-child(5) { --animation-delay: 4; }
    .glass-card:nth-child(6) { --animation-delay: 5; }
    
    /* Touch-specific glow effects */
    .dark .glass-card {
        animation: pulse 4s ease-in-out infinite, glow 3s ease-in-out infinite;
        animation-delay: calc(var(--animation-delay, 0) * 0.5s), calc(var(--animation-delay, 0) * 0.7s);
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.glass:focus, .glass-card:focus, .glass-premium:focus {
    outline: 2px solid rgba(0, 177, 64, 0.6);
    outline-offset: 2px;
}

/* Better contrast for text elements */
.text-contrast-fix {
    color: #374151 !important; /* Darker gray for better contrast */
}

.dark .text-contrast-fix {
    color: #e5e7eb !important; /* Lighter gray for dark mode */
}

/* Focus states for interactive elements */
button:focus, a:focus {
    outline: 2px solid #00b140;
    outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #00b140;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* ===== HIGH VISIBILITY ALERTS ===== */
.alert-critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(248, 113, 113, 0.3);
    box-shadow: 
        0 8px 32px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(248, 113, 113, 0.2);
    color: white;
    font-weight: 600;
    border-radius: 16px;
}

.alert-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(21, 128, 61, 0.95) 100%);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(74, 222, 128, 0.3);
    box-shadow: 
        0 8px 32px rgba(34, 197, 94, 0.3),
        inset 0 1px 0 rgba(74, 222, 128, 0.2);
    color: white;
    font-weight: 600;
    border-radius: 16px;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95) 0%, rgba(217, 119, 6, 0.95) 100%);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    box-shadow: 
        0 8px 32px rgba(245, 158, 11, 0.3),
        inset 0 1px 0 rgba(251, 191, 36, 0.2);
    color: white;
    font-weight: 600;
    border-radius: 16px;
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(96, 165, 250, 0.3);
    box-shadow: 
        0 8px 32px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(96, 165, 250, 0.2);
    color: white;
    font-weight: 600;
    border-radius: 16px;
}

/* Alert animations */
.alert-pulse {
    animation: alertPulse 2s ease-in-out infinite;
}

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

.alert-shake {
    animation: alertShake 0.5s ease-in-out;
}

@keyframes alertShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.alert-slide-in {
    animation: alertSlideIn 0.5s ease-out;
}

@keyframes alertSlideIn {
    0% { 
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    100% { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.alert-bounce {
    animation: alertBounce 0.6s ease-out;
}

@keyframes alertBounce {
    0% { 
        transform: translateY(-30px) scale(0.9);
        opacity: 0;
    }
    50% { 
        transform: translateY(5px) scale(1.05);
        opacity: 0.8;
    }
    100% { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.alert-glow {
    animation: alertGlow 1.5s ease-in-out infinite alternate;
}

@keyframes alertGlow {
    0% { 
        box-shadow: 
            0 8px 32px rgba(34, 197, 94, 0.3),
            inset 0 1px 0 rgba(74, 222, 128, 0.2);
    }
    100% { 
        box-shadow: 
            0 12px 40px rgba(34, 197, 94, 0.5),
            inset 0 1px 0 rgba(74, 222, 128, 0.4);
    }
}