/* Custom Clay Shoot Theme */
:root {
    --clay-orange: #e65100;
    --forest-green: #2e7d32;
    --dark-green: #1b5e20;
}

body {
    background-color: #f8f9fa;
    font-family: 'Roboto', sans-serif;
    padding-bottom: 25px; /* Space for the status bar */
}

.font-serif {
    font-family: 'Bitter', serif;
}

.bg-dark-green {
    background-color: var(--dark-green) !important;
}

.text-dark-green {
    color: var(--dark-green) !important;
}

.text-clay {
    color: var(--clay-orange) !important;
}

.btn-clay {
    background-color: var(--clay-orange);
    color: white;
    border: none;
}

.btn-clay:hover {
    background-color: #bf360c;
    color: white;
}

/* Hero Image */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3)), url('images/header.jpg');
    background-size: cover;
    background-position: center;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 5px solid var(--clay-orange);
    position: relative;
    overflow: hidden; /* Important for the ribbon */
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* Improved readability */
}

.border-top-clay {
    border-top: 4px solid var(--clay-orange) !important;
}

/* Privacy Blurring */
.blur-text {
    user-select: none; /* Prevent selection to reveal text */
    -webkit-user-select: none;
    display: inline-block; /* Required for transform/filter sometimes */
}

.blur-text-level-0 {
    filter: blur(0);
    user-select: text;
    -webkit-user-select: text;
}

.blur-text-level-1 {
    filter: blur(4px);
}

.blur-text-level-2 {
    filter: blur(7px);
}

.blur-text-level-3 {
    filter: blur(11px);
}

/* --- HOMEPAGE CARDS --- */

/* Carousel Layout */
.carousel-wrapper {
    position: relative;
    width: 100%;
    margin: 0 -15px;
    padding: 0 15px;
}

.squad-carousel-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 2rem;
    padding: 1.5rem 0.5rem 3.5rem 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--clay-orange) rgba(0,0,0,0.05);
    scroll-behavior: smooth;
}

.squad-carousel-container::-webkit-scrollbar {
    display: block;
    height: 6px;
}

.squad-carousel-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
}

.squad-carousel-container::-webkit-scrollbar-thumb {
    background: var(--clay-orange);
    border-radius: 10px;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #eee;
    color: var(--dark-green);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0;
}

.carousel-wrapper:hover .carousel-arrow {
    opacity: 1;
}

.carousel-arrow:hover {
    background: var(--dark-green);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.carousel-arrow.left {
    left: -10px;
}

.carousel-arrow.right {
    right: -10px;
}

.carousel-arrow.disabled {
    display: none !important;
}

@media (max-width: 768px) {
    .carousel-arrow {
        display: none;
    }
    .squad-carousel-container {
        -webkit-mask-image: none;
        mask-image: none;
        gap: 1.2rem;
    }
}

.squad-carousel-item {
    flex: 0 0 auto;
    width: 280px;
    height: 280px;
    scroll-snap-align: center;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@media (max-width: 767.98px) {
    .squad-carousel-item {
        width: calc(62vw - 8px);
        height: calc(62vw - 8px);
    }

    /* padding-top 33% = 1/3 of tile height (% padding is relative to width,
       and the tile is square so width = height) */
    .ground-card .card-overlay {
        padding: 33% 0.75rem 1rem;
        justify-content: flex-start;
        align-items: center;
    }

    .ground-card h3 {
        font-size: 1.05rem;
        margin-bottom: 0.4rem;
        word-break: break-word;
        white-space: normal;
    }

    .ground-card .btn {
        font-size: 0.78rem;
        padding: 0.25rem 1rem;
        margin-top: 0.2rem;
    }

    .fav-btn {
        width: 30px;
        height: 30px;
        top: 8px;
        right: 8px;
        font-size: 0.75rem;
    }
}

/* Ground and Register Cards */
.ground-card, .register-card {
    height: 100%;
    width: 100%;
    position: relative;
    border-radius: 20px;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ground-card:hover, .register-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.25) !important;
}

/* Ground Card Background & Overlay */
.ground-card .card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.ground-card:hover .card-bg {
    transform: scale(1.1); /* Zoom effect on hover */
}

.ground-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Dark overlay for text readability */
    transition: background 0.3s ease;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Start from the top */
    align-items: center;
    padding: 4rem 1.5rem 2.5rem 1.5rem; /* Increased top padding to avoid conflict with fav icon */
}

.ground-card:hover .card-overlay {
    background: rgba(0, 0, 0, 0.6); /* Darken slightly on hover */
}

.ground-card h3 {
    position: relative;
    z-index: 2;
    margin-top: 0;
    margin-bottom: auto; /* Push the button to the bottom */
    font-size: 1.4rem;
    text-align: center;
}

.ground-card .btn {
    position: relative;
    z-index: 2;
    margin-top: 1rem;
    margin-bottom: 0.5rem; /* Anchor to bottom */
}

/* Favourite Button */
.fav-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100; /* Ensure it's above the overlay */
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    backdrop-filter: blur(4px);
    padding: 0;
}

.fav-btn:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.15);
    border-color: white;
}

.fav-btn.active {
    background: #ff5252;
    border-color: #ff5252;
    color: white;
}

/* Register Card Styling */
.register-card {
    background: linear-gradient(135deg, var(--clay-orange), #ff9800);
}

.register-card .icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.register-card:hover .icon-wrapper {
    transform: rotate(90deg);
}

/* Beta Ribbon */
.beta-ribbon {
    width: 200px; /* Standard width for corner ribbon */
    background: var(--clay-orange);
    position: absolute;
    top: 25px; /* Classic top position */
    right: -50px; /* Classic right position */
    text-align: center;
    line-height: 50px;
    letter-spacing: 1px;
    color: #f0f0f0;
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    z-index: 100;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    font-family: 'Roboto', sans-serif;
    pointer-events: none;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Navbar — keep toggler on same row as brand on mobile.
   Bootstrap uses flex-wrap:wrap on .navbar>.container, so if the brand
   div is wider than (container - toggler), the toggler drops to a new
   line. Cap the brand container at calc(100% - 56px) — the toggler is
   ~44px, leaving 12px margin — so it can never push the toggler down. */
@media (max-width: 991.98px) {
    .navbar .d-flex.align-items-center {
        max-width: calc(100% - 56px);
        overflow: hidden;
    }
    .navbar-brand {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }
}

/* --- MOBILE SPECIFIC TWEAKS --- */
@media (max-width: 768px) {
    .hero-section {
        min-height: 180px;
    }
    
    .hero-section h1 {
        font-size: 2rem; /* Smaller title */
    }

    /* Ensure navbar items display horizontally when collapsed on small screens */
    .navbar-collapse.show .navbar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 0;
    }

    .navbar-collapse.show .nav-item {
        margin: 0 10px;
    }

    /* Adjust Calendar height for mobile */
    #calendar {
        height: auto !important;
        min-height: 500px;
    }
    
    /* Ensure tables scroll horizontally instead of breaking layout */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Environment Watermarks */
.env-ribbon {
    position: fixed;
    bottom: 40px;
    right: -40px;
    width: 200px;
    text-align: center;
    padding: 10px;
    transform: rotate(-45deg);
    z-index: 9999;
    font-weight: bold;
    font-family: monospace;
    font-size: 1.2rem;
    pointer-events: none;
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.env-ribbon.staging {
    background-color: #ffc107; /* Bootstrap Warning */
    color: #000;
    border: 2px dashed #000;
}

.env-ribbon.development {
    background-color: #17a2b8; /* Bootstrap Info */
    color: #fff;
    border: 2px dashed #fff;
}

/* Fixed Status Bar */
.system-status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #212529;
    color: #ced4da;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.7rem;
    padding: 3px 12px;
    z-index: 10000;
    border-top: 1px solid #343a40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    height: 7px;
    width: 7px;
    background-color: #28a745;
    border-radius: 50%;
    display: inline-block;
}

/* Weather Temperature Alignment */
.weather-temp-adjust {
    display: inline-block;
    transform: translateY(-2px); /* Nudge up by 2px (total) */
}

/* Pulse Highlight Animation */
@keyframes lightPulse {
    0% { background-color: rgba(255, 243, 205, 0.4); }
    50% { background-color: rgba(255, 226, 112, 0.95); } /* Stronger, vibrant yellow */
    100% { background-color: rgba(255, 243, 205, 0.4); }
}

.highlight-pulse {
    animation: lightPulse 2s ease-in-out infinite;
    background-color: rgba(255, 243, 205, 0.4) !important;
    /* Add inner golden borders that won't disrupt the flex/grid layout */
    box-shadow: inset 4px 0 0 #ffc107, inset -4px 0 0 #ffc107 !important;
}

/* ── GroundAdmin Panel Tabs ─────────────────────────────────────── */
.ga-admin-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    background: #1b5e20;
    border-radius: 8px;
    padding: 5px 6px;
    margin-bottom: 1.75rem;
    gap: 3px;
    box-shadow: 0 2px 10px rgba(27,94,32,0.25);
}
.ga-admin-tabs::-webkit-scrollbar { display: none; }

.ga-admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 5px;
    color: rgba(255,255,255,0.65);
    text-decoration: none !important;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
    border: 1px solid transparent;
}
.ga-admin-tab i { font-size: 0.9rem; }

.ga-admin-tab:hover {
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.1);
}

.ga-admin-tab.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-weight: 600;
    border-color: rgba(230,81,0,0.6);
    box-shadow: 0 0 0 1px rgba(230,81,0,0.3);
}
.ga-admin-tab.active i { color: #ffb74d; }

/* ── What3Words navigate card (booking pages + config) ─────────── */
.w3w-nav-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff5f5;
    border: 1px solid rgba(225,10,10,0.18);
    border-radius: 7px;
    padding: 7px 11px;
    text-decoration: none !important;
    width: 100%;
    transition: background 0.15s, border-color 0.15s;
    cursor: pointer;
}
.w3w-nav-card:hover { background: #ffe8e8; border-color: rgba(225,10,10,0.38); }
.w3w-nav-badge {
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: -.06em;
    color: #e10a0a;
    flex-shrink: 0;
}
.w3w-nav-addr {
    font-weight: 600;
    font-size: 0.8rem;
    color: #2d2d2d;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.w3w-nav-cta {
    font-size: 0.72rem;
    font-weight: 600;
    color: #e10a0a;
    flex-shrink: 0;
    white-space: nowrap;
    opacity: 0.85;
}
.w3w-nav-card:hover .w3w-nav-cta { opacity: 1; }

/* ── GroundAdmin edit banner (bottom of ground info pane) ──────── */
.ground-admin-edit-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: #dc3545;
    color: white !important;
    text-decoration: none !important;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 6px;
    margin-top: 12px;
    transition: background 0.15s;
}
.ground-admin-edit-banner:hover { background: #b02a37; }
