/* SportCars Elite - Custom Styles */

/* Font Families */
.font-orbitron {
    font-family: 'Orbitron', monospace;
}

.font-inter {
    font-family: 'Inter', sans-serif;
}

/* Hero Background Animation */
.hero-bg {
    background: linear-gradient(45deg, 
        rgba(220, 38, 127, 0.1) 0%, 
        rgba(239, 68, 68, 0.2) 25%, 
        rgba(0, 0, 0, 0.8) 50%,
        rgba(239, 68, 68, 0.2) 75%, 
        rgba(220, 38, 127, 0.1) 100%);
    background-size: 400% 400%;
    animation: heroGradient 15s ease infinite;
}

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

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

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

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #dc2626;
}

/* Navigation animation */
nav {
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
}

/* Car card hover effects */
.car-card {
    position: relative;
    overflow: hidden;
}

.car-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.1), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.car-card:hover::before {
    left: 100%;
}

/* Car image placeholders with better styling */
.car-image-placeholder {
    position: relative;
    overflow: hidden;
}

.car-image-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
}

/* Spec items styling */
.spec-item {
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    transition: all 0.3s ease;
}

.spec-item:hover {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

/* Gallery hover effects */
.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Form styling enhancements */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Button animations */
button, .btn {
    position: relative;
    overflow: hidden;
}

button::before, .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: width 0.4s ease, height 0.4s ease;
    transform: translate(-50%, -50%);
}

button:hover::before, .btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Loading animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Mobile menu animation */
#mobileMenu {
    transition: all 0.3s ease;
}

#mobileMenu.show {
    animation: slideDown 0.3s ease;
}

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

/* Parallax effect for sections */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Text glow effects */
.text-glow {
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* Performance optimizations */
.car-card, .gallery-item, button {
    will-change: transform;
}

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

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Enhanced focus states for accessibility */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease forwards;
}

/* Performance indicators */
.performance-bar {
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #f97316, #eab308);
    border-radius: 2px;
    overflow: hidden;
}

.performance-fill {
    height: 100%;
    background: #ffffff;
    width: 0%;
    transition: width 2s ease;
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .car-card, .gallery-item {
        border-width: 2px;
    }
    
    button, .btn {
        border-width: 2px;
        border-color: #ef4444;
    }
}

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

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    /* Improve touch targets */
    button, a, input, select, textarea {
        min-height: 44px;
    }
    
    /* Reduce animations on mobile for better performance */
    .car-card:hover {
        transform: none;
    }
    
    /* Optimize font sizes */
    .text-5xl, .text-6xl, .text-7xl {
        font-size: 2.5rem !important;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Desktop enhancements */
@media (min-width: 1025px) {
    /* Enhanced hover effects for desktop */
    .car-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }
    
    .gallery-item:hover {
        transform: scale(1.05);
    }
}

/* Ultra-wide screen support */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
}

/* Form validation styles */
.input-error {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.1) !important;
}

.input-success {
    border-color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.1) !important;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error messages */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-weight: 500;
}

.message-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.message-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Utility classes */
.gradient-text {
    background: linear-gradient(45deg, #ef4444, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.shadow-glow {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

/* Performance counter animations */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Intersection Observer fade-in */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}