/* Custom CSS for Neurodesign Website */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.8s ease-out;
}

/* Navbar scroll effect */
#navbar.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Smooth transitions for nav links */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #2563eb, #8b5cf6);
    transition: width 0.3s ease;
}

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

/* Gradient text animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.bg-gradient-to-r {
    background-size: 200% auto;
}

/* Hover effects for cards */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* FAQ accordion styles */
.faq-item .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    transition: max-height 0.6s ease-in;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-question i {
    transition: transform 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #2563eb, #8b5cf6);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #1d4ed8, #7c3aed);
}

/* Pulse animation for stats */
@keyframes pulse-subtle {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.animate-pulse-subtle {
    animation: pulse-subtle 3s ease-in-out infinite;
}

/* Responsive video containers */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    h1 { font-size: 24pt; }
    h2 { font-size: 20pt; }
    h3 { font-size: 16pt; }
    
    a {
        text-decoration: underline;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 80%;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible styles for accessibility */
:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Skeleton loading animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Improved link hover states */
a:not(.no-underline) {
    text-decoration-skip-ink: auto;
}

/* Better spacing for lists */
ul li,
ol li {
    margin-bottom: 0.5rem;
}

/* Enhanced button states */
button,
.button {
    cursor: pointer;
    user-select: none;
}

button:disabled,
.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:active:not(:disabled),
.button:active:not(:disabled) {
    transform: scale(0.98);
}

/* Tooltip styles */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: #1f2937;
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    margin-bottom: -6px;
}

/* Mobile menu animation */
#mobile-menu {
    transition: max-height 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

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

/* Gradient backgrounds with better performance */
.bg-gradient-animated {
    background: linear-gradient(-45deg, #2563eb, #8b5cf6, #10b981, #06b6d4);
    background-size: 400% 400%;
    animation: gradient-animation 15s ease infinite;
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Improved form elements */
input[type="checkbox"] {
    cursor: pointer;
}

input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

/* Stats counter animation preparation */
.stat-number {
    font-variant-numeric: tabular-nums;
}

/* Image lazy loading placeholder */
img[loading="lazy"] {
    background: #f3f4f6;
}

/* Better text selection */
::selection {
    background-color: #bfdbfe;
    color: #1e40af;
}

::-moz-selection {
    background-color: #bfdbfe;
    color: #1e40af;
}

/* Responsive tables */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Enhanced shadows for depth */
.shadow-soft {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.shadow-medium {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.shadow-strong {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
}

/* Smooth page transitions */
.page-transition {
    animation: page-fade-in 0.5s ease-in-out;
}

@keyframes page-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Improved blockquote styling */
blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1.5rem;
    font-style: italic;
    color: #64748b;
}

/* Code block styling (if needed) */
code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

pre code {
    display: block;
    padding: 1rem;
    overflow-x: auto;
}

/* Improved hr styling */
hr {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 2rem 0;
}

/* Dark mode support (optional for future) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Reduced motion support for accessibility */
@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;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    button,
    a {
        outline: 2px solid currentColor;
        outline-offset: 2px;
    }
}

/* Print-friendly colors */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(37, 99, 235, 0.1);
    border-top-color: #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

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

/* Improved focus indicators for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Better link contrast for accessibility */
a {
    color: #2563eb;
}

a:hover {
    color: #1d4ed8;
}

/* Ensure sufficient color contrast */
.text-gray-600 {
    color: #475569; /* Improved contrast */
}

/* Better spacing for mobile */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Improved touch targets for mobile */
@media (max-width: 768px) {
    button,
    a,
    input,
    select {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Sticky positioning utility */
.sticky-top {
    position: sticky;
    top: 80px;
    z-index: 40;
}

/* Backdrop blur fallback */
@supports not (backdrop-filter: blur(10px)) {
    .backdrop-blur-sm {
        background-color: rgba(255, 255, 255, 0.95);
    }
}

/* Improved card hover effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Grid gap improvements for consistency */
.grid {
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid {
        gap: 2rem;
    }
}

/* Better visual hierarchy */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
}

p {
    line-height: 1.7;
}

/* Improved list styling */
ul.styled-list {
    list-style: none;
    padding-left: 0;
}

ul.styled-list li {
    padding-left: 1.5rem;
    position: relative;
}

ul.styled-list li::before {
    content: '•';
    color: #2563eb;
    font-weight: bold;
    position: absolute;
    left: 0;
}