/**
 * Frontend styles
 *
 * @package Regional_Site_Selector
 *
 * Institutional black / white theme with gold (#F3C725) accents.
 * Headings: Hedvig Letters Serif. Body: Inter.
 *
 * NOTE: this file only changes colours, typography, and a few layout
 * values needed to make the current accordion-style modal markup
 * (see modal.php: .regional-region > .regional-tab + .regional-details)
 * render correctly. No selectors were removed, so anything else in the
 * plugin (dropdown/buttons shortcodes) that may share these class names
 * keeps working. Two fixes were folded in because the redesign can't be
 * verified without them:
 *   1. .regional-details had no display:none / .active rule anywhere in
 *      the original file, even though modal.php toggles that exact
 *      class — without it every region's description+button would
 *      show stacked open at once. Added below.
 *   2. .regional-tabs was capped at max-width:350px, a leftover from a
 *      two-column tabs+content layout that modal.php no longer uses
 *      (there's only one column now) — left as-is it leaves ~250px of
 *      dead empty space on the right of the modal. Widened to 100%.
 */

@import url('https://fonts.googleapis.com/css2?family=Hedvig+Letters+Serif&family=Inter:wght@400;500;600;700&display=swap');

.regional-modal {
    display: flex;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
    pointer-events: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.regional-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 6px;
    max-width: 560px;
    width: 90%;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s ease-out;
    font-family: 'Inter', -apple-system, sans-serif;
}

.regional-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0A0A0A 0%, #F3C725 50%, #0A0A0A 100%);
    border-radius: 6px 6px 0 0;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.regional-modal-content h2 {
    margin: 0 0 15px 0;
    font-family: 'Hedvig Letters Serif', serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: #0A0A0A;
    text-align: left;
}

.regional-modal-content p {
    margin: 0 0 30px 0;
    font-size: 16px;
    color: #6E6E6E;
    text-align: left;
}

.regional-options {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.regional-option {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    font-size: 18px;
    font-weight: 500;
    color: #111111;
    background: #FFFFFF;
    border: 1px solid #E4E4E4;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    position: relative;
    font-family: 'Inter', -apple-system, sans-serif;
}

.regional-option:hover {
    background: #000;
    border-color: #0A0A0A;
    color: #fff;
    transform: translateX(4px);
}

.regional-option.active {
    background: #000;
    border-color: #F3C725;
    color: #fff;
    transform: translateX(2px);
}

.regional-option.active:hover {
    background: rgba(243, 199, 37, 0.15);
    border-color: #F3C725;
    color: #0A0A0A;
}

.regional-option.active .regional-arrow {
    color: #F3C725;
}

.regional-current-badge {
    font-size: 12px;
    font-weight: 600;
    color: #0A0A0A;
    background: #fff;
    border: 1px solid #F3C725;
    padding: 4px 10px;
    border-radius: 12px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.regional-flag {
    font-size: 24px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.region-flag-img {
    width: 17px;
    height: 17px;
    object-fit: contain;
    border-radius: 4px;
}

.region-flag-emoji {
    font-size: 24px;
}

.regional-name {
    flex: 1;
    font-weight: 500;
}

.regional-arrow {
    font-size: 20px;
    color: #9A9A9A;
    margin-left: 16px;
    transition: transform 0.2s ease;
}

.regional-option:hover .regional-arrow {
    transform: translateX(4px);
    color: #F3C725;
}

@media (max-width: 768px) {
    .regional-modal-content {
        padding: 30px 20px;
    }

    .regional-options {
        grid-template-columns: 1fr;
    }

    .regional-modal-content h2 {
        font-size: 24px;
    }

    .rss-dropdown-toggle {
        min-width: 100px !important;
    }
}


/* Hidden state for modal that should not auto-show */
.regional-modal.modal-hidden {
    display: none !important;
}

/* Close button for modal */
.regional-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent !important;
    border: none;
    font-size: 36px;
    font-weight: 300;
    color: #000;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    transition: color 0.2s ease;
    z-index: 10;
    border: none;
}

.regional-modal-close:hover {
    color: #F3C725;
    background: transparent;
}

.regional-modal-close:focus {
    outline: 2px solid #F3C725;
    outline-offset: 2px;
}

/* Ensure modal content has relative positioning for close button */
.regional-modal-content {
    position: relative;
}


/* Tab Container Layout */
.regional-tab-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    /* min-height: 350px; */
    min-height: auto;
}

/* Region Tabs (Left Side) */
.regional-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: none;
}

.regional-tab {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #111111;
    background: #fff;
    border: 1px solid #E4E4E4;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    box-shadow: none;
    position: relative;
    font-family: 'Inter', -apple-system, sans-serif;
}

.regional-tab:hover {
    background: rgba(243, 199, 37, 0.07);
    border-color: rgba(243, 199, 37, 0.4);
    color: #0A0A0A;
}

/* .regional-tab:hover .regional-radio {
    background: #2563eb;
} */

.regional-tab.active .regional-radio {
    background: #0A0A0A;
    border-color: #F3C725;
}

.regional-tab.active {
    color: #0A0A0A;
    background: linear-gradient(90deg, rgba(243, 199, 37, 0.08), transparent 60%);
    border-color: #F3C725;
}

.regional-tab.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #F3C725;
    border-radius: 4px 0 0 4px;
}

.regional-radio {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 50%;
    border: 1px solid #C9C9C9;
    margin-right: 14px;
    cursor: pointer
}

.regional-radio.active {
    background: #0A0A0A;
    border-color: #F3C725;
}

/*
 * Flags removed from the modal per request. Hidden via display:none
 * rather than deleted from modal.php, so no PHP template is touched —
 * this class is still used for the dropdown/buttons shortcodes'
 * larger flag treatment elsewhere in the plugin, which is untouched.
 */
.regional-tab-flag {
    display: none;
}

.regional-tab-name {
    flex: 1;
    font-weight: 500;
}

.regional-tab-arrow {
    font-size: 18px;
    color: #BEBEBE;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.regional-tab:hover .regional-tab-arrow {
    opacity: 0.5;
}

.regional-tab.active .regional-tab-arrow {
    opacity: 1;
    color: #F3C725;
}

/* Tab Content (Right Side) */
.regional-tab-content {
    flex: 1;
    /* background: #f9f9f9;
    border: 2px solid #e0e0e0; */
    border-radius: 4px;
    padding: 0px 30px;
    position: relative;
}

.regional-tab-pane {
    display: none;
}

.regional-tab-pane.active {
    display: block;
    animation: fadeInContent 0.3s ease;
}

/*
 * Detail panel for each region row (description + confirm button),
 * rendered by modal.php as `.regional-details` / `.regional-details.active`.
 * No rule for this exact class existed before, so every region's panel
 * would have shown open/stacked at once. Reuses the fadeInContent
 * keyframe already defined above.
 */
.regional-details {
    display: none;
    padding: 16px 18px 20px;
    margin-top: -1px;
    background: rgba(243, 199, 37, 0.03);
    border: 1px solid #E4E4E4;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.regional-details.active {
    display: block;
    animation: fadeInContent 0.3s ease;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.regional-tab-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #E4E4E4;
}

.regional-tab-content-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.region-flag-img-large {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.region-flag-emoji-large {
    font-size: 32px;
}

.regional-tab-header h3 {
    margin: 0;
    font-family: 'Hedvig Letters Serif', serif;
    font-size: 24px;
    font-weight: 400;
    color: #0A0A0A;
}

.regional-tab-description {
    margin-bottom: 30px;
    line-height: 1.6;
}

.regional-tab-description p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #111111;
}

.regional-tab-description .no-description {
    color: #9A9A9A;
    font-style: italic;
}

/* Confirmation Button */
.regional-confirm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: #0A0A0A;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
}

.regional-confirm-button:hover {
    background: #F3C725;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 199, 37, 0.35);
    color: #0A0A0A;
}

.regional-confirm-button:active {
    transform: translateY(0);
}

/* Update modal subtitle styling */
.regional-modal-subtitle {
    margin: -10px 0 20px 0;
    font-size: 16px;
    color: #6E6E6E;
}

/* Responsive Design for Tabs */
@media (max-width: 768px) {
    .regional-tab-container {
        flex-direction: column;
        min-height: auto;
    }

    .regional-tabs {
        max-width: 100%;
        width: 100%;
    }

    .regional-tab {
        padding: 12px 14px;
    }

    .regional-tab-content {
        padding: 20px;
    }

    .regional-tab-header h3 {
        font-size: 20px;
    }

    .regional-tab-description p {
        font-size: 12.5px;
    }

    .regional-confirm-button {
        width: 100%;
    }
}


/* Current badge in tabs */
.regional-tab .regional-current-badge {
    font-size: 10px;
    font-weight: 600;
    color: #0A0A0A;
    background: #F3C725;
    border: none;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: auto;
    height: auto;
}

/* .regional-tab.active .regional-current-badge {
    background: #4caf50;
    width: auto;
    height: auto;
    color: #fff;
} */


/* Modal Footer */
.regional-modal-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #E4E4E4;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.regional-modal-footer .regional-confirm-button {
    margin: 0;
}

/* Adjust tab description margin since button is removed */
.regional-tab-description {
    margin-bottom: 0;
}


/* ===================================================================
 * THEME OVERRIDE HARDENING
 * -------------------------------------------------------------------
 * The live modal is coming out as large bold centred white-on-black
 * pill buttons with an outlined "I CONFIRM" pill — that's not this
 * stylesheet, it's the site theme's own global styling for <button>
 * elements (a common theme/page-builder pattern) winning the cascade
 * on properties the rules above didn't defend strongly enough
 * (border-radius, text-align, font-weight, background). The gold
 * accent bar and gold ring on the active row ARE showing, because
 * the theme has no equivalent for those — so this is a specificity
 * fight, not a caching problem.
 *
 * modal.php wraps the whole thing in <div id="regional-selector-modal">,
 * so scoping under that ID plus !important reliably outranks a plain
 * theme class/element selector without touching or needing to see the
 * theme's CSS at all. Everything above this block is left as-is;
 * these rules only need to win inside the modal.
 * =================================================================== */

#regional-selector-modal.regional-modal {
    background-color: rgba(0, 0, 0, 0.85) !important;
}

#regional-selector-modal .regional-modal-content {
    background-color: #fff !important;
    border-radius: 6px !important;
    text-align: left !important;
    max-width: 560px !important;
    padding: 30px !important;
    border: none !important;
}

#regional-selector-modal .regional-modal-content h2 {
    font-family: 'Hedvig Letters Serif', serif !important;
    font-weight: 400 !important;
    font-size: 28px !important;
    color: #0A0A0A !important;
    text-align: left !important;
}

#regional-selector-modal .regional-modal-subtitle {
    color: #6E6E6E !important;
    font-weight: 400 !important;
    text-align: left !important;
}

/*
 * The base .regional-tabs rule earlier in this file already sets
 * width:100%/max-width:none to remove the plugin's original 350px cap
 * (a leftover from a two-column layout modal.php no longer uses) — but
 * that rule was never reinforced with !important like everything else
 * in this block, so something else on the site (most likely a theme or
 * page-builder flex-child/column-width utility, the same kind of thing
 * that was overriding the buttons) can still win and keep it capped.
 */
#regional-selector-modal .regional-tab-container {
    display: flex !important;
    width: 100% !important;
}

#regional-selector-modal .regional-tabs {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
}

#regional-selector-modal .regional-tab {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: #111111 !important;
    background: #fff !important;
    border: 1px solid #E4E4E4 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    width: 100% !important;
}

#regional-selector-modal .regional-tab:hover {
    background: rgba(243, 199, 37, 0.07) !important;
    border-color: rgba(243, 199, 37, 0.4) !important;
    color: #0A0A0A !important;
}

#regional-selector-modal .regional-tab.active {
    color: #0A0A0A !important;
    background: linear-gradient(90deg, rgba(243, 199, 37, 0.08), transparent 60%) !important;
    border-color: #F3C725 !important;
}

#regional-selector-modal .regional-radio {
    display: block !important;
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 1px solid #C9C9C9 !important;
    margin-right: 14px !important;
}

#regional-selector-modal .regional-radio.active,
#regional-selector-modal .regional-tab.active .regional-radio {
    background: #0A0A0A !important;
    border-color: #F3C725 !important;
}

#regional-selector-modal .regional-tab-name {
    flex: 1 !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: inherit !important;
}

#regional-selector-modal .regional-tab .regional-current-badge {
    background: #F3C725 !important;
    color: #0A0A0A !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    padding: 2px 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

#regional-selector-modal .regional-details {
    text-align: left !important;
    background: rgba(243, 199, 37, 0.03) !important;
    border: 1px solid #E4E4E4 !important;
    border-top: none !important;
}

#regional-selector-modal .regional-tab-description p {
    text-align: left !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
    color: #111111 !important;
}

#regional-selector-modal .regional-tab-description a {
    color: #0A0A0A !important;
    text-decoration: underline !important;
    text-decoration-color: #F3C725 !important;
}

#regional-selector-modal .regional-confirm-button {
    display: inline-flex !important;
    background: #0A0A0A !important;
    color: #fff !important;
    border: none !important;
    border-radius: 3px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    padding: 14px 32px !important;
}

#regional-selector-modal .regional-confirm-button:hover {
    background: #F3C725 !important;
    color: #0A0A0A !important;
}

#regional-selector-modal .regional-modal-close {
    background: transparent !important;
    border: none !important;
    color: #000 !important;
    border-radius: 0 !important;
}

#regional-selector-modal .regional-modal-close:hover {
    color: #F3C725 !important;
}
