/* ─────────────────────────────────────────────────────────────────────────────
   BFU Freedom Box Tracker — Stylesheet
   Brand: Be Free University | Navy #1B2B5E | Gold #D4AF37 | White #FFFFFF
   ───────────────────────────────────────────────────────────────────────────── */

:root {
    --bfu-navy:     #1B2B5E;
    --bfu-navy-mid: #243570;
    --bfu-gold:     #D4AF37;
    --bfu-gold-lt:  #F0D060;
    --bfu-white:    #FFFFFF;
    --bfu-gray-lt:  #F7F8FC;
    --bfu-gray:     #E4E6EF;
    --bfu-gray-mid: #A0A3B1;
    --bfu-green:    #27AE60;
    --bfu-green-lt: #EAFAF1;
    --bfu-radius:   12px;
    --bfu-shadow:   0 4px 24px rgba(27, 43, 94, 0.12);
}

/* ── Tracker Container ───────────────────────────────────────────────────────── */

.bfu-fb-tracker {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #2C2C3A;
}

/* ── Awarded Banner ──────────────────────────────────────────────────────────── */

.bfu-fb-awarded-banner {
    background: linear-gradient(135deg, var(--bfu-navy), var(--bfu-navy-mid));
    border-radius: var(--bfu-radius);
    padding: 32px 24px;
    text-align: center;
    color: var(--bfu-white);
    margin-bottom: 24px;
    box-shadow: var(--bfu-shadow);
    border: 2px solid var(--bfu-gold);
}

.bfu-fb-awarded-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 12px;
    animation: bfu-bounce 0.6s ease-out;
}

.bfu-fb-awarded-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--bfu-gold) !important;
    margin: 0 0 12px !important;
}

.bfu-fb-awarded-message {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255,255,255,0.9) !important;
    margin: 0 !important;
}

/* ── Header ──────────────────────────────────────────────────────────────────── */

.bfu-fb-header {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bfu-navy);
    border-radius: var(--bfu-radius) var(--bfu-radius) 0 0;
    padding: 28px 24px;
    color: var(--bfu-white);
}

.bfu-fb-box-icon {
    position: relative;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bfu-fb-box-emoji {
    font-size: 44px;
    line-height: 1;
    filter: grayscale(0.8);
    transition: filter 0.4s;
}

.bfu-fb-box-icon.awarded .bfu-fb-box-emoji {
    filter: none;
    animation: bfu-bounce 0.5s ease-out;
}

.bfu-fb-lock-overlay {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 20px;
    background: var(--bfu-navy);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bfu-fb-header-text {
    flex: 1;
}

.bfu-fb-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--bfu-white) !important;
    margin: 0 0 6px !important;
    line-height: 1.3 !important;
}

.bfu-fb-subtitle {
    font-size: 14px !important;
    color: rgba(255,255,255,0.75) !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

/* ── Progress Bar ─────────────────────────────────────────────────────────────── */

.bfu-fb-progress-wrap {
    background: var(--bfu-navy-mid);
    padding: 16px 24px 20px;
}

.bfu-fb-progress-bar-bg {
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

.bfu-fb-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bfu-gold), var(--bfu-gold-lt));
    border-radius: 50px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bfu-fb-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
}

.bfu-fb-percent {
    color: var(--bfu-gold);
    font-weight: 700;
    font-size: 15px;
}

/* ── Steps List ───────────────────────────────────────────────────────────────── */

.bfu-fb-steps {
    background: var(--bfu-white);
    border: 1px solid var(--bfu-gray);
    border-top: none;
}

.bfu-fb-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--bfu-gray);
    transition: background 0.2s;
}

.bfu-fb-step:last-child {
    border-bottom: none;
}

.bfu-fb-step.complete {
    background: var(--bfu-green-lt);
}

.bfu-fb-step.incomplete:hover {
    background: var(--bfu-gray-lt);
}

/* Check indicator */
.bfu-fb-step-check {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bfu-fb-checkmark {
    font-size: 22px;
    line-height: 1;
    animation: bfu-check-pop 0.3s ease-out;
}

.bfu-fb-circle {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid var(--bfu-gray-mid);
    background: var(--bfu-white);
}

/* Step icon */
.bfu-fb-step-icon {
    flex-shrink: 0;
    font-size: 24px;
    line-height: 1;
    width: 36px;
    text-align: center;
}

/* Step content */
.bfu-fb-step-content {
    flex: 1;
    min-width: 0;
}

.bfu-fb-step-label {
    font-weight: 600;
    font-size: 15px;
    color: #1A1A2E;
    margin-bottom: 2px;
}

.bfu-fb-step.complete .bfu-fb-step-label {
    color: var(--bfu-green);
}

.bfu-fb-step-description {
    font-size: 13px;
    color: var(--bfu-gray-mid);
    line-height: 1.4;
}

.bfu-fb-step-completed-on {
    font-size: 11px;
    color: var(--bfu-green);
    font-weight: 500;
    margin-top: 3px;
}

/* Status badge */
.bfu-fb-step-status-badge {
    flex-shrink: 0;
}

.bfu-fb-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.bfu-fb-badge.complete {
    background: var(--bfu-green);
    color: var(--bfu-white);
}

.bfu-fb-badge.pending {
    background: var(--bfu-gray);
    color: var(--bfu-gray-mid);
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */

.bfu-fb-footer {
    background: var(--bfu-gray-lt);
    border: 1px solid var(--bfu-gray);
    border-top: none;
    border-radius: 0 0 var(--bfu-radius) var(--bfu-radius);
    padding: 16px 20px;
    text-align: center;
}

.bfu-fb-footer p {
    margin: 0 !important;
    font-size: 14px !important;
    color: #555 !important;
    font-weight: 500 !important;
}

/* ── Login Notice ─────────────────────────────────────────────────────────────── */

.bfu-fb-login-notice {
    padding: 16px 20px;
    background: var(--bfu-gray-lt);
    border-radius: var(--bfu-radius);
    border: 1px solid var(--bfu-gray);
    text-align: center;
    font-size: 15px;
}

/* ── Animations ──────────────────────────────────────────────────────────────── */

@keyframes bfu-bounce {
    0%   { transform: scale(0.6); opacity: 0; }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes bfu-check-pop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media ( max-width: 520px ) {
    .bfu-fb-header {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
    }

    .bfu-fb-step {
        padding: 14px 14px;
        gap: 10px;
    }

    .bfu-fb-step-status-badge {
        display: none;
    }

    .bfu-fb-title {
        font-size: 18px !important;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   ADMIN STYLES
   ───────────────────────────────────────────────────────────────────────────── */

.bfu-admin-wrap h1 {
    margin-bottom: 20px;
}

.bfu-admin-card {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.bfu-admin-card h2 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e4e7;
    font-size: 16px;
    color: var(--bfu-navy);
}

.bfu-members-table .bfu-step-cell {
    text-align: center;
    font-size: 18px;
}

.bfu-members-table .bfu-step-cell.done {
    background: #eafaf1;
}

.bfu-mini-bar {
    background: #e4e6ef;
    border-radius: 50px;
    height: 8px;
    width: 80px;
    overflow: hidden;
    margin-bottom: 4px;
}

.bfu-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bfu-navy), var(--bfu-gold));
    border-radius: 50px;
}

.bfu-members-table details summary {
    cursor: pointer;
    color: var(--bfu-navy);
    font-weight: 600;
    font-size: 12px;
}

.bfu-members-table details form {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bfu-members-table details select {
    font-size: 12px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MINI PROGRESS BAR WIDGET  [bfu_freedom_box_mini]
   ───────────────────────────────────────────────────────────────────────────── */

.bfu-mini-tracker {
    background: var(--bfu-white);
    border: 1px solid var(--bfu-gray);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 2px 10px rgba(27, 43, 94, 0.08);
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: opacity 0.5s ease, transform 0.5s ease, max-height 0.6s ease;
    overflow: hidden;
    cursor: pointer;
}

.bfu-mini-tracker:hover {
    border-color: var(--bfu-navy);
    box-shadow: 0 4px 16px rgba(27, 43, 94, 0.15);
}

/* Disappear animation — triggered by JS when all steps done */
.bfu-mini-tracker.bfu-mini-hiding {
    opacity: 0;
    transform: scale(0.95);
    max-height: 0;
    padding: 0;
    margin: 0;
    border: none;
}

/* ── Header row ─────────────────────────────────────────────────────────────── */

.bfu-mini-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
}

.bfu-mini-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--bfu-navy);
    letter-spacing: 0.1px;
}

.bfu-mini-fraction {
    font-size: 12px;
    font-weight: 700;
    color: var(--bfu-gold);
    background: var(--bfu-navy);
    padding: 2px 8px;
    border-radius: 50px;
    letter-spacing: 0.5px;
}

/* ── Progress bar ────────────────────────────────────────────────────────────── */

.bfu-mini-bar-bg {
    background: var(--bfu-gray);
    border-radius: 50px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.bfu-mini-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bfu-navy), var(--bfu-gold));
    border-radius: 50px;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Step icons ──────────────────────────────────────────────────────────────── */

.bfu-mini-steps {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

/* ── Custom Tooltip ──────────────────────────────────────────────────────────── */

.bfu-mini-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    cursor: pointer;
}

/* Tooltip bubble */
.bfu-mini-step::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    transform-origin: bottom center;
    background: var(--bfu-navy);
    color: var(--bfu-white);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    padding: 6px 11px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    max-width: 180px;
    white-space: normal;
    text-align: center;
}

/* Tooltip arrow */
.bfu-mini-step::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bfu-navy);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 101;
}

.bfu-mini-step:hover::after,
.bfu-mini-step:hover::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Keep first/last tooltips from clipping off screen edges */
.bfu-mini-step:first-child::after { left: 0; transform: translateX(0) scale(0.85); }
.bfu-mini-step:first-child:hover::after { transform: translateX(0) scale(1); }
.bfu-mini-step:last-child::after  { left: auto; right: 0; transform: translateX(0) scale(0.85); }
.bfu-mini-step:last-child:hover::after  { transform: translateX(0) scale(1); }

/* ── Freedom Box Modal ───────────────────────────────────────────────────────── */

#bfu-mini-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(27, 43, 94, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: bfu-overlay-in 0.2s ease-out;
}

@keyframes bfu-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#bfu-mini-modal-box {
    background: var(--bfu-white);
    border-radius: 14px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,0.35);
    animation: bfu-modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bfu-modal-in {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

#bfu-mini-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 10;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--bfu-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

#bfu-mini-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

#bfu-mini-modal-box .bfu-fb-tracker {
    max-width: 100%;
    border-radius: 14px;
    overflow: hidden;
}

#bfu-mini-modal-box .bfu-fb-header {
    border-radius: 14px 14px 0 0;
}

.bfu-mini-step-icon {
    font-size: 22px;
    line-height: 1;
    transition: filter 0.3s, transform 0.3s;
}

/* Incomplete steps are desaturated */
.bfu-mini-step.todo .bfu-mini-step-icon {
    filter: grayscale(1) opacity(0.35);
}

/* Complete steps are vivid + slightly larger */
.bfu-mini-step.done .bfu-mini-step-icon {
    filter: none;
    transform: scale(1.1);
}

/* Small green dot under complete icons */
.bfu-mini-done-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bfu-green);
    animation: bfu-dot-pop 0.3s ease-out;
}

/* Step completing animation (added by JS) */
.bfu-mini-step.just-completed .bfu-mini-step-icon {
    animation: bfu-mini-celebrate 0.5s ease-out;
}

@keyframes bfu-mini-celebrate {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.5) rotate(-8deg); }
    70%  { transform: scale(1.3) rotate(6deg); }
    100% { transform: scale(1.1); }
}

@keyframes bfu-dot-pop {
    0%   { transform: scale(0); opacity: 0; }
    70%  { transform: scale(1.4); }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media ( max-width: 380px ) {
    .bfu-mini-step-icon {
        font-size: 18px;
    }
    .bfu-mini-title {
        font-size: 12px;
    }
}
