/* Base styles */
:root {
    --isro-orange: #E94F26;
    --isro-dark: #181818;
    --isro-light: #FFF5F2;
    --animation-speed: 0.3s;
    --animation-timing: ease;
}

/* 
   * Global styles and utilities
   * Some styles are handled by Tailwind, but these provide additional functionality
   */
html {
    scroll-behavior: smooth;
}

.noise-overlay {
    position: relative;
}

.noise-overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: 1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.light-grid-pattern {
    background-size: 40px 40px;
    background-image: linear-gradient(to right,
            rgba(11, 11, 15, 0.05) 1px,
            transparent 1px),
        linear-gradient(to bottom,
            rgba(11, 11, 15, 0.05) 1px,
            transparent 1px);
}

.dot-grid {
    background-image: radial-gradient(circle,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px);
    background-size: 20px 20px;
}

/* Video container for hero section */
.video-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.video-container video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    filter: grayscale(100%) sepia(100%) hue-rotate(140deg);
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 20, 60, 0.65);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.grid-pattern {
    background-size: 40px 40px;
    background-image: linear-gradient(to right,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px),
        linear-gradient(to bottom,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px);
}

/* Text reveal animations */
.text-reveal-container {
    overflow: hidden;
}

.text-reveal {
    opacity: 0;
    animation: text-reveal 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes text-reveal {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.delay-1 {
    animation-delay: 0.1s;
}

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

.delay-3 {
    animation-delay: 0.5s;
}

/* Scroll indicator animation */
.scroll-indicator {
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Infinite scroll for stats banner */
.infinite-scroll-wrapper {
    position: relative;
    width: 400%;
    overflow: hidden;
}

.infinite-scroll {
    display: flex;
    white-space: nowrap;
    animation: marquee 42s linear infinite;
}

@media (max-width: 768px) {
    .infinite-scroll-wrapper {
        width: 1000%;
    }
}

@keyframes marquee {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Vertical timeline styles */
.vertical-timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.vertical-timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: #f5f5fa;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    width: 100%;
}

.timeline-item::after {
    content: '';
    display: table;
    clear: both;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-content {
    position: relative;
    width: 46.5%;
    padding: 1.5rem;
    background-color: #f5f5fa;
    border: 1px solid #f5f5fa;
    border-radius: 0.25rem;
}

.timeline-item:nth-child(odd) .timeline-content {
    float: right;
}

.timeline-item:nth-child(even) .timeline-content {
    float: left;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    content: '';
    position: absolute;
    top: 1.4rem;
    left: -10px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 10px 10px 0;
    border-color: transparent #f5f5fa transparent transparent;
}

.timeline-item:nth-child(even) .timeline-content::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    right: -10px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent #f5f5fa;
}

.timeline-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--isro-orange);
    border-radius: 50%;
    top: 1.5rem;
    z-index: 10;
}

.timeline-item:nth-child(odd) .timeline-marker {
    left: calc(50% - 8px);
}

.timeline-item:nth-child(even) .timeline-marker {
    left: calc(50% - 8px);
}

.timeline-date {
    font-family: "Space Mono", monospace;
    color: #464656;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Gallery styles */
.gallery-item {
    cursor: pointer;
    transition: transform var(--animation-speed) var(--animation-timing);
}

.gallery-item:hover {
    transform: scale(1.02);
}

/* Gallery modal */
#gallery-modal {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--animation-speed) var(--animation-timing);
}

#gallery-modal.active {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vertical-timeline::after {
        left: 31px;
    }

    .timeline-content {
        width: calc(100% - 60px);
        float: right !important;
        margin-left: 60px;
    }

    .timeline-item:nth-child(odd) .timeline-content::before,
    .timeline-item:nth-child(even) .timeline-content::before {
        left: -10px;
        border-width: 10px 10px 10px 0;
        border-color: transparent #f5f5fa transparent transparent;
    }

    .timeline-item:nth-child(odd) .timeline-marker,
    .timeline-item:nth-child(even) .timeline-marker {
        left: 23px;
    }
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.8s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.hover-grow {
    transition: transform var(--animation-speed) var(--animation-timing);
}

.hover-grow:hover {
    transform: scale(1.05);
}

/* Prevent overflow on main container */
#app {
    overflow-x: hidden;
}