/* Mobile Menu Styling for a side-sliding overlay */
.mobile-menu-container {
    position: fixed;
    top: 0;
    right: -100%; /* Initially hide off-screen to the right */
    width: 75%; /* Adjust width as needed for a good fit on mobile */
    height: 100vh;
    background-color: #1a1a1a;
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    padding-top: 80px; /* To account for the fixed header */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: -4px 0 10px rgba(0,0,0,0.5);
}

/* When the menu is active, slide it into view */
.mobile-menu-container.is-active {
    right: 0;
}

/* Styles for the links inside the mobile menu */
.mobile-menu-container a {
    display: block;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.mobile-menu-container a:hover {
    background-color: #2a2a2a;
}

/* Styles for the Hamburger Menu Icon Transition */
#mobile-menu-icon {
    transition: transform 0.3s ease;
}

#mobile-menu.is-active #mobile-menu-icon {
    transform: rotate(90deg);
}

/* These classes are for the icons themselves, handled by Font Awesome, but good practice to have the rule for the transition */
.fa-bars, .fa-xmark {
    transition: all 0.3s ease;
}

/* End of new mobile menu styles */

body {
    font-family: 'Inter', sans-serif;
    background-color: #0d0d0d;
    color: #e0e0e0;
    overflow-x: hidden;
}

/* Custom Tailwind Colors from the old site and new example */
.bg-primary-teal-dark { background-color: #006666; }
.text-primary-teal-dark { color: #006666; }
.border-primary-teal-dark { border-color: #006666; }

.bg-mid-teal { background-color: #0E7C7B; }
.text-mid-teal { color: #0E7C7B; }
.border-mid-teal { border-color: #0E7C7B; }

.bg-light-teal { background-color: #17A2A1; }
.text-light-teal { color: #17A2A1; }
.border-light-teal { border-color: #17A2A1; }

/* * HERO SECTION STYLING (FIXED) 
 * Renamed from .hero to .hero-section to match HTML 
 * Added video background sizing 
 */
.hero-section {
    /* Use a reasonable height, e.g., 80vh, or keep 100vh */
    height: 80vh; 
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    color: white; /* Ensure text is visible over the video */
}

/* Video Background Container - CRITICAL for positioning the video */
.video-background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 10;
}

/* Video itself (iframe) - CRITICAL for covering the container without distortion */
#hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    /* These properties ensure the video covers the entire container */
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    /* Center the video */
    transform: translate(-50%, -50%);
}

/* This ::before acts as the dark overlay for the content */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 20; /* Below content, above video */
}

/* Ensure content is positioned correctly above the overlay */
.hero-content {
    position: relative;
    z-index: 30;
}


/* Button styles from your example */
.cta-button {
    background-color: #37B9C7;
    color: #1a1a1a;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    background-color: #2da1ae;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
}

/* Fade-in on scroll styles (TEMPORARILY DISABLED) */
/* 🚀 CRITICAL FIX: Commenting out the opacity:0 line to make all sections visible
    while we debug the missing content issue. Re-enable later!
[data-scroll-section]:not(#blog-posts-section) { 
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
*/
/* NEW TEMPORARY RULE to ensure visibility for debugging: */
[data-scroll-section]:not(#blog-posts-section) { 
    /* 1. Set Initial State: Invisible */
    opacity: 0; 
    /* 2. Set Initial Position: 50px below final position */
    transform: translateY(50px);
    /* 3. Define the Animation: Make it smooth over 1 second */
    transition: opacity 1s ease-out, transform 0.8s ease-out;
}

/* --- SCROLL ANIMATION FINAL STATE --- */
/* The JavaScript adds 'is-visible' on scroll, which triggers this state. */
[data-scroll-section].is-visible {
    /* 1. Final State: Fully Visible */
    opacity: 1 !important;
    /* 2. Final Position: Back to its normal spot (0 translation) */
    transform: translateY(0) !important; 
    /* The transition rule from the initial state makes the change smooth */
}

/* 🟢 CRITICAL FIX: UPDATED Preloader Styles to ensure it covers the screen and can be hidden */
/* NEW: Styles for the pickleball animation (Preloader Overlay) */
.pickleball-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999; /* CRITICAL FIX: Must be higher than all content (like the header/nav) */
    background-color: #0d0d0d; /* Explicit background color to hide content below */
    display: flex; /* Centers the animation */
    justify-content: center;
    align-items: center;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.5s ease-out; /* Changed to ease-out for a smooth exit */
}

/* CRITICAL FIX: This class is used by the fixed script.js to fade out the preloader */
.pickleball-container.fade-out-and-hide {
    opacity: 0;
}

/* REMOVED: The previous conflicting '.pickleball-container.is-hidden' class */

/* Pickleball styles and animation */
.pickleball {
    position: absolute;
    top: 50%;
    left: 0;
    width: 30px;
    height: 30px;
    animation: bounce-and-rally 4s ease-in-out infinite;
}

/* New keyframes for a bouncing and rotating rally effect */
@keyframes bounce-and-rally {
    0% {
        transform: translateX(0) translateY(-40%) rotateZ(-10deg);
    }
    50% {
        transform: translateX(calc(100vw - 30px)) translateY(-60%) rotateZ(10deg);
    }
    100% {
        transform: translateX(0) translateY(-40%) rotateZ(-10deg);
    }
}

/* Symbiotic Triangle Styles */
.symbiotic-triangle-wrapper {
    position: relative;
    width: 320px;
    height: 277.12px;
    margin: 0 auto;
    overflow: hidden;
    cursor: pointer;
}

.triangle-segment-item {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 1;
    opacity: 1;
    display: block;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

/* Community Segment (Top Triangle) */
.triangle-segment-item.community {
    background-color: #2C5F6C;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* Brands Segment (Bottom-Left Triangle) */
.triangle-segment-item.brands {
    background-color: #4CAF50;
    clip-path: polygon(0% 100%, 50% 100%, 50% 50%);
}

/* Sponsorships Segment (Bottom-Right Triangle) */
.triangle-segment-item.sponsorships {
    background-color: #E67E22;
    clip-path: polygon(100% 100%, 50% 100%, 50% 50%);
}

/* Hover state classes for the animation */
.triangle-segment-item.is-faded-out {
    opacity: 0.2;
}

/* Disconnected animation classes */
.triangle-segment-item.is-disconnected.community {
    transform: translateY(-20px);
}
.triangle-segment-item.is-disconnected.brands {
    transform: translate(-20px, 20px);
}
.triangle-segment-item.is-disconnected.sponsorships {
    transform: translate(20px, 20px);
}

.triangle-text-label {
    position: absolute;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    width: 130px;
    padding: 8px 5px;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.4);
    line-height: 1.2;
    z-index: 3;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

/* Positioning for each text label */
.triangle-text-label.community-label {
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
}
.triangle-text-label.brands-label {
    bottom: 10%;
    left: 25%;
    transform: translateX(-50%);
}
.triangle-text-label.sponsorships-label {
    bottom: 10%;
    right: 25%;
    transform: translateX(50%);
}

/* PBCL Logo Reveal */
#pbcl-logo-reveal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 10;
    pointer-events: none;
    width: 150px;
    height: auto;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #1f1f1f;
    color: #e0e0e0;
    padding: 2rem;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease-in-out;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-close-button {
    position: absolute;
    top: -15px;
    right: -15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #e0e0e0;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    z-index: 1002;
}

/* 🔥 CRITICAL FIX: Updated modal input styles for better contrast (light background/dark text) 
    against the dark modal body for improved UX. */
.modal-content input, .modal-content textarea {
    background-color: #ffffff; /* White background */
    border: 1px solid #ddd;      /* Light border */
    color: #1a1a1a;              /* Dark text for readability */
}

/* Footer specific styles */
footer a {
    transition: color 0.3s ease-in-out;
}

footer a:hover {
    color: #37B9C7;
}

.social-icon {
    font-size: 1.5rem;
}

/* Forum specific styles */
.forum-post {
    background-color: #1f1f1f;
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.forum-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #37B9C7;
}

.forum-post-content {
    color: #e0e0e0;
}

/* Blog Post Admin Form */
#blog-admin-form textarea {
    min-height: 200px;
}

#blog-posts-container {
    min-height: 200px;
}

/* Loading spinner */
.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #37B9C7;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* New styling for Admin and Log In button */
.admin-link, .login-button {
    cursor: pointer;
    transition: color 0.3s;
}

.admin-link:hover, .login-button:hover {
    color: #37B9C7;
}

/* Styling for the log out button */
#logout-button {
    background-color: #EF4444;
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#logout-button:hover {
    background-color: #DC2626;
}

/* Pillar Modal Specific Styles */
.pillar-modal-content {
    max-width: 500px;
    padding: 2rem;
    position: relative;
}

.pillar-modal-content img {
    /* Style for the watermarked logo */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0.1;
    width: 200px;
    pointer-events: none;
}

/* Ensure content is above the watermark */
.pillar-modal-content h3, .pillar-modal-content p {
    position: relative;
    z-index: 10;
}

/* Fix for ambassador images to prevent cropping. This class ensures images fit within their container. */
.ambassador-image-container {
    width: 250px;
    height: 250px;
    overflow: hidden;
    border-radius: 50%;
    margin: 0 auto;
}
.ambassador-image-class {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    display: block;
}


/* UPDATED: Styles for blog post images to fill the container, preventing empty space */
.blog-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    display: block;
    /* 🔥 FIX: Prioritize the top of the image to prevent cutting off heads */
    object-position: top center;
}

/* Center the Read More buttons */
.read-more-button-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.read-more-button {
    background-color: #37B9C7;
    color: #1a1a1a;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.read-more-button:hover {
    background-color: #2da1ae;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
}

.prose {
    color: #e0e0e0;
}

.prose :where(h1,h2,h3,h4,h5,h6) {
    color: #37B9C7;
    font-weight: 700;
}

.prose :where(a) {
    color: #37B9C7;
    text-decoration: underline;
}

.prose :where(p, ul, ol, blockquote) {
    margin-top: 1em;
    margin-bottom: 1em;
}

.faq-item {
    border-bottom: 1px solid #2a2a2a;
}
.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: color 0.3s;
}
.faq-question:hover {
    color: #37B9C7;
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-bottom: 0;
}
.faq-answer.show {
    max-height: 500px; /* Adjust as needed */
    padding-bottom: 1.5rem;
    transition: max-height 0.4s ease-in, padding-bottom 0.4s ease-in;
}
.faq-question .icon {
    transition: transform 0.3s;
}
.faq-question.active .icon {
    transform: rotate(180deg);
}

.prose {
    color: #e0e0e0;
}

.prose :where(h1,h2,h3,h4,h5,h6) {
    color: #37B9C7;
    font-weight: 700;
}

.prose :where(a) {
    color: #37B9C7;
    text-decoration: underline;
}

.prose :where(p, ul, ol, blockquote) {
    margin-top: 1em;
    margin-bottom: 1em;
}

/* Start of admin dashboard styles */
.admin-section, .contributor-section, .dashboard-section {
    display: none; /* Hidden by default, shown by JS based on user role and navigation */
}
.cta-button {
    background-color: #37B9C7;
    color: #1a1a1a;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: bold;
    transition: all 0.3s ease;
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.cta-button:active {
    transform: translateY(0);
}
.form-input, .form-textarea, .form-select {
    background-color: #1a1a1a;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 0.75rem;
    border-radius: 0.5rem;
    width: 100%;
}
/* Custom styles for the sidebar */
.sidebar {
    width: 250px;
    background-color: #1a1a1a;
    color: #b0b0b0;
    transition: transform 0.3s ease-in-out;
    transform: translateX(0);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    position: fixed;
    height: 100%;
    top: 0;
    left: 0;
}
.sidebar-link {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}
.sidebar-link:hover {
    background-color: #2a2a2a;
    color: #e0e0e0;
}
.sidebar-link.active {
    background-color: #37B9C7;
    color: #1a1a1a;
    font-weight: 600;
}
.sidebar-link.active svg {
    color: #1a1a1a;
}
.sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}
.sub-menu-item {
    padding: 0.75rem 1.5rem 0.75rem 3.5rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}
.sub-menu-item:hover {
    background-color: #2a2a2a;
    color: #e0e0e0;
}
.main-content {
    margin-left: 250px;
    padding: 2rem;
    transition: margin-left 0.3s ease-in-out;
}
/* Loading spinner */
.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #37B9C7;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Quill Editor styles */
.ql-container {
    border-radius: 0.5rem;
}
.ql-toolbar {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}
#quill-editor {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #333;
    padding: 0.75rem;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    min-height: 200px;
}
/* SEO Tool Styles */
.seo-check-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}
.seo-check-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
}
.seo-check-list li .icon {
    margin-right: 0.5rem;
    font-size: 1.25rem;
}
.seo-check-list li.pass .icon {
    color: #10B981; /* Tailwind 'green-500' */
}
.seo-check-list li.fail .icon {
    color: #EF4444; /* Tailwind 'red-500' */
}

/* CRITICAL FIX: Blog Section Visibility */
/* This explicit rule ensures the 'Latest Stories' section is always visible,
overriding any conflicting scroll animation rules that may hide it before load. */
#blog-posts-section {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}