/* POCD Public Website Styles - Apple-inspired Design */

:root {
    --color-primary: #007AFF;
    --color-secondary: #5856D6;
    --color-accent: #FF9500;
    --color-success: #34C759;
    --color-warning: #FFCC00;
    --color-danger: #FF3B30;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #111827;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* Animation Keyframes */
@keyframes blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes neuron-pulse {
    0%, 100% {
        opacity: 0.6;
        r: 4;
    }
    50% {
        opacity: 1;
        r: 6;
    }
}

/* Utility Classes */
.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Navigation Styles */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Hero Section */
#hero {
    position: relative;
}

.stat-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Brain Animation */
.neuron {
    animation: neuron-pulse 2s ease-in-out infinite;
}

.neuron:nth-child(2) { animation-delay: 0.2s; }
.neuron:nth-child(3) { animation-delay: 0.4s; }
.neuron:nth-child(4) { animation-delay: 0.6s; }
.neuron:nth-child(5) { animation-delay: 0.8s; }

/* Risk Cards */
.risk-card {
    transition: all 0.3s ease;
}

.risk-card:hover {
    transform: translateY(-8px);
}

/* Test Section */
.test-option {
    transition: all 0.2s ease;
}

.test-option:hover {
    transform: translateX(5px);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Focus Styles */
a:focus,
button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: #111827;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #hero h1 {
        font-size: 2rem;
    }
    
    #hero h1 span:last-child {
        font-size: 1.25rem;
    }
    
    /* Mobile section padding adjustments */
    section {
        scroll-margin-top: 60px;
    }
    
    /* Mobile navigation adjustments */
    #mobile-menu {
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }
    
    /* Mobile card adjustments */
    .grid > div {
        margin-bottom: 1rem;
    }
    
    /* Mobile text adjustments */
    .text-4xl {
        font-size: 1.875rem;
    }
    
    .text-5xl {
        font-size: 2.25rem;
    }
    
    /* Mobile image adjustments */
    img[src^="charts/"] {
        max-width: 100%;
        height: auto;
    }
    
    /* Mobile container padding */
    .max-w-7xl,
    .max-w-5xl,
    .max-w-4xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    #hero h1 {
        font-size: 1.75rem;
    }
    
    #hero h1 span:last-child {
        font-size: 1rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
    }
    
    .text-4xl {
        font-size: 1.5rem;
    }
    
    /* Mobile button adjustments */
    .rounded-full {
        font-size: 0.875rem;
    }
    
    /* Test section mobile adjustments */
    .test-option {
        padding: 0.75rem;
    }
}

/* Chart Images */
img[src^="charts/"] {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Touch device optimizations */
@media (hover: none) {
    .test-option:hover {
        transform: none;
    }
    
    .risk-card:hover,
    #diagnosis .grid > div:hover,
    #treatment .grid > div:hover,
    #mechanism .grid > div:hover {
        transform: none;
    }
}

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
}

/* Mobile-specific button styles */
@media (max-width: 768px) {
    button, 
    .test-option,
    a.rounded-full {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better touch targets for mobile menu */
    #mobile-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Section Anchors Offset for Fixed Header */
section[id] {
    scroll-margin-top: 80px;
}

/* Resource Card Hover Effect */
#resources a {
    transition: all 0.3s ease;
}

#resources a:hover {
    transform: translateY(-4px);
}

/* Expert Cards Enhancement */
#expert .grid > div {
    transition: all 0.3s ease;
}

#expert .grid > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Diagnosis and Treatment Cards */
#diagnosis .grid > div,
#treatment .grid > div {
    transition: all 0.3s ease;
}

#diagnosis .grid > div:hover,
#treatment .grid > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Mechanism Cards */
#mechanism .grid > div {
    transition: all 0.3s ease;
}

#mechanism .grid > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

/* Expert Section - Force visibility */
#expert {
    display: block !important;
    visibility: visible !important;
}

#expert .grid {
    display: grid !important;
}

#expert .grid > div {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Navigation Link Active State */
.nav-link-active {
    color: #3b82f6;
    font-weight: 600;
}

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