﻿.fw-overlay {
    font-family: 'Outfit', sans-serif;
    position: fixed;
    inset: 0;
    background: rgba(2, 4, 10, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    overflow-y: auto;
}

    .fw-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

.fw-modal {
    width: 100%;
    max-width: 1100px;
    max-height: 85vh;
    overflow: auto;
    background: radial-gradient(circle at top, #0f1629 0%, #0b0f19 100%);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    margin: auto;
}

.fw-overlay.active .fw-modal {
    transform: scale(1) translateY(0);
}

/* Background speed-line styling simulation */
.fw-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient( ellipse 60% 40% at 50% 50%, rgba(0, 210, 255, 0.03) 0%, transparent 100% ), radial-gradient( ellipse 60% 40% at 80% 50%, rgba(255, 157, 0, 0.02) 0%, transparent 100% );
    pointer-events: none;
    z-index: 0;
}

.fw-modal::-webkit-scrollbar {
    width: 2px;
}

.fw-modal::-webkit-scrollbar-track {
    background: transparent;
}

.fw-modal::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
}

    .fw-modal::-webkit-scrollbar-thumb:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }

.fw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 2;
    position: relative;
}

.fw-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fw-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #00d2ff 0%, #ff9d00 100%);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #020617;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.35);
}

    .fw-logo-icon svg {
        width: 22px;
        height: 22px;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    }

.fw-logo-text {
    display: flex;
    flex-direction: column;
}

.fw-logo-main {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fw-logo-sub {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #00d2ff;
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
}

.fw-lang-selectors {
    display: flex;
    align-items: center;
    background: rgba(2, 6, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.fw-select-container {
    position: relative;
}

.fw-lang-selectors .fw-select-container {
    flex: 1;
    min-width: 0;
}

.fw-select-container::after {
    content: '▼';
    font-size: 0.6rem;
    color: #64748b;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.fw-select-input {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 30px 8px 16px;
    cursor: pointer;
    outline: none;
    min-width: 150px;
    width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

    .fw-select-input:hover {
        color: #00d2ff;
    }

    .fw-select-input option {
        background: #0b0f19;
        color: #ffffff;
        padding: 10px;
    }

.fw-lang-swap-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 10px;
}

    .fw-lang-swap-btn svg {
        width: 16px;
        height: 16px;
    }

    .fw-lang-swap-btn:hover {
        border-color: #00d2ff;
        color: #00d2ff;
        box-shadow: 0 0 12px rgba(0, 210, 255, 0.35);
    }

    .fw-lang-swap-btn:active {
        transform: scale(0.9);
    }

.fw-close-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

    .fw-close-btn svg {
        width: 18px;
        height: 18px;
    }

    .fw-close-btn:hover {
        background: rgba(239, 68, 68, 0.15);
        border-color: rgba(239, 68, 68, 0.5);
        color: #ef4444;
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
        transform: rotate(90deg);
    }

.fw-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    padding: 30px;
    gap: 0;
    z-index: 1;
    position: relative;
    align-items: stretch;
}

.fw-card {
    background: rgba(8, 14, 28, 0.75);
    border-radius: 20px;
    padding: 35px 30px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.fw-card-bg-glow {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.fw-card-left {
    border: 2px solid rgba(0, 210, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(0, 210, 255, 0.05);
}

    .fw-card-left .fw-card-bg-glow {
        background: radial-gradient( circle at bottom left, #00d2ff 0%, transparent 70% );
    }

    .fw-card-left:hover {
        border-color: #00d2ff;
        box-shadow: 0 15px 35px rgba(0, 210, 255, 0.15), 0 0 20px rgba(0, 210, 255, 0.5), inset 0 0 20px rgba(0, 210, 255, 0.1);
    }

        .fw-card-left:hover .fw-card-bg-glow {
            opacity: 0.12;
        }

.fw-card-right {
    border: 2px solid rgba(255, 157, 0, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(255, 157, 0, 0.05);
}

    .fw-card-right .fw-card-bg-glow {
        background: radial-gradient( circle at bottom right, #ff9d00 0%, transparent 70% );
    }

    .fw-card-right:hover {
        border-color: #ff9d00;
        box-shadow: 0 15px 35px rgba(255, 157, 0, 0.15), 0 0 20px rgba(255, 157, 0, 0.5), inset 0 0 20px rgba(255, 157, 0, 0.1);
    }

        .fw-card-right:hover .fw-card-bg-glow {
            opacity: 0.12;
        }

.fw-card-header {
    margin-bottom: 20px;
}

.fw-badge {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 6px 16px;
    border-radius: 8px;
    display: inline-block;
}

    .fw-badge.hidden {
        display: none !important;
    }

.fw-card-left .fw-badge {
    background: rgba(0, 210, 255, 0.15);
    border: 1px solid rgba(0, 210, 255, 0.3);
    color: #00d2ff;
    text-shadow: 0 0 6px rgba(0, 210, 255, 0.3);
}

.fw-card-right .fw-badge {
    background: rgba(255, 157, 0, 0.15);
    border: 1px solid rgba(255, 157, 0, 0.3);
    color: #ff9d00;
    text-shadow: 0 0 6px rgba(255, 157, 0, 0.3);
}

.fw-card-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.fw-word-text {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.4;
    word-break: break-word;
    letter-spacing: -0.2px;
}

.fw-card-left .fw-word-text {
    color: #ffffff;
}

.fw-card-right .fw-word-text {
    color: yellow;
}

.fw-audio-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

    .fw-audio-btn svg {
        width: 20px;
        height: 20px;
    }

.fw-card-left .fw-audio-btn:hover {
    background: rgba(0, 210, 255, 0.15);
    border-color: #00d2ff;
    color: #00d2ff;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
    transform: scale(1.08);
}

.fw-card-right .fw-audio-btn:hover {
    background: rgba(255, 157, 0, 0.15);
    border-color: #ff9d00;
    color: #ff9d00;
    box-shadow: 0 0 15px rgba(255, 157, 0, 0.4);
    transform: scale(1.08);
}

.fw-audio-btn:active {
    transform: scale(0.95);
}

.fw-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 80px;
    min-height: 100%;
}

.fw-divider-lightning-svg {
    position: absolute;
    top: -20px;
    bottom: -20px;
    width: 44px;
    height: calc(100% + 40px);
    pointer-events: none;
    z-index: 1;
    animation: lightning-pulse 2s infinite linear;
}

    .fw-divider-lightning-svg svg {
        width: 100%;
        height: 100%;
    }

.lightning-glow-outer {
    filter: drop-shadow(0 0 6px #00d2ff) drop-shadow(0 0 12px #ff9d00);
    opacity: 0.95;
}

.lightning-core {
    filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.8));
}

.fw-divider-line-mobile {
    display: none;
}

.fw-divider-badge-wrapper {
    z-index: 10;
    transform: rotate(14deg);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fw-card-right.hidden-card {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(20px) scale(0.95) !important;
}

.fw-divider-badge {
    background: #020612;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: rotate(-14deg); /* Counter-rotate text so it stays upright */
}

.fw-badge-lightning {
    width: 14px;
    height: 14px;
    color: #00d2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lightning-glow 1.5s infinite alternate;
}

    .fw-badge-lightning svg {
        width: 100%;
        height: 100%;
    }

.fw-badge-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    white-space: nowrap;
}

.fw-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(2, 6, 16, 0.4);
    z-index: 2;
}

/* Subtext & Labels helper styles */
.fw-control-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #64748b;
    margin-bottom: 0;
    display: block;
}

.fw-control-sub {
    font-size: 0.75rem;
    color: #64748b;
    display: block;
    margin-top: 6px;
}

.fw-footer-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fw-select-mode {
    border: 1px solid rgba(0, 210, 255, 0.3);
    background: rgba(0, 210, 255, 0.03);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.05);
    width: 140px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

    .fw-select-mode:hover {
        border-color: #00d2ff;
        box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
    }

    .fw-select-mode .fw-select-input {
        min-width: 100%;
        padding: 10px 30px 10px 14px;
        font-size: 0.9rem;
        font-weight: 700;
    }

.fw-footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.fw-footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.fw-next-btn {
    background: linear-gradient(135deg, #0077ff 0%, #00d2ff 100%);
    border: none;
    color: #020617;
    padding: 10px 24px;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
    min-width: 120px;
    justify-content: center;
}

    .fw-next-btn:hover:not(:disabled) {
        box-shadow: 0 0 25px rgba(0, 210, 255, 0.7);
        transform: translateY(-2px);
        background: linear-gradient(135deg, #0084ff 0%, #00f6ff 100%);
    }

    .fw-next-btn:active:not(:disabled) {
        transform: translateY(1px);
    }

    .fw-next-btn:disabled {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.05);
        color: #64748b;
        box-shadow: none;
        cursor: not-allowed;
        opacity: 0.6;
    }

.fw-next-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .fw-next-icon svg {
        width: 100%;
        height: 100%;
    }

@keyframes lightning-glow {
    from {
        color: #00d2ff;
        filter: drop-shadow(0 0 2px #00d2ff);
    }

    to {
        color: #ff9d00;
        filter: drop-shadow(0 0 6px #ff9d00);
    }
}

@keyframes lightning-pulse {
    0%, 100% {
        transform: scaleX(1);
        opacity: 0.85;
        filter: brightness(1);
    }

    50% {
        transform: scaleX(1.18) skewX(-0.5deg);
        opacity: 1;
        filter: brightness(1.25);
    }

    97% {
        filter: brightness(1.25);
        opacity: 1;
    }

    98% {
        opacity: 0.35;
    }

    99% {
        opacity: 1;
    }
}

@media (max-width: 992px) {
    .fw-modal {
        max-width: 720px;
    }

    .fw-body {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px;
    }

    .fw-divider {
        width: 100%;
        min-height: auto;
        height: 36px;
        padding: 8px 0;
    }

    .fw-divider-lightning-svg {
        display: none;
    }

    .fw-divider-line-mobile {
        display: block;
        position: absolute;
        top: 50%;
        left: 20%;
        right: 20%;
        height: 2px;
        width: auto;
        transform: translateY(-50%) rotate(0deg);
        background: linear-gradient( to right, #00d2ff 0%, #00d2ff 45%, #ff9d00 55%, #ff9d00 100% );
        box-shadow: 0 0 8px rgba(0, 210, 255, 0.4), 0 0 8px rgba(255, 157, 0, 0.4);
    }

    .fw-divider-badge-wrapper {
        transform: rotate(0deg);
    }

    .fw-divider-badge {
        transform: rotate(0deg);
    }

    .fw-card {
        min-height: 140px;
        padding: 20px;
    }

    .fw-word-text {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .fw-overlay {
        padding: 10px;
    }

    .fw-modal {
        border-radius: 16px;
    }

    .fw-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .fw-lang-selectors {
        width: 100%;
        justify-content: space-between;
    }

    .fw-select-input {
        min-width: 0;
        font-size: 0.85rem;
        padding: 6px 24px 6px 12px;
    }

    .fw-select-container::after {
        right: 10px;
    }

    .fw-close-btn {
        position: absolute;
        top: 12px;
        right: 16px;
        width: 32px;
        height: 32px;
    }

    .fw-footer {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .fw-footer-left,
    .fw-footer-right {
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .fw-footer-right {
        order: -1;
    }

    .fw-next-btn {
        width: 100%;
        max-width: 280px;
    }

    .fw-select-mode {
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .fw-word-text {
        font-size: 1.15rem;
    }

    .demo-title {
        font-size: 2rem;
    }
}
