/* ═══════════════════════════════════════════════════════ */
/*  ChessVIP PRO — Floating Settings Panel                */
/*  Drag, Minimize, Close — Injected on Chess.com         */
/* ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Main Panel Container ── */
#cvp-settings-panel {
    position: fixed;
    top: 80px;
    left: 20px;
    width: 340px;
    max-height: 85vh;
    background: rgba(8, 8, 14, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    z-index: 999999;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    color: #f1f5f9;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

#cvp-settings-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* ── Ambient Glow ── */
#cvp-settings-panel::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 140%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(245, 158, 11, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

#cvp-settings-panel::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -30%;
    width: 100%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(59, 130, 246, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Title Bar (Drag Handle) ── */
#cvp-settings-panel .cvp-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    z-index: 2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

#cvp-settings-panel .cvp-titlebar:active {
    cursor: grabbing;
}

#cvp-settings-panel .cvp-title-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

#cvp-settings-panel .cvp-logo {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #f1f5f9;
}

#cvp-settings-panel .cvp-logo-crown {
    font-size: 16px;
    margin-right: 3px;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
}

#cvp-settings-panel .cvp-logo-pro {
    font-size: 8px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1a0e00;
    vertical-align: super;
    letter-spacing: 0.06em;
    margin-left: 3px;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

#cvp-settings-panel .cvp-version {
    font-size: 9px;
    color: rgba(241, 245, 249, 0.3);
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-left: 6px;
}

/* ── Window Controls ── */
#cvp-settings-panel .cvp-controls {
    display: flex;
    gap: 6px;
}

#cvp-settings-panel .cvp-controls button {
    all: unset;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(241, 245, 249, 0.5);
    transition: all 0.2s ease;
}

#cvp-settings-panel .cvp-controls button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    transform: scale(1.05);
}

#cvp-settings-panel .cvp-btn-close:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

/* ── Panel Body (Scrollable) ── */
#cvp-settings-panel .cvp-body {
    padding: 16px 18px 14px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    position: relative;
    z-index: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#cvp-settings-panel .cvp-body::-webkit-scrollbar {
    width: 4px;
}

#cvp-settings-panel .cvp-body::-webkit-scrollbar-track {
    background: transparent;
}

#cvp-settings-panel .cvp-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ── Glass Card ── */
#cvp-settings-panel .cvp-glass-card {
    background: rgba(18, 18, 30, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.02),
        0 6px 24px rgba(0, 0, 0, 0.35);
    transition: border-color 0.3s ease;
}

#cvp-settings-panel .cvp-glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ── Status Rows ── */
#cvp-settings-panel .cvp-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

#cvp-settings-panel .cvp-status-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#cvp-settings-panel .cvp-status-label {
    font-size: 12px;
    color: rgba(241, 245, 249, 0.4);
    font-weight: 500;
}

#cvp-settings-panel .cvp-status-value {
    font-size: 12px;
    font-weight: 600;
}

#cvp-settings-panel .cvp-status-active {
    color: #4ade80;
    text-shadow: 0 0 12px rgba(74, 222, 128, 0.3);
}

#cvp-settings-panel .cvp-status-inactive {
    color: #f87171;
    text-shadow: 0 0 12px rgba(248, 113, 113, 0.3);
}

/* ── License Section ── */
#cvp-settings-panel .cvp-license-title {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
    color: rgba(241, 245, 249, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#cvp-settings-panel .cvp-license-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.3);
    color: #f1f5f9;
    font-family: 'Inter', monospace;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

#cvp-settings-panel .cvp-license-input::placeholder {
    color: rgba(241, 245, 249, 0.2);
    font-weight: 400;
}

#cvp-settings-panel .cvp-license-input:focus {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1), inset 0 0 8px rgba(245, 158, 11, 0.03);
}

/* ── Activate Button ── */
#cvp-settings-panel .cvp-btn-activate {
    width: 100%;
    padding: 11px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px;
    background: linear-gradient(135deg, #b45309 0%, #92400e 50%, #78350f 100%);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 4px 16px rgba(245, 158, 11, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

#cvp-settings-panel .cvp-btn-activate:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 28px rgba(245, 158, 11, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#cvp-settings-panel .cvp-btn-activate:active {
    transform: translateY(0) scale(0.98);
}

#cvp-settings-panel .cvp-btn-activate:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ── Message Box ── */
#cvp-settings-panel .cvp-message {
    text-align: center;
    padding: 8px 12px;
    border-radius: 10px;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    display: none;
}

#cvp-settings-panel .cvp-message.success {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

#cvp-settings-panel .cvp-message.error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.15);
    color: #f87171;
}

/* ── Expiry Info ── */
#cvp-settings-panel .cvp-expiry-info {
    background: rgba(74, 222, 128, 0.04);
    border: 1px solid rgba(74, 222, 128, 0.1);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    text-align: center;
    display: none;
}

#cvp-settings-panel .cvp-expiry-days {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #4ade80, #22c55e, #16a34a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    filter: drop-shadow(0 0 20px rgba(74, 222, 128, 0.2));
}

#cvp-settings-panel .cvp-expiry-label {
    font-size: 11px;
    color: rgba(241, 245, 249, 0.4);
    margin-top: 4px;
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* ── Logout Button ── */
#cvp-settings-panel .cvp-btn-logout {
    margin-top: 10px;
    padding: 7px 18px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.03em;
}

#cvp-settings-panel .cvp-btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

/* ── Settings Toggles ── */
#cvp-settings-panel .cvp-settings-section {
    background: rgba(18, 18, 30, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

#cvp-settings-panel .cvp-settings-title {
    font-size: 10px;
    font-weight: 600;
    color: rgba(241, 245, 249, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

#cvp-settings-panel .cvp-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

#cvp-settings-panel .cvp-setting-item:last-child {
    border-bottom: none;
}

#cvp-settings-panel .cvp-setting-label {
    font-size: 12.5px;
    font-weight: 500;
    color: rgba(241, 245, 249, 0.75);
}

/* ── Toggle Switch ── */
#cvp-settings-panel .cvp-toggle {
    position: relative;
    width: 42px;
    height: 22px;
}

#cvp-settings-panel .cvp-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

#cvp-settings-panel .cvp-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#cvp-settings-panel .cvp-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

#cvp-settings-panel .cvp-toggle input:checked+.cvp-toggle-slider {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.2);
}

#cvp-settings-panel .cvp-toggle input:checked+.cvp-toggle-slider:before {
    transform: translateX(20px);
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

/* ── Footer ── */
#cvp-settings-panel .cvp-footer {
    text-align: center;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

#cvp-settings-panel .cvp-footer p {
    font-size: 10px;
    color: rgba(241, 245, 249, 0.2);
    font-weight: 500;
    letter-spacing: 0.03em;
    margin: 0;
}

/* ── Minimized Floating Button ── */
#cvp-settings-mini {
    position: fixed;
    bottom: 78px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    z-index: 999998;
    box-shadow:
        0 4px 20px rgba(245, 158, 11, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-font-smoothing: antialiased;
}

#cvp-settings-mini:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow:
        0 8px 30px rgba(245, 158, 11, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#cvp-settings-mini:active {
    transform: scale(0.95);
}

#cvp-settings-mini.cvp-mini-visible {
    display: flex;
}

/* ── Animations ── */
@keyframes cvpFadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

@keyframes cvpFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

#cvp-settings-panel.cvp-show {
    animation: cvpFadeInUp 0.3s ease-out both;
}

#cvp-settings-panel.cvp-hide {
    animation: cvpFadeOut 0.2s ease-in both;
}