/* =============================================
   1. GLOBAL & RESET STYLES
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(to bottom, #87CEEB, #E0F7FA);
    color: #333;
    line-height: 1.6;
    text-align: center;
}
.container {
    max-width: 1000px;
    margin: auto;
    padding: 0 10px;
}

/* =============================================
   2. BANNER & GLOBAL CARD STYLES
   ============================================= */
/* PERFECT BANNER — FULL BLEED, NO CUTOFF, NO BLOW-UP */
.banner {
    width: 100vw;
    height: 200px;
    margin-left: calc(-50vw + 50%);
    position: relative;
    overflow: hidden;
    background: #004d80; /* fallback */
    display: flex;
    align-items: center;
    justify-content: center;
}
.banner-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.tagline {
    background: rgba(0,77,128,0.8);
    color: white;
    padding: 10px;
    font-style: italic;
}
.section {
    background: white;
    margin: 20px 0;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

/* =============================================
   3. YOUTUBE CTA STYLES
   ============================================= */
.youtube-cta-box {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 8px;
}
.youtube-cta-title {
    margin: 5px 0;
    font-size: 18px;
    font-weight: bold;
    color: #004d80;
}
.youtube-subscribe-btn {
    background: #ff0000;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    display: inline-block;
    margin: 10px;
}
.youtube-cta-desc {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

/* =============================================
   4. WEATHER & RADAR WIDGET STYLES
   ============================================= */

/* Weather Popups/Overlay */
#dayDetail {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
    z-index: 999;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    font-family: Arial;
}
#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.6);
    z-index: 998;
}

/* --- RADAR WIDGET STYLES --- */
#radar-widget-wrapper {
    width: 400px; /* Base width */
    height: 400px; /* Base height */
    max-width: 100%;
    margin: 0 auto;
    display: flex; /* Make it a flex container */
    flex-direction: column; /* Stack the map and controls vertically */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden; /* Keep content within bounds */
    background-color: #f0f0f0;
    position: relative; /* For absolute positioning of map overlays */
}
#radar-container {
    flex-grow: 1; 
    position: relative;
    overflow: hidden;
    height: 100%;
    padding-top: 35px; /* Space for legend */
    padding-bottom: 35px; /* Space for controls */
}
#radar-legend {
    position: absolute; /* Overlay map */
    top: 0px;
    left: 50%;
    transform: translateX(-50%); /* Center the block */
    z-index: 900;
    width: 100%; /* Take full width of the 400px wrapper */
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.6);
    padding: 5px 0;
    border-radius: 4px 4px 0 0; 
    pointer-events: none;
    font-family: Arial, sans-serif;
}
.legend-bar-wrapper {
    flex-grow: 1;
    text-align: center;
    padding: 0 5px;
}
.legend-label {
    font-size: 10px;
    font-weight: bold;
    color: white;
    margin-bottom: 2px;
    text-transform: uppercase;
    line-height: 1.2;
}
.gradient-bar {
    height: 10px;
    width: 100%; 
    border-radius: 2px;
}
.rain-gradient {
    background: linear-gradient(to right, rgb(0, 110, 255), rgb(0, 255, 255), rgb(102, 255, 0), rgb(255, 255, 0), rgb(255, 128, 0), rgb(255, 0, 0));
}
.ice-gradient {
    background: linear-gradient(to right, rgb(180, 255, 255), rgb(200, 150, 255), rgb(255, 100, 255), rgb(200, 0, 200));
}
.snow-gradient {
    background: linear-gradient(to right, rgb(255, 255, 255), rgb(150, 200, 255), rgb(0, 100, 255), rgb(0, 0, 150));
}
#radar-controls {
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    background: rgba(0,0,0,0.7);
    padding: 5px 10px;
    border-radius: 4px;
    display: flex;
    gap: 8px;
    width: 100%; 
    max-width: 400px;
}
#radar-controls button, #radar-controls select {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background-color 0.2s;
}
#radar-controls button:hover {
    background: #0056b3;
}
#radar-controls select {
    background: #444;
}
#radar-map {
    width: 100%;
    height: 100%;
}

/* =============================================
   5. SOLUNAR CARD STYLES
   ============================================= */
.solunar-card {
    margin: 30px auto;
    max-width: 1000px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-family: Arial;
}
.solunar-header {
    text-align: center;
    margin: 0 0 20px;
    color: #000;
    font-size: 28px;
}
.solunar-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.solunar-data-col {
    flex: 2 1 0%;
    background: #f8fdff;
    padding: 25px;
    border-radius: 12px;
    color: #000;
}
.data-columns-flex {
    display: flex;
    gap: 30px;
    line-height: 1.35;
    font-size: 16px;
    flex-wrap: wrap;
}
.data-block {
    flex: 1 1 45%;
}
.data-header {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}
.detail-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 10px;
}
.grid-value {
    text-align: right;
    font-weight: normal;
}
.solunar-separator {
    margin: 20px 0 15px 0;
    border: 0;
    border-top: 1px solid #ccc;
}
.period-text { /* Used with the HTML class .period-grid */
    font-size: 16px;
    gap: 8px 10px;
}
.period-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    line-height: 1.35;
}
.moon-column {
    flex: 1 1 0%;
    background: #000000;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.rating-box {
    margin-top: -10px;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
#rating {
    font-size: 30px;
    color: #ffffff;
    line-height: 1.2;
}
#moon-bg {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 10px auto;
    padding: 0;
}
#moon-img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    border-radius: 50%;
}
#phase {
    font-weight: bold;
    font-size: 20px;
    color: #ffffff;
    margin: 20px 0 4px;
}
#illum {
    color: #dddddd;
    font-size: 16px;
}
.solunar-credit {
    margin-top: 20px;
    font-size: 10px;
    color: #666666;
    line-height: 1.2;
}
.solunar-update-text {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin-top: 22px;
}

/* =============================================
   6. WATER LEVEL STYLES
   ============================================= */
.water-level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 14px;
}
.normal-pool-block {
    display: flex;
    align-items: center;
    gap: 8px;
}
.normal-pool-indicator {
    width: 24px;
    height: 3px;
    background: #28a745;
    border-radius: 1px;
    border: 1px dashed #28a745;
    opacity: 0.9;
}
.normal-pool-text {
    color: #28a745;
    font-weight: bold;
}
#current-level-wrapper { /* Replaces #current-level styles */
    font-weight: bold;
    color: #004d80;
    text-align: right;
}
.gauge-links {
    display: block;
    margin-top: 8px;
    text-align: right;
}

/* =============================================
   7. LATEST VIDEO STYLES
   ============================================= */
.video-card {
    margin: 30px auto;
    max-width: 1000px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.video-header {
    text-align: center;
    color: #000;
    font-size: 28px;
    margin: 0 0 20px;
}
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}
.video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* =============================================
   8. TOURNAMENT CALENDAR STYLES
   ============================================= */
.calendar-wrapper {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.calendar-iframe {
    border: 0;
    width: 100%;
    height: 400px;
}
.tournament-btn-wrapper {
    margin-top: 15px;
    text-align: center;
}
.tournament-schedule-btn {
    background: #004d80;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    display: inline-block;
}
.tournament-note {
    display: block;
    margin-top: 10px;
    color: #666;
}

/* =============================================
   9. SOCIAL, CONTACT & FAQ STYLES
   ============================================= */
.social-block {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}
.videos-col {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.fb-col {
    flex: 1;
    min-width: 300px;
    /* CHANGE: Set the content alignment to the right for the column */
    text-align: right; 
}

/* NEW: This targets the Facebook widget container to push it to the right within the column */
.fb-col > div.fb-page {
    margin-left: auto; 
    margin-right: 0; 
}
.videos-col .cam {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.videos-col .cam iframe {
    width: 100%;
    height: 200px;
    border: none;
}
.cam-label {
    background: #004d80;
    color: white;
    padding: 8px;
    font-weight: bold;
}
.map {
    height: 300px;
    width: 100%;
    border: none;
    border-radius: 8px;
}
.contact-faq-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}
.contact-col {
    flex: 1;
    min-width: 280px;
}
.faq {
    margin-top: 20px;
    text-align: left;
}
.faq details {
    margin-bottom: 8px;
    cursor: pointer;
}
.faq summary {
    font-weight: 600;
    color: #004d80;
    list-style: none;
    position: relative;
    padding-right: 20px;
}
.faq summary::after {
    content: "▼"; /* Down arrow */
    position: absolute;
    right: 0;
    top: 0;
    font-size: 1.2em;
    transition: transform .2s;
}
.faq details[open] summary::after {
    content: "▲"; /* Up arrow */
    transform: rotate(180deg);
}
.faq p {
    margin: 8px 0 0 0;
    color: #555;
}
.faq-header {
    margin-bottom: 10px;
    color: #004d80;
}

/* Social Icons */
.social-icons-wrapper {
    margin: 30px 0;
    text-align: center;
}
.social-follow-text {
    margin-bottom: 12px;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}
.icon-container {
    font-size: 32px;
    display: flex;
    gap: 50px;
    justify-content: center;
    flex-wrap: wrap;
}
.icon-facebook {
    color: #1877F2;
}
.icon-instagram {
    color: #E4405F;
}
.icon-youtube {
    color: #FF0000;
}

/* Footer */
footer p a {
    color: #ff0000;
    font-weight: bold;
}
.footer-copyright {
    margin-top: 10px;
    font-size: 12px;
}

/* =============================================
   10. MEDIA QUERIES
   ============================================= */
@media (max-width: 768px) {
    .banner {
        height: 160px;
    }
    .social-block {
        flex-direction: column;
        gap: 15px;
    }
    .fb-col {
        min-width: 100%;
        order: 2;
    }
    .videos-col {
        order: 1;
    }
    .videos-col .cam iframe {
        height: 180px;
    }
    .map {
        height: 250px;
    }
    .period-text {
        font-size: 14px !important;
        gap: 8px 4px !important;
    }
}
@media (max-width: 480px) {
    .banner {
        height: 140px;
    }
    .videos-col .cam iframe {
        height: 160px;
    }
}
