/* ---
Root Variables
--- */
:root {
    --color-bg-dark: #121212;
    --color-bg-medium: #1a1a1a;
    --color-bg-light: #242424;
    --color-text-primary: #ffffff;
    --color-text-secondary: #adb5bd;
    --color-primary: #007bff;
    --color-primary-hover: #0056b3;
    --border-radius-main: 12px;
    --font-main: 'Inter', sans-serif;
}

/* ---
Global Styles
--- */
html {
    scroll-behavior: smooth; /* Ensures smooth scrolling for anchor links */
}

body {
    background-color: var(--color-bg-dark);
    color: var(--color-text-primary);
    font-family: var(--font-main);
    margin-top: 80px; /* Offset for fixed navbar */
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

.section-title {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
    color: var(--color-primary);
}

.text-light-emphasis {
    color: var(--color-text-secondary);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ---
Navbar
--- */
#navbar {
    background-color: rgba(26, 26, 26, 0.8); /* Semi-transparent base */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
    padding-top: 10px;
    padding-bottom: 10px;
}

#navbar.scrolled {
    background-color: rgba(18, 18, 18, 0.95); /* More-solid on scroll */
}

.navbar-brand {
    color: var(--color-text-primary) !important;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.nav-link {
    color: var(--color-text-secondary) !important;
    font-weight: 500;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.nav-link.active,
.nav-link:hover {
    color: var(--color-text-primary) !important;
}

.navbar-toggler {
    border: none;
    color: rgba(255, 255, 255, 0.7);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.7)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Roblox Login Button */
.btn-login {
    background-color: var(--color-primary);
    color: white !important;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius-main);
    padding: 10px 20px;
    transition: background-color 0.3s ease;
}

.btn-login:hover {
    background-color: var(--color-primary-hover);
}

.roblox-logo {
    height: 20px;
}

.avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* User Dropdown */
.dropdown-menu {
    background-color: var(--color-bg-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-main);
    padding: 0.5rem 0;
}
.dropdown-item {
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}
.dropdown-item:hover, .dropdown-item:focus {
    color: var(--color-text-primary);
    background-color: var(--color-primary);
}
.dropdown-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---
Hero Section
--- */
.hero {
    position: relative;
    height: 85vh; /* 85% of the viewport height */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-slideshow {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(18, 18, 18, 1) 0%, rgba(18, 18, 18, 0.3) 100%);
    z-index: 3;
}

.hero-content {
    position: relative;
    z-index: 4;
    color: white;
}

/* --- Hero Text Animation --- */
@keyframes heroFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animated-h1 {
    animation: heroFadeInUp 1s ease-out 0.5s;
    animation-fill-mode: backwards; /* Stays invisible until animation starts */
}

.hero-animated-p {
    animation: heroFadeInUp 1s ease-out 0.8s;
    animation-fill-mode: backwards;
}
/* --- End of Hero Animation --- */


/* ---
Call-to-Action (CTA) Section
--- */
.cta-section {
    background-color: var(--color-bg-medium);
    border-radius: var(--border-radius-main);
}

.btn-cta {
    background-color: var(--color-primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 12px 30px;
    border-radius: var(--border-radius-main);
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-cta:hover {
    background-color: var(--color-primary-hover);
    color: white;
    transform: scale(1.05);
}
/* --- End of CTA --- */


/* ---
Event Viewer
--- */
.event-viewer {
    display: flex;
    background-color: var(--color-bg-medium);
    border-radius: var(--border-radius-main);
    overflow: hidden;
    min-height: 400px;
}

.event-tabs {
    flex: 0 0 200px; /* Don't grow, don't shrink, base width 200px */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0,0,0,0.1);
    padding: 10px;
}

.event-tab-button {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    text-align: left;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.event-tab-button:hover {
    background-color: var(--color-bg-light);
    color: var(--color-text-primary);
}

.event-tab-button.active {
    background-color: var(--color-primary);
    color: var(--color-text-primary);
    font-weight: 700;
}

.event-content {
    flex-grow: 1;
    padding: 30px;
}

.event-pane {
    display: none;
    animation: fadeIn 0.5s ease;
}

.event-pane.active {
    display: block;
}

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

.event-card {
    background: none;
}
.event-card ul {
    list-style-type: none;
    padding-left: 10px;
}
.event-card li {
    padding: 2px 0;
}

.timetable-img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---
Team Section
--- */
.team-section {
    background-color: var(--color-bg-medium);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* --- Team Card 3D Flip --- */
.team-card-link {
    text-decoration: none; 
    color: var(--color-text-primary);
}
.team-card-link:hover {
    color: var(--color-text-primary);
}


.team-card {
    background-color: transparent;
    width: 100%;
    min-height: 320px; /* Set a fixed height for consistent flipping */
    perspective: 1000px;
    border: none;
    height: 100%;
}

.team-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.team-card:hover .team-card-inner {
    transform: rotateY(180deg);
}

/* Front and Back faces of the card */
.team-card-front,
.team-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    
    /* These styles were on the old .team-card */
    background-color: var(--color-bg-light);
    padding: 2rem;
    border-radius: var(--border-radius-main);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);

    /* New styles to center content vertically */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Back face starts "flipped" */
.team-card-back {
    transform: rotateY(180deg);
}

.team-bio {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}
/* --- End of Team Card 3D Flip --- */


.team-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--color-primary);
    margin-bottom: 1rem;
    object-fit: cover;
}

.team-role {
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ---
Fleet Section
--- */

/* --- NEW: Fleet Filter Navigation --- */
.fleet-filter-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2.5rem;
}

.filter-btn {
    background-color: var(--color-bg-light);
    color: var(--color-text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: var(--border-radius-main);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-btn:hover {
    background-color: var(--color-bg-medium);
    color: var(--color-text-primary);
}

.filter-btn.active {
    background-color: var(--color-primary);
    color: var(--color-text-primary);
    border-color: var(--color-primary);
}
/* --- END: Fleet Filter Navigation --- */


.loco-card {
    background-color: var(--color-bg-medium);
    border-radius: var(--border-radius-main);
    overflow: hidden;
    margin-bottom: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* UPDATED: Added new transitions for filtering */
    transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.5s ease-out, margin 0.5s ease-out, padding 0.5s ease-out, box-shadow 0.3s ease;
}

.loco-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* --- NEW: Fleet Filter Animation --- */
.loco-card.is-hidden {
    opacity: 0;
    transform: scale(0.95);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    border: none;
}
/* --- END: Fleet Filter Animation --- */


.loco-image {
    min-height: 300px;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

.loco-card:hover .loco-image {
    transform: scale(1.05);
}

.loco-info {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.loco-name {
    color: var(--color-primary);
    font-size: 2.2rem;
}

.loco-type {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
}

/* ---
Footer
--- */
.footer {
    background-color: var(--color-bg-medium);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.footer-credit {
    font-size: 0.85rem;
}

.footer-link {
    color: var(--color-text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--color-text-primary);
    text-decoration: underline;
}

/* ---
Responsive Design
--- */
@media (max-width: 991.98px) {
    .navbar-nav {
        background-color: var(--color-bg-light);
        border-radius: var(--border-radius-main);
        padding: 10px;
        margin-top: 10px;
    }
}

@media (max-width: 767.98px) {
    .hero {
        height: 70vh;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .event-viewer {
        flex-direction: column;
    }
    .event-tabs {
        flex: 0 0 auto;
        display: flex;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .event-tab-button {
        flex-shrink: 0; /* Prevent buttons from shrinking */
        width: auto;
        text-align: center;
    }
}
/* ---
Page Section Transitions
--- */
.page-section-wrapper {
    position: relative;
    min-height: 100vh; 
}

.page-section {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: opacity 0.4s ease-in-out, visibility 0s linear 0.4s;
}

.page-section.active {
    opacity: 1;
    visibility: visible;
    position: relative; 
    transition: opacity 0.4s ease-in-out;
}

/* ---
Animate on Scroll
--- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---
Back to Top Button
--- */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
    z-index: 1000;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--color-primary-hover);
    color: white;
}

/* ---
Image Modal (Lightbox)
--- */
#imageModal .modal-dialog {
    max-width: 90vw; 
}

#imageModal .modal-content-dark {
    background-color: transparent;
    border: none;
    /* --- Fix for centering --- */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#imageModal #modalImage {
    width: 100%;
    height: auto;
    max-height: 80vh; 
    object-fit: contain;
    border-radius: var(--border-radius-main);
}

/* ---
"Coming Soon" Modal
--- */
.modal-content-dark-themed {
    background-color: var(--color-bg-light);
    color: var(--color-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-main);
}

.modal-content-dark-themed .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content-dark-themed .modal-body {
    color: var(--color-text-secondary);
}

