/* Custom Styles for Ferrari Heritage Gallery */

:root {
    --primary-red: #dc2626;
    --dark-bg: #000000;
    --dark-secondary: #0f0f0f;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-400: #9ca3af;
    --white: #ffffff;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-bg);
    color: var(--white);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
}

/* Hero Section */
.hero-section {
    position: relative;
    margin-top: 60px;
}

.hero-section img {
    animation: zoomIn 1.2s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(1.05);
        opacity: 0.8;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.hero-section h1 {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-section p {
    animation: fadeInUp 1s ease-out 0.5s both;
}

.hero-section a {
    animation: fadeInUp 1s ease-out 0.7s both;
}

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

/* Gallery Grid */
.gallery-grid {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gallery-item {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
}

/* Model Cards */
.model-card {
    opacity: 0;
    animation: slideInUp 0.6s ease-out forwards;
    transition: all 0.3s ease;
}

.model-card:nth-child(1) { animation-delay: 0.1s; }
.model-card:nth-child(2) { animation-delay: 0.2s; }
.model-card:nth-child(3) { animation-delay: 0.3s; }
.model-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.model-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-red) !important;
}

/* Timeline */
.timeline-item {
    opacity: 0;
    animation: slideInLeft 0.6s ease-out forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }

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

/* Mobile Timeline */
@media (max-width: 768px) {
    .timeline-item::before {
        content: '';
        position: absolute;
        left: 4px;
        top: 16px;
        bottom: -48px;
        width: 2px;
        background-color: var(--gray-800);
    }

    .timeline-item:last-child::before {
        display: none;
    }
}

/* Smooth Transitions */
a {
    transition: color 0.3s ease;
}

button {
    transition: all 0.3s ease;
}

/* Scroll Effects */
@media (prefers-reduced-motion: no-preference) {
    body {
        scroll-behavior: smooth;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.25rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    nav ul {
        display: none !important;
    }

    .gallery-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    .hero-section h1 {
        font-size: 1.875rem;
    }

    .hero-section p {
        font-size: 0.875rem;
    }

    .gallery-grid {
        gap: 4px;
    }

    .models-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Remove horizontal scroll */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

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

nav a {
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-red);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Button Styles */
button, a[class*="bg-red"] {
    position: relative;
    overflow: hidden;
}

button:hover, a[class*="bg-red"]:hover {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
}

/* Image Loading */
img {
    display: block;
    max-width: 100%;
    height: auto;
}

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