/* ============================================================
   FIFG BlueGolf Integration v1.3.1
   Brand colours extracted from BlueGolf screenshots:
   Primary green  : #1a6b4a  (dark forest green — headings)
   Accent green   : #2d9b6a  (underline bar, active states)
   Header bg      : #1a6b4a  (leaderboard "WOMEN" banner)
   ============================================================ */

/* ── Variables ─────────────────────────────────────────── */
:root {
    --fifg-green:        #1a6b4a;
    --fifg-green-light:  #2d9b6a;
    --fifg-green-pale:   #e8f5ee;
    --fifg-white:        #ffffff;
    --fifg-bg:           #f8faf9;
    --fifg-border:       #d6e4dc;
    --fifg-text:         #1c2b22;
    --fifg-muted:        #6b8070;
    --fifg-shadow:       0 2px 16px rgba(26, 107, 74, 0.10);
    --fifg-radius:       10px;
    --fifg-transition:   0.22s ease;
}

/* ── Section Title (matches screenshot heading style) ── */
.fifg-section-title {
    text-align: center;
    margin-bottom: 28px;
}
.fifg-section-title h2 {
    font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--fifg-green);
    margin: 0 0 10px;
    text-transform: uppercase;
}
.fifg-title-bar {
    display: inline-block;
    width: 140px;
    height: 4px;
    background: var(--fifg-green-light);
    border-radius: 2px;
}

/* ── Outer Wrapper ─────────────────────────────────────── */
.fifg-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 28px 0;
    color: var(--fifg-text);
}

/* ── CF Notice ─────────────────────────────────────────── */
.fifg-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 16px;
    margin-bottom: 14px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 4px solid #ffb300;
    border-radius: 6px;
    font-size: 14px;
    color: #5d4037;
    animation: fifg-fadein 0.3s ease;
}
.fifg-notice-icon { font-size: 16px; flex-shrink: 0; }
.fifg-notice-text { flex: 1; line-height: 1.5; }
.fifg-notice-text a {
    color: var(--fifg-green);
    font-weight: 600;
    text-decoration: underline;
}
.fifg-notice-text a:hover { color: var(--fifg-green-light); }
.fifg-dismiss { cursor: pointer; }

/* ── Tab Strip ─────────────────────────────────────────── */
.fifg-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: var(--fifg-bg);
    border: 1px solid var(--fifg-border);
    border-bottom: none;
    border-radius: var(--fifg-radius) var(--fifg-radius) 0 0;
    padding: 10px 10px 0;
}

.fifg-tab {
    padding: 10px 22px;
    background: var(--fifg-white);
    border: 1px solid var(--fifg-border);
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--fifg-muted);
    position: relative;
    bottom: -1px;
    transition: color var(--fifg-transition), background var(--fifg-transition);
    text-transform: uppercase;
}
.fifg-tab:hover {
    color: var(--fifg-green);
    background: var(--fifg-green-pale);
}
.fifg-tab-active {
    color: var(--fifg-green);
    background: var(--fifg-white);
    border-color: var(--fifg-border);
    border-bottom-color: var(--fifg-white);
    pointer-events: none;
}
.fifg-tab-active::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--fifg-green-light);
    border-radius: 3px 3px 0 0;
}

/* ── Panel Container ───────────────────────────────────── */
.fifg-panels {
    background: var(--fifg-white);
    border: 1px solid var(--fifg-border);
    border-radius: 0 var(--fifg-radius) var(--fifg-radius) var(--fifg-radius);
    box-shadow: var(--fifg-shadow);
    overflow: hidden;
}
.fifg-wrapper-single .fifg-panels {
    border-radius: var(--fifg-radius);
}

.fifg-panel         { display: none; }
.fifg-panel-active  { display: block; }

/* ── iFrame Area ───────────────────────────────────────── */
.fifg-iframe-wrap {
    position: relative;
    width: 100%;
    min-height: 200px;
    background: var(--fifg-bg);
}

.fifg-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--fifg-bg);
    color: var(--fifg-muted);
    font-size: 14px;
    z-index: 2;
    transition: opacity 0.3s;
}
.fifg-loading.hidden {
    opacity: 0;
    pointer-events: none;
}
.fifg-loading p { margin: 0; }

.fifg-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--fifg-border);
    border-top-color: var(--fifg-green-light);
    border-radius: 50%;
    animation: fifg-spin 0.8s linear infinite;
}

.fifg-iframe {
    display: block;
    width: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.4s;
}
.fifg-iframe.visible { opacity: 1; }

/* ── Blocked Overlay ───────────────────────────────────── */
.fifg-blocked {
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 249, 0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 36px 24px;
    z-index: 10;
}
.fifg-blocked-icon   { font-size: 40px; }
.fifg-blocked-title  { font-size: 18px; font-weight: 700; color: var(--fifg-text); margin: 0; }
.fifg-blocked-desc   { font-size: 14px; color: var(--fifg-muted); max-width: 400px; line-height: 1.65; margin: 0; }
.fifg-btn-open {
    display: inline-block;
    padding: 11px 26px;
    background: var(--fifg-green);
    color: var(--fifg-white);
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background var(--fifg-transition);
}
.fifg-btn-open:hover { background: var(--fifg-green-light); color: var(--fifg-white); }

/* ── Fallback Bar ──────────────────────────────────────── */
.fifg-bar {
    padding: 9px 16px;
    background: var(--fifg-bg);
    border-top: 1px solid var(--fifg-border);
    font-size: 13px;
    color: var(--fifg-muted);
    text-align: right;
}
.fifg-bar a {
    color: var(--fifg-green);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--fifg-transition), border-color var(--fifg-transition);
}
.fifg-bar a:hover {
    color: var(--fifg-green-light);
    border-bottom-color: var(--fifg-green-light);
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 600px) {
    .fifg-tab  { padding: 8px 14px; font-size: 12px; }
    .fifg-bar  { text-align: left; }
    .fifg-iframe-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .fifg-section-title h2 { font-size: 28px; }
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fifg-spin   { to { transform: rotate(360deg); } }
@keyframes fifg-fadein { from { opacity: 0; } to { opacity: 1; } }

/* ════════════════════════════════════════════════════
   PRE-WARM POPUP UI  (v1.3.0)
   ════════════════════════════════════════════════════ */

/* ── Pre-warm prompt card ───────────────────────────── */
.fifg-prewarm {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 44px 28px;
    text-align: center;
    min-height: 360px;
    background: var(--fifg-bg);
}
.fifg-prewarm-icon {
    font-size: 44px;
    line-height: 1;
}
.fifg-prewarm-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fifg-green);
    margin: 0;
    letter-spacing: 0.01em;
}
.fifg-prewarm-desc {
    font-size: 14px;
    color: var(--fifg-muted);
    max-width: 420px;
    line-height: 1.65;
    margin: 0;
}

/* ── Step indicators ────────────────────────────────── */
.fifg-prewarm-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 360px;
    margin: 4px 0;
}
.fifg-step {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--fifg-white);
    border: 1px solid var(--fifg-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--fifg-text);
    text-align: left;
}
.fifg-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--fifg-green);
    color: var(--fifg-white);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Primary CTA button ─────────────────────────────── */
.fifg-btn-prewarm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 30px;
    background: var(--fifg-green);
    color: var(--fifg-white);
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--fifg-transition), transform var(--fifg-transition);
    letter-spacing: 0.02em;
}
.fifg-btn-prewarm:hover {
    background: var(--fifg-green-light);
    transform: translateY(-1px);
}
.fifg-btn-prewarm:disabled,
.fifg-btn--waiting {
    background: var(--fifg-muted) !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* "Done — Load Data Here" state */
.fifg-btn--done {
    background: #1a6b4a !important;
    border: 3px solid #2d9b6a !important;
    box-shadow: 0 0 0 4px rgba(45, 155, 106, 0.20) !important;
    animation: fifg-pulse 1.8s ease-in-out infinite !important;
}
.fifg-btn--done:hover {
    background: var(--fifg-green-light) !important;
    transform: translateY(-1px) !important;
    animation: none !important;
}
@keyframes fifg-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(45, 155, 106, 0.20); }
    50%       { box-shadow: 0 0 0 8px rgba(45, 155, 106, 0.08); }
}

.fifg-prewarm-alt {
    font-size: 13px;
    color: var(--fifg-muted);
    margin: 0;
}
.fifg-prewarm-alt a {
    color: var(--fifg-green);
    font-weight: 600;
    text-decoration: underline;
}

/* ── Popup blocked message ──────────────────────────── */
.fifg-popup-blocked {
    font-size: 13px;
    color: #b71c1c;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 8px 0 0;
    max-width: 400px;
}
.fifg-popup-blocked a { color: var(--fifg-green); font-weight: 600; }

/* ── Still blocked overlay ──────────────────────────── */
.fifg-blocked-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}
.fifg-btn-retry {
    padding: 10px 22px;
    background: transparent;
    border: 2px solid var(--fifg-green);
    color: var(--fifg-green);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--fifg-transition), color var(--fifg-transition);
}
.fifg-btn-retry:hover {
    background: var(--fifg-green);
    color: var(--fifg-white);
}
.fifg-blocked-note {
    font-size: 12px;
    color: var(--fifg-muted);
    max-width: 380px;
    margin: 4px 0 0;
}

/* ── Mobile adjustments ─────────────────────────────── */
@media (max-width: 600px) {
    .fifg-prewarm      { padding: 30px 16px; min-height: 300px; }
    .fifg-prewarm-steps { max-width: 100%; }
    .fifg-blocked-actions { flex-direction: column; }
}

/* ════════════════════════════════════════════════════
   v1.4.0 — Status bar for popup waiting state
   ════════════════════════════════════════════════════ */

.fifg-pw-state--waiting { width: 100%; max-width: 440px; }

.fifg-pw-status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--fifg-green-pale);
    border: 1px solid var(--fifg-border);
    border-left: 4px solid var(--fifg-green-light);
    border-radius: 8px;
    font-size: 14px;
    color: var(--fifg-green);
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
}
.fifg-pw-status-bar--success {
    background: #e6f9ef;
    border-left-color: #28a745;
    color: #155724;
}

.fifg-pw-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(45,155,106,0.3);
    border-top-color: var(--fifg-green-light);
    border-radius: 50%;
    animation: fifg-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.fifg-pw-status-text { flex: 1; line-height: 1.4; }

/* Re-open button */
.fifg-btn-reopen {
    padding: 9px 20px;
    background: transparent;
    border: 2px solid var(--fifg-green);
    color: var(--fifg-green);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--fifg-transition), color var(--fifg-transition);
    margin-top: 4px;
}
.fifg-btn-reopen:hover {
    background: var(--fifg-green);
    color: var(--fifg-white);
}
