:root {
    --bg: #ffffff;
    --primary: #0b5cff;
    --muted: #6b7280;
    --surface: #ffffff;
    --card-shadow: 0 6px 20px rgba(12, 12, 12, 0.08);
    --radius: 12px;
    --container: 1200px;
    --gap: 1rem;
    --accent: #0066cc;
    --success: #10b981;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: #111;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block
}

/* Layout helpers */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap)
}

.col {
    flex: 1 1 0;
    min-width: 0
}

/* Header */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #0f1724;
    color: #fff
}

.site-header .logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 1rem
}

.site-header a {
    color: inherit;
    text-decoration: none;
    padding: .35rem .6rem;
    border-radius: 8px;
    transition: background .18s
}

.site-header a:hover {
    background: rgba(255, 255, 255, 0.04)
}

/* Search */
.header-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255, 255, 255, 0.04);
    padding: .35rem;
    border-radius: 8px
}

.header-search input {
    border: 0;
    background: transparent;
    color: inherit;
    outline: none;
    min-width: 180px
}

/* Main content */
.site-main {
    padding: 1.5rem 0
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 1rem
}

/* Product grid and product card */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem
}

.product-card {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .8rem;
    border-radius: 10px;
    background: #fff;
    overflow: hidden
}

.product-card .thumb {
    height: 160px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center
}

.product-card h3 {
    margin: .25rem 0;
    font-size: 1rem
}

.product-card p {
    margin: 0;
    font-size: .9rem;
    color: var(--muted)
}

/* Cart styling - ensure single column display for cart items */
.cart {
    max-width: 900px
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: .75rem
}

.cart-item {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .6rem;
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--card-shadow)
}

.cart-item .qty {
    min-width: 48px;
    text-align: center
}

/* Force cart product cards to show 1x1 block (fixes issue where cart used same 3x3 grid) */
.cart .product-card {
    flex-direction: row;
    align-items: center;
    padding: .5rem
}

.cart .product-card .thumb {
    width: 88px;
    height: 88px;
    flex: 0 0 88px
}

.cart .product-card .info {
    flex: 1
}

/* Timeline */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 1rem
}

@media(min-width:900px) {
    .timeline-container {
        flex-direction: row;
        overflow-x: auto
    }
}

/* Forms and auth */
.auth-forms {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: 420px
}

.auth-forms input,
.auth-forms select,
.auth-forms textarea {
    padding: .6rem;
    border: 1px solid #e6e9ef;
    border-radius: 8px
}

.auth-forms button {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: .6rem;
    border-radius: 8px;
    cursor: pointer
}

/* Footer */
.site-footer {
    padding: 1rem;
    background: #0f1724;
    color: #cbd5e1;
    text-align: center
}

/* Utility */
.text-muted {
    color: var(--muted)
}

.flex {
    display: flex
}

.center {
    align-items: center;
    justify-content: center
}

/* Responsive tweaks */
@media(max-width:700px) {
    .site-header {
        padding: .6rem
    }

    .container {
        padding: 0 .75rem
    }

    .site-header nav {
        display: none
    }

    .header-search input {
        min-width: 120px
    }

    .product-card .thumb {
        height: 120px
    }
}

/* Accessibility and focus */
a:focus,
button:focus,
input:focus {
    outline: 3px solid rgba(11, 92, 255, 0.12);
    outline-offset: 2px
}

header .logo img {
    max-width: 120px;
    /* adjust to your preferred size if needed */
    height: auto;
    display: block;
}

/* --- Timeline Layout --- */
#timelineList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin: 20px;
    padding: 0;
    overflow: visible;
    height: auto;
}

#timeline,
.site-main {
    height: auto;
    /* ✅ don’t fix height */
    min-height: 100vh;
    /* optional: fill at least full screen */
    overflow-y: visible;
    /* ✅ allows scrolling */
}

/* --- Ensure timeline grid shows all rows --- */
#timeline {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
}

#timelineList {
    height: auto !important;
    overflow: visible !important;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin: 20px;
    padding: 0;
}

/* Ensure parent containers allow expansion */
.site-main,
.container {
    height: auto !important;
    overflow: visible !important;
}

/* For desktop: 5 columns */
@media (min-width: 1024px) {
    #timelineList {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* For mobile: 2 columns */
@media (max-width: 768px) {
    #timelineList {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Event Card --- */
.event-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* --- Image --- */
.event-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

/* --- Card Body --- */
.card-body {
    padding: 12px 14px;
    flex-grow: 1;
}

.card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #222;
}

.card-body p {
    font-size: 0.9rem;
    color: #555;
}

/* --- Favorite Button --- */
.favorite-btn {
    border: none;
    background: transparent;
    color: #bbb;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
    align-self: flex-end;
    padding: 6px 10px;
}

.favorite-btn.active {
    color: #e63946;
}

.favorite-btn:hover {
    color: #e63946;
}

/* --- Favorites Section --- */
#favoritesList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px;
}

#favoritesList .event-card.small {
    width: 150px;
}

.event-image-small {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

/* ---------------------- */
/* MODAL (Event Detail)   */
/* ---------------------- */
.modal {
    display: none;
    /* hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
    transition: all 0.3s ease-in-out;
}

.modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 1.5rem;
    border-radius: 16px;
    max-width: 700px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: fadeInUp 0.3s ease;
}

.close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 1.8rem;
    color: #444;
    cursor: pointer;
    font-weight: bold;
}

.close:hover {
    color: #000;
}

/* Image and map layout */
#modalImage {
    width: 100%;
    border-radius: 12px;
    margin: 1rem 0;
    object-fit: cover;
    max-height: 320px;
}

#modalDescription {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

#modalMap {
    width: 100%;
    height: 300px;
    border-radius: 10px;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

.search-input:focus {
    outline: 2px solid #3a86ff;
    background-color: #f7f9ff;
}

/* --- Timeline Card Animation --- */
.event-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.event-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.favorites-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.favorites-actions button {
    background: #0078d4;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s ease;
}

.favorites-actions button:hover {
    background: #005fa3;
}

/* Toast Styles */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    padding: 10px 18px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
    min-width: 180px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Theme Colors */
.toast-info {
    background-color: #3498db;
}

.toast-success {
    background-color: #2ecc71;
}

.toast-error {
    background-color: #e74c3c;
}

.toast-warning {
    background-color: #f1c40f;
    color: #222;
}

.map-link {
    display: inline-block;
    margin-top: 8px;
    color: #0077ff;
    text-decoration: none;
    font-weight: 600;
}

.map-link:hover {
    text-decoration: underline;
}

.modal-footer {
    text-align: right;
    padding: 0.75rem;
    border-top: 1px solid #ccc;
}

.btn-small {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: #0078ff;
    color: white;
    cursor: pointer;
}

.btn-small:hover {
    background: #005fcc;
}

/* ------------------------------
   🧭 NEXT-GEN TIMELINE FILTER BAR
------------------------------ */
.filter-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    padding: 1rem 2rem;
    margin: 2rem auto;
    border-radius: 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-width: 900px;
    animation: fadeUp 0.8s ease both;
}

/* Animated glowing timeline divider line */
.filter-bar::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 2px;
    background: linear-gradient(90deg, #00b4ff, #ff6bcb, #ffc107);
    background-size: 300% 100%;
    animation: moveGradient 6s infinite linear;
    opacity: 0.25;
    border-radius: 2px;
    transform: translateY(-50%);
    z-index: -1;
}

/* Filter dropdown styling for text */
.filter-bar select {
    position: relative;
    appearance: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #ff0000;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.8rem;
    padding: 0.7rem 2rem 0.7rem 1rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-width: 150px;
}

/* Gradient hover & focus glow */
.filter-bar select:hover,
.filter-bar select:focus {
    border-color: #00b4ff;
    box-shadow: 0 0 12px rgba(0, 180, 255, 0.4);
    background: rgba(0, 180, 255, 0.15);
    outline: none;
}

/* Dropdown arrow icon */
.filter-bar select {
    background-image: linear-gradient(45deg, transparent 50%, #00b4ff 50%),
        linear-gradient(135deg, #00b4ff 50%, transparent 50%);
    background-position: calc(100% - 15px) calc(1em + 2px),
        calc(100% - 10px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

/* Labels for each filter */
.filter-label {
    font-weight: 600;
    color: #000000;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-right: -0.5rem;
}

/* Responsive stacking on small screens */
@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 1.5rem;
    }

    .filter-bar select {
        width: 100%;
    }
}

/* Subtle appear animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gradient motion line */
@keyframes moveGradient {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

/* ------------------------------
   🧹 CLEAR FILTER BUTTON
------------------------------ */
.clear-filters-btn {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 0.8rem;
    color: #fff;
    background: linear-gradient(135deg, #ff6bcb, #ffa63d);
    box-shadow: 0 0 12px rgba(255, 107, 203, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.clear-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 18px rgba(255, 107, 203, 0.6);
}

.clear-filters-btn:active {
    transform: scale(0.96);
    opacity: 0.8;
}

/* Adjust on small screens */
@media (max-width: 768px) {
    .clear-filters-btn {
        width: 100%;
    }
}

/* Filters unique style */
.filters-row {
    display: flex;
    gap: 10px;
    align-items: center;
    background: linear-gradient(90deg, rgba(11, 92, 255, 0.04), rgba(0, 210, 255, 0.02));
    padding: 10px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(4, 9, 30, 0.04);
    margin: 16px 20px;
}

.filters-row select {
    border: 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(9, 10, 14, 0.03);
    min-width: 120px;
}

.btn-small {
    background: linear-gradient(180deg, #0b5cff, #0652d4);
    color: #fff;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
}

.btn-small:hover {
    transform: translateY(-2px);
}

/* modal footer */
.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

/* small favorites header */
.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.fav-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Header styling */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    background: #0d1b2a;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-links {
    display: flex;
    gap: 1.2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* Hamburger button */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: white;
    cursor: pointer;
}

/* Responsive hamburger and menu behavior */
.hamburger {
    width: 30px;
    height: 24px;
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
}

.hamburger::before,
.hamburger::after,
.hamburger span {
    content: "";
    position: absolute;
    width: 100%;
    height: 3px;
    background: #333;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger::before {
    top: 0;
}

.hamburger span {
    top: 10px;
}

.hamburger::after {
    bottom: 0;
}

/* When active, animate into X */
.hamburger.active::before {
    transform: rotate(45deg);
    top: 10px;
}

.hamburger.active span {
    opacity: 0;
}

.hamburger.active::after {
    transform: rotate(-45deg);
    bottom: 10px;
}

/* Mobile menu styles */
.nav-links {
    display: flex;
    gap: 1rem;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background: white;
        position: absolute;
        top: 70px;
        right: 20px;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-links.open {
        display: flex;
    }
}

/* --- HAMBURGER MENU --- */
.hamburger {
    width: 30px;
    height: 24px;
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
    display: none;
    /* Hidden on desktop */
}

.hamburger::before,
.hamburger::after,
.hamburger span {
    content: "";
    position: absolute;
    width: 100%;
    height: 3px;
    background: #fff;
    /* Use white bars to contrast dark header */
    left: 0;
    transition: all 0.3s ease;
}

.hamburger::before {
    top: 0;
}

.hamburger span {
    top: 10px;
}

.hamburger::after {
    bottom: 0;
}

.hamburger.active::before {
    transform: rotate(45deg);
    top: 10px;
}

.hamburger.active span {
    opacity: 0;
}

.hamburger.active::after {
    transform: rotate(-45deg);
    bottom: 10px;
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        right: 20px;
        background: #222;
        border-radius: 10px;
        padding: 1rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    }

    .nav-links.open {
        display: flex;
    }
}

/* ==============================================================
   📘 ABOUT PAGE STYLES
============================================================== */
.about-hero {
    text-align: center;
    margin: 3rem 0 2rem;
}

.about-hero h1 {
    font-size: 2rem;
    color: #0b5cff;
    margin-bottom: 1rem;
}

.about-hero p {
    max-width: 700px;
    margin: 0 auto;
    color: #444;
    line-height: 1.6;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.about-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.about-card h2 {
    color: #0b5cff;
    margin-bottom: 0.8rem;
}

.about-card p,
.about-card ul {
    color: #333;
    line-height: 1.6;
}

.about-card ul {
    padding-left: 1.2rem;
}

.tech-list li {
    list-style-type: "⚙️ ";
}

.about-contact {
    text-align: center;
    margin: 3rem 0;
}

.btn-contact {
    display: inline-block;
    background: linear-gradient(135deg, #00b4ff, #0078ff);
    color: white;
    padding: 0.8rem 1.6rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
}

.btn-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 180, 255, 0.4);
}

.modal.closing {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

html,
body {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.event-card {
    flex-grow: 1;
    height: auto;
    max-height: none;
}

/* Modal fade effect */
#eventModal {
    transition: opacity 0.2s ease;
    opacity: 1;
}

#eventModal.closing {
    opacity: 0;
}