/* ================================================================
   Quick Theme FAB (Floating Action Button) + Panel
   ================================================================ */

/* FAB (آیکون شناور) */
.quick-theme-fab {
    position: fixed;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 6px 24px rgba(108, 92, 231, 0.4);
    z-index: 9997;
    transition: transform 0.2s, box-shadow 0.2s;
    touch-action: none;
    user-select: none;
}

.quick-theme-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(108, 92, 231, 0.5);
}

.quick-theme-fab:active {
    cursor: grabbing;
}

.quick-theme-fab.dragging {
    cursor: grabbing;
    transform: scale(1.15);
    box-shadow: 0 12px 40px rgba(108, 92, 231, 0.6);
    transition: none;
}

body.light .quick-theme-fab {
    box-shadow: 0 6px 24px rgba(108, 92, 231, 0.35);
}

/* Panel */
.quick-theme-panel {
    position: fixed;
    width: 320px;
    max-width: 92vw;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.quick-theme-panel.open {
    opacity: 1;
    transform: scale(1);
}

body.light .quick-theme-panel {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1);
}

.qtp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-input);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.qtp-header h4 {
    color: var(--gold);
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

body.light .qtp-header h4 {
    color: var(--purple);
}

.qtp-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qtp-close:hover {
    color: var(--red);
    background: rgba(231, 76, 60, 0.1);
}

.qtp-body {
    padding: 14px 16px;
}

.qtp-group {
    margin-bottom: 14px;
}

.qtp-group:last-child {
    margin-bottom: 0;
}

.qtp-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.qtp-group label i {
    color: var(--gold);
    font-size: 0.75rem;
}

body.light .qtp-group label i {
    color: var(--purple);
}

.qtp-btn-group {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.qtp-btn-group button {
    flex: 1;
    padding: 8px 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.qtp-btn-group button:hover {
    color: var(--gold);
}

.qtp-btn-group button.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.qtp-color-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.qtp-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.qtp-color:hover {
    transform: scale(1.15);
}

.qtp-color.active {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--gold);
}

.qtp-color-custom {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    cursor: pointer;
    padding: 2px;
    background: var(--bg-input);
}

.qtp-color-custom:hover {
    border-color: var(--gold);
}

.qtp-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-input);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.qtp-save,
.qtp-full {
    flex: 1;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    transition: all 0.2s;
    border: none;
}

.qtp-save {
    background: var(--gradient-gold);
    color: var(--text-inverse);
}

.qtp-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.qtp-full {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.qtp-full:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Mobile */
@media (max-width: 768px) {
    .quick-theme-fab {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .quick-theme-panel {
        width: auto;
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        bottom: 10px !important;
        max-width: none;
    }

    .qtp-btn-group button {
        padding: 7px 4px;
        font-size: 0.7rem;
    }

    .qtp-color {
        width: 28px;
        height: 28px;
    }

    .qtp-color-custom {
        width: 28px;
        height: 28px;
    }
}