/* KFS Runners - Interactive UI Experience (Powered by ui-skills standards) */

/* ==========================================================================
   1. Animated Progress Stepper
   ========================================================================== */
.kfs-stepper-container {
    background: #ffffff;
    border: 1px solid #dce7e1;
    border-radius: 12px;
    padding: 18px 24px;
    margin-bottom: 28px;
    box-shadow: 0 4px 18px rgba(6, 75, 62, 0.04);
}

.kfs-stepper-progress-track {
    height: 4px;
    background: #edf2ef;
    border-radius: 99px;
    margin-bottom: 16px;
    overflow: hidden;
}

.kfs-stepper-progress-bar {
    height: 100%;
    width: 33.33%;
    background: linear-gradient(90deg, #064b3e, #0d8065);
    border-radius: 99px;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.kfs-stepper-list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.kfs-step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    color: #7b8e86;
    font-size: 12px;
    font-weight: 700;
    user-select: none;
}

.kfs-step-item:hover:not(.disabled) {
    background: #f4f8f5;
    color: #064b3e;
}

.kfs-step-item.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.kfs-step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    background: #edf3f0;
    color: #5d756d;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.kfs-step-item.active {
    color: #064b3e;
}

.kfs-step-item.active .kfs-step-badge {
    background: #064b3e;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(6, 75, 62, 0.15);
}

.kfs-step-item.completed .kfs-step-badge {
    background: #059669;
    color: #ffffff;
}

.kfs-step-title {
    display: flex;
    flex-direction: column;
    text-align: left;
}

[dir="rtl"] .kfs-step-title {
    text-align: right;
}

.kfs-step-title small {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #8fa099;
}

.kfs-step-title strong {
    font-size: 12px;
    font-weight: 800;
}

/* ==========================================================================
   2. Step Views & Transitions
   ========================================================================== */
.kfs-step-view {
    display: none;
}

.kfs-step-view.active {
    display: block;
    animation: kfsStepFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes kfsStepFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kfs-step-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e2ebe6;
}

.kfs-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #d5e0da;
    color: #38594e;
    padding: 13px 22px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kfs-btn-back:hover {
    background: #f4f8f5;
    border-color: #064b3e;
    color: #064b3e;
}

.kfs-btn-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #b81420;
    border: none;
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(237, 27, 47, 0.2);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.kfs-btn-next:hover {
    background: #d61426;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(237, 27, 47, 0.28);
}

.kfs-btn-next:active,
.kfs-btn-back:active {
    transform: scale(0.98);
}

/* ==========================================================================
   3. Tactile Card Micro-interactions (ui-skills baseline)
   ========================================================================== */
.race-select-card,
.kit-select-card {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.2s ease,
                background-color 0.2s ease !important;
    cursor: pointer;
}

.race-select-card:hover,
.kit-select-card:hover {
    transform: translateY(-3px) scale(1.008) !important;
    box-shadow: 0 12px 28px rgba(6, 75, 62, 0.08) !important;
    border-color: #064b3e !important;
}

.race-select-card:active,
.kit-select-card:active {
    transform: scale(0.985) !important;
}

.race-select-card.selected,
.kit-select-card.selected {
    border-color: #064b3e !important;
    background: #f2f8f4 !important;
    box-shadow: 0 0 0 2px #064b3e, 0 8px 24px rgba(6, 75, 62, 0.09) !important;
}

.race-select-card.selected .radio-empty,
.kit-select-card.selected .radio-empty {
    border-color: #064b3e;
    background: #064b3e;
    box-shadow: inset 0 0 0 3px #ffffff;
    animation: kfsCheckPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes kfsCheckPop {
    0% { transform: scale(0.5); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   4. Live Field Validation & Egyptian Phone Formatter
   ========================================================================== */
.kfs-field-wrap {
    position: relative;
    width: 100%;
}

.kfs-validation-badge {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    pointer-events: none;
    z-index: 2;
}

[dir="rtl"] .kfs-validation-badge {
    right: auto;
    left: 12px;
}

/* Specific badge positioning for date and select */
.kfs-field-wrap input[type="date"] ~ .kfs-validation-badge {
    right: 36px;
}
[dir="rtl"] .kfs-field-wrap input[type="date"] ~ .kfs-validation-badge {
    right: auto;
    left: 36px;
}

.kfs-field-wrap .select-wrap ~ .kfs-validation-badge {
    right: 28px;
}
[dir="rtl"] .kfs-field-wrap .select-wrap ~ .kfs-validation-badge {
    right: auto;
    left: 28px;
}

.kfs-field-wrap input:not([type="date"]) {
    padding-right: 38px;
}
[dir="rtl"] .kfs-field-wrap input:not([type="date"]) {
    padding-right: 12px;
    padding-left: 38px;
}

.kfs-field-wrap.is-valid > .kfs-validation-badge {
    display: flex;
    background: #10b981;
    color: #ffffff;
    animation: kfsCheckPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kfs-field-wrap.is-invalid > .kfs-validation-badge {
    display: flex;
    background: #ef4444;
    color: #ffffff;
}

.form-grid input.is-valid,
.form-grid select.is-valid {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
}

.form-grid input.is-invalid,
.form-grid select.is-invalid {
    border-color: #ef4444 !important;
    background-color: #fff1f2 !important;
    animation: kfsShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes kfsShake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

.kfs-field-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #6b8278;
    line-height: 1.4;
}

.kfs-field-hint.is-valid {
    color: #059669;
}

.kfs-field-hint.is-invalid {
    color: #dc2626;
}

/* ==========================================================================
   5. Floating Toast Notification Engine
   ========================================================================== */
#kfs-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - 48px);
}

[dir="rtl"] #kfs-toast-container {
    right: auto;
    left: 24px;
}

.kfs-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    background: #ffffff;
    color: #1a3830;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    pointer-events: auto;
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.kfs-toast.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.kfs-toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 900;
}

.kfs-toast-success {
    border-left: 4px solid #10b981;
}

[dir="rtl"] .kfs-toast-success {
    border-left: none;
    border-right: 4px solid #10b981;
}

.kfs-toast-success .kfs-toast-icon {
    background: #d1fae5;
    color: #065f46;
}

.kfs-toast-error {
    border-left: 4px solid #ef4444;
}

[dir="rtl"] .kfs-toast-error {
    border-left: none;
    border-right: 4px solid #ef4444;
}

.kfs-toast-error .kfs-toast-icon {
    background: #fee2e2;
    color: #991b1b;
}

.kfs-toast-info {
    border-left: 4px solid #0284c7;
}

[dir="rtl"] .kfs-toast-info {
    border-left: none;
    border-right: 4px solid #0284c7;
}

.kfs-toast-info .kfs-toast-icon {
    background: #e0f2fe;
    color: #075985;
}

/* ==========================================================================
   6. Mobile Floating Sticky Checkout Dock
   ========================================================================== */
.kfs-mobile-checkout-dock {
    display: none;
}

@media (max-width: 900px) {
    .kfs-mobile-checkout-dock {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 998;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid #dce8e1;
        padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.08);
        animation: kfsDockSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes kfsDockSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .kfs-dock-meta {
        display: flex;
        flex-direction: column;
        line-height: 1.2;
    }

    .kfs-dock-label {
        font-size: 10px;
        font-weight: 700;
        color: #6a8277;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .kfs-dock-price {
        font-family: 'Barlow Condensed', sans-serif;
        font-size: 24px;
        font-weight: 900;
        color: #064b3e;
    }

    .kfs-dock-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: #b81420;
        color: #ffffff;
        border: none;
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
        cursor: pointer;
        box-shadow: 0 6px 18px rgba(237, 27, 47, 0.25);
    }
}

/* ==========================================================================
   7. Race Countdown Ticker (Homepage Hero)
   ========================================================================== */
.kfs-countdown-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 24px;
    backdrop-filter: blur(8px);
    display: inline-block;
}

.kfs-countdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ff6a70;
    margin-bottom: 10px;
}

.kfs-countdown-grid {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kfs-countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
}

.kfs-countdown-number {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    color: #ffffff;
}

.kfs-countdown-label {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 3px;
}

.kfs-countdown-sep {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 900;
    color: #b81420;
    line-height: 1;
}

/* ==========================================================================
   8. Quick Distance Filter Pills (Homepage)
   ========================================================================== */
.kfs-filter-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.kfs-filter-pill {
    background: #ffffff;
    border: 1px solid #dbe6e0;
    color: #3b5a4f;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kfs-filter-pill:hover {
    border-color: #064b3e;
    color: #064b3e;
    background: #f0f7f3;
}

.kfs-filter-pill.active {
    background: #064b3e;
    border-color: #064b3e;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(6, 75, 62, 0.2);
}

/* ==========================================================================
   9. Number Pop-in / Pulse animation (transitions-dev)
   ========================================================================== */
.kfs-pulse-pop {
    animation: kfsPulsePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes kfsPulsePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #059669; }
    100% { transform: scale(1); }
}

/* Copy button feedback */
.kfs-copy-btn {
    transition: all 0.2s ease;
}
.kfs-copy-btn.copied {
    background: #059669 !important;
    color: #ffffff !important;
}

/* ==========================================================================
   10. Multi-Ticket & Multi-Runner Group Checkout Styles
   ========================================================================== */
.kfs-ticket-card {
    background: #ffffff;
    border: 1px solid #dbe6e0;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
    position: relative;
    box-shadow: 0 4px 14px rgba(6, 75, 62, 0.03);
    transition: all 0.2s ease;
}

.kfs-ticket-card:hover {
    border-color: #064b3e;
}

.kfs-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e2ebe6;
}

.kfs-ticket-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 800;
    color: #064b3e;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.kfs-ticket-remove-btn {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #be123c;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kfs-ticket-remove-btn:hover {
    background: #be123c;
    color: #ffffff;
}

.kfs-add-ticket-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    background: #f7faf8;
    border: 2px dashed #b8d2c4;
    border-radius: 10px;
    color: #064b3e;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    margin: 18px 0 24px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kfs-add-ticket-btn:hover {
    background: #eef7f2;
    border-color: #064b3e;
    transform: translateY(-2px);
}

.kfs-copy-main-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef8f2;
    border: 1px solid #cce8d7;
    color: #065f46;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kfs-copy-main-btn:hover {
    background: #064b3e;
    color: #ffffff;
    border-color: #064b3e;
}

.kfs-attendee-section {
    background: #ffffff;
    border: 1px solid #dce8e1;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.kfs-attendee-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf3ef;
}

.kfs-order-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0;
}

.kfs-order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    background: #f8faf9;
    border-radius: 6px;
    border: 1px solid #e7eeea;
    font-size: 11px;
}

.kfs-order-item-row b {
    color: #064b3e;
}
