/* Mental Age Test - Custom CSS Styles */
/* Works alongside Tailwind CSS for enhanced styling */

:root {
    --primary-green: #2D5A4A;
    --secondary-orange: #D4A574;
    --light-green: #10B981;
    --dark-gray: #2D3748;
    --light-gray: #F7FAFC;
    --border-gray: #E2E8F0;
    --success-green: #22C55E;
    --warning-orange: #F59E0B;
    --error-red: #EF4444;
}

/* Utility helpers for primary brand color */
.bg-primary {
    background-color: var(--primary-green) !important;
}
.text-primary {
    color: var(--primary-green) !important;
}

/* Font family override for Inter */
.font-inter {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Smooth animations for all elements */
* {
    transition: all 0.2s ease;
}

/* Remove default transitions for some elements to improve performance */
.no-transition,
.no-transition * {
    transition: none !important;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e3a32;
}

/* Hero section enhancements */
#hero {
    background: linear-gradient(135deg, #f0fdf4 0%, #fef3e2 100%);
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(45, 90, 74, 0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

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

/* Button enhancements */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-green) 0%, #1e3a32 100%);
    box-shadow: 0 4px 15px rgba(45, 90, 74, 0.3);
    transform: translateY(0);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 90, 74, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(45, 90, 74, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-orange) 0%, #c19660 100%);
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
}

/* Test container styling */
#test-container {
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
}

/* Question option styling */
.option-item label {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item label:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.option-item input[type="radio"] {
    position: relative;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    background: white;
    transition: all 0.2s ease;
}

.option-item input[type="radio"]:checked {
    border-color: var(--primary-green);
    background: var(--primary-green);
}

.option-item input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Progress bar styling */
.progress-bar {
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--light-green) 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Results section styling */
#results-container {
    background: linear-gradient(135deg, #f0fdf4 0%, #fef3e2 100%);
}

#mental-age-display {
    color: var(--primary-green);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: countUp 1s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Trait tags styling */
.traits-container .trait-tag {
    background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
    color: var(--primary-green);
    border: 1px solid #86efac;
    padding: 8px 16px;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-block;
    margin: 4px;
    transition: all 0.3s ease;
}

.traits-container .trait-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* Card styling */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Feature section icons */
.feature-icon {
    background: linear-gradient(135deg, var(--primary-green) 0%, #1e3a32 100%);
    box-shadow: 0 4px 15px rgba(45, 90, 74, 0.3);
}

/* Navigation styling */
header {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Mobile menu animation */
#mobile-menu {
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease;
}

#mobile-menu.block {
    transform: translateY(0);
    opacity: 1;
}

/* FAQ styling */
.faq-item {
    border-bottom: 1px solid var(--border-gray);
}

.faq-question {
    cursor: pointer;
    position: relative;
    padding-right: 2rem;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-green);
    transition: transform 0.3s ease;
}

.faq-question.active::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-answer {
    display: none;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification styling */
.notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 1rem 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideInDown 0.3s ease;
    max-width: calc(100vw - 2rem);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive text sizing */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    #mental-age-display {
        font-size: 4rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    #mental-age-display {
        font-size: 3rem;
    }
    
    .option-item label {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* Focus states for accessibility */
button:focus,
input:focus,
a:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    #hero,
    #test-container,
    header,
    footer {
        display: none !important;
    }
    
    #results-container {
        background: white !important;
        box-shadow: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .option-item label {
        border-width: 3px;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }
}

/* Dark mode preparation (for future implementation) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a202c;
        --text-color: #f7fafc;
    }
    
    /* Dark mode styles would go here */
}

/* Performance optimizations */
.will-change {
    will-change: transform, opacity;
}

.transform-gpu {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}