/* ============================================================
   COLOR PALETTE SYSTEM (MVVM View Styles)
   Premium Writing Tools UI
   ============================================================ */

.color-picker-wrapper {
    position: relative;
    display: inline-block;
}

.color-picker-dropdown {
    position: fixed;
    background: var(--bg-primary);
    background: rgba(var(--bg-primary-rgb), 0.9);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(var(--text-primary-rgb), 0.1);
    border-radius: 12px;
    padding: 1rem;
    box-shadow:
        0 10px 25px -5px rgba(0, 0, 0, 0.2),
        0 8px 10px -6px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(var(--accent-gold-rgb), 0.1);
    z-index: 99999;
    display: none;
    min-width: 240px;
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    pointer-events: none;
}

.color-picker-dropdown.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Header */
.color-picker-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.color-picker-header i {
    width: 14px;
    height: 14px;
    color: var(--accent-gold);
}

/* Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    margin-bottom: 1rem;
}

.color-swatch {
    width: 22px;
    height: 22px;
    border: 1px solid rgba(var(--text-primary-rgb), 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
}

.color-swatch:hover {
    transform: scale(1.25);
    border-color: var(--accent-gold);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.color-swatch:active {
    transform: scale(0.95);
}

/* Input Section */
.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.color-manual-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.color-manual-input:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(var(--accent-gold-rgb), 0.1);
}

.color-manual-input input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    cursor: pointer;
}

.color-manual-input input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-manual-input input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.color-manual-input input[type="text"] {
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    width: 70px;
    text-transform: uppercase;
}

.color-reset-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-reset-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-red);
    border-color: var(--accent-red);
    transform: rotate(-45deg);
}

.color-reset-btn i {
    width: 14px;
    height: 14px;
}