@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800;900&display=swap');

/* ==========================================================================
   1. DESIGN TOKENS & ROOT VARIABLES
   ========================================================================== */
:root {
    --nav-bg: #0B1118; /* Navy Header & Footer */
    --brand-dark-bg: #0D141C; /* Base Dark Slate */
    --brand-dark-surface: #1B2735; /* Dark Surface for Info Containers */
    --brand-dark-border: #2D3F53; /* Border for Dark Cards */

    --brand-light-bg: #FFFFFF; /* Pure White Background */
    --brand-light-alt: #F8FAFC; /* Off-White Background */
    --brand-light-surface: #FFFFFF; /* White Surface for Cards */
    --brand-light-border: #E2E8F0; /* Light Card Border */

    --brand-accent: #0096D6; /* Electric Cyan Accent */
    --brand-accent-hover: #007BB3; /* Deeper Cyan Hover */
}

/* ==========================================================================
   2. BASE & GLOBAL UTILITIES
   ========================================================================== */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--brand-dark-bg);
    overflow-x: hidden;
}

.container {
    max-width: 1140px;
}

/* Global Word-Wrapping Guardrails */
h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6,
.badge, .card-title, p {
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

/* Section Background Themes */
.bg-radial-dark {
    background: radial-gradient(ellipse at 50% 30%, #6a7c90 0%, #0D141C 100%);
}

.bg-light-section {
    background-color: var(--brand-light-bg);
}

.bg-light-alt-section {
    background-color: var(--brand-light-alt);
}

/* Typography & Helper Classes */
.fw-600 {
    font-weight: 600 !important;
}

.fw-800 {
    font-weight: 800 !important;
}

.fw-900 {
    font-weight: 900 !important;
}

.tracking-wider {
    letter-spacing: 1.5px;
}

.text-charcoal {
    color: #0F172A !important;
}

.text-slate {
    color: #64748B !important;
}

.text-slate-dark {
    color: #334155 !important;
}

.text-accent {
    color: var(--brand-accent) !important;
}

.star-rating {
    color: #F59E0B;
}

.border-accent {
    border: 2px solid var(--brand-accent) !important;
}

/* ==========================================================================
   3. NAVIGATION & FOOTER
   ========================================================================== */
.navbar-custom {
    background-color: var(--nav-bg) !important;
    border-bottom: 2px solid rgba(0, 150, 214, 0.2);
}

    .navbar-custom .navbar-toggler-icon {
        filter: invert(1) grayscale(100%) brightness(200%);
    }

.nav-link {
    color: #CBD5E1 !important;
    font-weight: 600;
    transition: color 0.2s ease;
}

    .nav-link:hover {
        color: var(--brand-accent) !important;
    }

.footer-social-btn {
    width: auto !important;
    max-width: fit-content !important;
    display: inline-flex !important;
}

.footer-email-link {
    font-size: 0.875rem;
}

/* ==========================================================================
   4. BUTTONS, BADGES & DECORATORS
   ========================================================================== */
.divider-accent {
    height: 4px;
    width: 60px;
    background-color: var(--brand-accent);
}

.btn-accent {
    background: linear-gradient(135deg, #00A8F0 0%, #007BB3 100%);
    color: #FFFFFF !important;
    font-weight: 800;
    letter-spacing: 0.5px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 150, 214, 0.35);
    transition: all 0.25s ease;
}

    .btn-accent:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 150, 214, 0.5);
        color: #FFFFFF !important;
    }

.badge-accent {
    background-color: var(--brand-accent);
    color: #FFFFFF;
    font-weight: 800;
}

/* ==========================================================================
   5. CARDS & CONTAINERS
   ========================================================================== */
.card-gym {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

    .card-gym:hover {
        transform: translateY(-6px);
        box-shadow: 0 14px 28px rgba(0, 150, 214, 0.2) !important;
        border-color: var(--brand-accent) !important;
    }

.card-facility {
    background-color: var(--brand-light-alt);
    border: 1px solid var(--brand-light-border);
}

.card-service,
.card-membership,
.card-review {
    background-color: var(--brand-light-surface);
    border: 1px solid var(--brand-light-border);
}

.service-card,
.card {
    margin-left: 1rem;
    margin-right: 1rem;
    border-radius: 16px;
    overflow: hidden;
}

.service-card-body,
.card-body {
    padding: 1.5rem 1.25rem !important;
}

.service-card p,
.service-card ul {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    margin-bottom: 1rem;
}

.service-img-box {
    height: 230px;
    background-color: var(--brand-light-alt);
}

/* ==========================================================================
   6. PAGE-SPECIFIC COMPONENTS
   ========================================================================== */
/* Hero Overlay & Content */
.hero-overlay {
    background: linear-gradient(180deg, rgb(33 48 65 / 85%) 0%, rgb(3 4 5 / 95%) 100%);
    z-index: 1;
}

.hero-content {
    z-index: 2;
}

.hero-title {
    letter-spacing: -1.5px;
}

.hero-accent-dot {
    width: 12px;
    height: 12px;
    background-color: var(--brand-accent);
}

/* Subtitle & Hero Width Restraints */
.hero-subtitle {
    max-width: 540px;
    line-height: 1.6;
}

.hero-subtitle-narrow {
    max-width: 700px;
}

.about-hero-subtitle,
.pt-hero-subtitle,
.blog-hero-subtitle,
.privacy-hero-subtitle {
    max-width: 650px;
}

.pt-cta-subtitle,
.error-hero-subtitle,
.admin-hero-subtitle {
    max-width: 600px;
}

/* Page Images & Display Containers */
.about-cic-img {
    max-height: 280px;
}

.cic-mission-img {
    max-height: 400px;
}

.cic-section-img {
    max-height: 420px;
}

.cic-banner-text {
    max-width: 680px;
}

.pt-avatar-img {
    width: 140px;
    height: 140px;
}

.pt-feature-list {
    max-width: 280px;
}

.blog-details-img {
    max-height: 500px;
    width: auto;
}

.blog-article-content {
    white-space: pre-wrap;
    word-break: break-word;
}

.plan-tagline {
    min-height: 21px;
}

.plan-features-list {
    max-width: 280px;
}

.box-location-info {
    background-color: var(--brand-dark-surface);
    border: 1px solid var(--brand-dark-border);
}

.map-embed-container {
    height: 380px;
    border: 1px solid var(--brand-dark-border);
}

.policy-container {
    max-width: 900px;
}

.error-container {
    max-width: 700px;
}

/* Infinite Reviews Marquee */
.reviews-marquee {
    width: 100%;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.reviews-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: marqueeInfinite 35s linear infinite;
    will-change: transform;
}

    .reviews-track:hover {
        animation-play-state: paused;
    }

.review-card-item {
    width: 380px;
    flex-shrink: 0;
    white-space: normal;
}

@keyframes marqueeInfinite {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* FAQ Accordion (Dark Theme) */
.accordion-gym-dark .accordion-item {
    border: 1px solid var(--brand-dark-border);
    border-radius: 1rem !important;
    overflow: hidden;
    background-color: var(--brand-dark-surface);
}

.accordion-gym-dark .accordion-button {
    font-weight: 800;
    font-size: 1.05rem;
    color: #FFFFFF;
    background-color: var(--brand-dark-surface);
    box-shadow: none;
    padding: 1.25rem 1.5rem;
}

    .accordion-gym-dark .accordion-button:not(.collapsed) {
        color: var(--brand-accent);
        background-color: rgba(0, 0, 0, 0.25);
        border-bottom: 1px solid var(--brand-dark-border);
    }

    .accordion-gym-dark .accordion-button::after {
        filter: invert(1);
    }

    .accordion-gym-dark .accordion-button:focus {
        box-shadow: none;
    }

.accordion-gym-dark .accordion-body {
    color: #CBD5E1;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1.25rem 1.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Hide Injected Overlay Hosts */
#detach-button-host,
html > div[style*="z-index"],
body > div[style*="z-index"][style*="position"] {
    display: none !important;
}

/* ==========================================================================
   7. ADMIN COMMAND CENTER & DRAFT ANIMATIONS
   ========================================================================== */
.admin-form-container {
    max-width: 800px;
}

.settings-container {
    max-width: 1000px;
}

.admin-card-icon {
    line-height: 1;
}

.admin-logo-preview {
    height: 80px;
    object-fit: contain;
}

.admin-banner-preview {
    height: 120px;
    object-fit: cover;
}

.blog-image-preview {
    height: 100px;
}

.drag-handle {
    cursor: grab;
}

.card-desc-truncate {
    max-width: 250px;
}

.ajax-success-toast {
    z-index: 2000;
}

#stickyActionBar {
    z-index: 1050;
    min-width: 480px;
    max-width: 95vw;
}

#confirmSaveModal {
    z-index: 1060;
}

/* Admin Dashboard Cards */
.admin-dashboard-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .admin-dashboard-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.08) !important;
    }

/* Security Glow Animations */
@keyframes warningPulse {
    0%, 100% {
        box-shadow: 0 0 12px rgba(255, 140, 0, 0.35);
        border-color: rgba(255, 140, 0, 0.6) !important;
    }

    50% {
        box-shadow: 0 0 24px rgba(255, 140, 0, 0.85), 0 0 10px rgba(255, 69, 0, 0.5);
        border-color: rgba(255, 140, 0, 1) !important;
    }
}

@keyframes redOminousPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(220, 53, 69, 0.75), 0 0 8px rgba(220, 53, 69, 0.4);
        border-color: #dc3545 !important;
    }

    50% {
        box-shadow: 0 0 40px rgba(220, 53, 69, 1), 0 0 20px rgba(255, 0, 0, 0.85);
        border-color: #ff001b !important;
    }
}

.card-warning-pulse {
    border: 2px solid #ff8c00 !important;
    animation: warningPulse 2.2s infinite ease-in-out;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

    .card-warning-pulse:hover {
        border-color: #dc3545 !important;
        background-color: #fff0f1 !important;
        animation: redOminousPulse 0.65s infinite ease-in-out !important;
        transform: translateY(-6px) scale(1.02) !important;
    }

.warning-note {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #dc3545;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.card-warning-pulse:hover .warning-note {
    opacity: 1;
}

/* Admin Settings Tabs Styling */
.card-header-tabs .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    background-color: transparent !important;
    border: none !important;
    transition: color 0.2s ease, background-color 0.2s ease;
}

    .card-header-tabs .nav-link:hover {
        color: #FFFFFF !important;
    }

    .card-header-tabs .nav-link.active,
    .nav-tabs .nav-link.active {
        color: #00a8e8 !important;
        font-weight: 800 !important;
        background-color: #FFFFFF !important;
        border-top-left-radius: 12px !important;
        border-top-right-radius: 12px !important;
        border: none !important;
    }

/* Pulsing Indicators for Pending Edits */
@keyframes pulse-green {
    0%, 100% {
        border-color: #198754;
        box-shadow: 0 0 14px rgba(25, 135, 84, 0.85), inset 0 0 6px rgba(25, 135, 84, 0.3);
        background-color: #e8f8f0;
    }

    50% {
        border-color: #20c997;
        box-shadow: 0 0 2px rgba(25, 135, 84, 0.15), inset 0 0 1px rgba(25, 135, 84, 0.05);
        background-color: #ffffff;
    }
}

@keyframes pulse-orange {
    0%, 100% {
        border-color: #ff8c00;
        box-shadow: 0 0 14px rgba(255, 140, 0, 0.9), inset 0 0 6px rgba(255, 140, 0, 0.35);
        background-color: #fff3e0;
    }

    50% {
        border-color: #ffc107;
        box-shadow: 0 0 2px rgba(255, 193, 7, 0.15), inset 0 0 1px rgba(255, 193, 7, 0.05);
        background-color: #ffffff;
    }
}

@keyframes pulse-blue {
    0%, 100% {
        border-color: #0d6efd;
        box-shadow: 0 0 14px rgba(13, 110, 253, 0.85), inset 0 0 6px rgba(13, 110, 253, 0.3);
        background-color: #e7f1ff;
    }

    50% {
        border-color: #6ea8fe;
        box-shadow: 0 0 2px rgba(13, 110, 253, 0.15), inset 0 0 1px rgba(13, 110, 253, 0.05);
        background-color: #ffffff;
    }
}

@keyframes pulse-red {
    0%, 100% {
        border-color: #dc3545;
        box-shadow: 0 0 14px rgba(220, 53, 69, 0.85), inset 0 0 6px rgba(220, 53, 69, 0.3);
        background-color: #ffe6e6;
    }

    50% {
        border-color: #f5c2c7;
        box-shadow: 0 0 2px rgba(220, 53, 69, 0.15), inset 0 0 1px rgba(220, 53, 69, 0.05);
        background-color: #ffffff;
    }
}

.draft-card-added {
    border: 3px solid !important;
    animation: pulse-green 1.2s infinite ease-in-out !important;
}

.draft-card-edited {
    border: 3px solid !important;
    animation: pulse-orange 1.2s infinite ease-in-out !important;
}

.draft-card-reordered {
    border: 3px solid !important;
    animation: pulse-blue 1.2s infinite ease-in-out !important;
}

.draft-card-deleted {
    border: 3px solid !important;
    animation: pulse-red 1.2s infinite ease-in-out !important;
    opacity: 0.75;
}

    .draft-card-deleted .card-title-text,
    .draft-card-deleted .card-desc-text {
        text-decoration: line-through;
        opacity: 0.6;
    }

.input-draft-edited {
    border: 2px solid #ff8c00 !important;
    background-color: #fffdf0 !important;
    animation: pulse-orange 1.2s infinite ease-in-out !important;
}

/* ==========================================================================
   8. MEDIA QUERIES & RESPONSIVE LAYOUTS
   ========================================================================== */
/* Tablet & Mobile Layouts (≤ 768px) */
@media (max-width: 768px) {
    .hero-image,
    .hero-section img {
        width: 100%;
        height: auto;
        max-height: 350px;
        object-fit: cover;
    }

    .display-3 {
        font-size: 2.25rem !important;
        line-height: 1.15;
    }

    .display-5,
    .display-6 {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }

    section.py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .container,
    .hero-content,
    .section-content,
    p, h1, h2 {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-accent,
    .btn-outline-light {
        display: flex !important;
        width: 100%;
        max-width: 320px;
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem;
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
        text-align: center;
    }

    .button-group,
    .hero-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .footer-social-group {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }

    .card-gym {
        padding: 1.25rem !important;
    }

    #pillars .col-md-4 {
        margin-bottom: 0.75rem;
    }

    #pillars .p-4 {
        padding: 1.5rem 1.25rem !important;
    }

    /* Admin Table to Card Transformation */
    .admin-blog-table-wrapper table thead {
        display: none;
    }

    .admin-blog-table-wrapper table,
    .admin-blog-table-wrapper tbody,
    .admin-blog-table-wrapper tr,
    .admin-blog-table-wrapper td {
        display: block;
        width: 100%;
    }

        .admin-blog-table-wrapper tbody tr {
            padding: 1.25rem;
            border-bottom: 1px solid #e9ecef;
            background-color: #ffffff;
        }

        .admin-blog-table-wrapper td.blog-title-cell {
            font-size: 1.1rem;
            padding-bottom: 0.5rem !important;
            border-bottom: none !important;
        }

        .admin-blog-table-wrapper td[data-label] {
            padding: 0.25rem 0 !important;
            border-bottom: none !important;
            font-size: 0.9rem;
        }

            .admin-blog-table-wrapper td[data-label]::before {
                content: attr(data-label) ": ";
                font-weight: 700;
                color: #6c757d;
                margin-right: 0.35rem;
            }

        .admin-blog-table-wrapper td.blog-actions-cell {
            display: flex !important;
            gap: 0.5rem;
            margin-top: 0.75rem;
            padding-top: 0.75rem !important;
            border-top: 1px solid #f1f3f5 !important;
            text-align: left !important;
        }

            .admin-blog-table-wrapper td.blog-actions-cell a,
            .admin-blog-table-wrapper td.blog-actions-cell form,
            .admin-blog-table-wrapper td.blog-actions-cell button {
                flex: 1;
                width: 100%;
                text-align: center;
            }
}

/* Small Mobile Devices (≤ 576px) */
@media (max-width: 576px) {
    .service-card,
    .card {
        margin-left: 0.75rem;
        margin-right: 0.75rem;
    }

    .service-card-body,
    .card-body {
        padding: 1.25rem 1rem !important;
    }
}

/* Extra Small Phones (≤ 400px) */
@media (max-width: 400px) {
    .footer-email-link {
        font-size: 0.78rem !important;
    }
}
@media (min-width: 992px) {
    .border-end-lg {
        border-right: 1px solid #e2e8f0 !important;
    }

    .border-bottom-lg-0 {
        border-bottom: 0 !important;
    }
}