/* ===== MODAL DE PERSONALIZACIÓN DE COLORES ===== */

.color-theme-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 12000;
}

.color-theme-overlay.hidden {
    display: none !important;
}

.color-theme-modal {
    width: min(560px, 100%);
    background: var(--theme-modal-bg);
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    box-shadow:
        0 18px 48px var(--theme-shadow),
        0 0 32px var(--theme-shadow-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all var(--transition-theme);
}

.color-theme-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--theme-border);
}

.color-theme-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--theme-accent-primary);
    letter-spacing: 0.3px;
    margin: 0;
    transition: color var(--transition-theme);
}

.color-theme-close {
    background: var(--theme-input-bg);
    color: var(--theme-accent-primary);
    border: 1px solid var(--theme-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all var(--transition-fast);
}

.color-theme-close:hover {
    background: var(--theme-input-bg);
    border-color: var(--theme-accent-primary);
    color: var(--theme-text-secondary);
}

.color-theme-body {
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    max-height: 60vh;
}

.color-theme-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.color-theme-section-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--theme-accent-primary);
    opacity: 0.85;
    margin: 0;
    transition: color var(--transition-theme);
}

.color-theme-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.color-theme-swatch {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--theme-border);
    background: var(--theme-input-bg);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    position: relative;
}

.color-theme-swatch:hover {
    transform: translateY(-4px);
    border-color: var(--theme-accent-primary);
    box-shadow: 0 10px 24px var(--theme-shadow-glow);
}

.color-theme-swatch[data-active="true"] {
    border-color: var(--theme-accent-primary);
    box-shadow: 0 0 0 1px var(--theme-accent-primary), 0 12px 32px var(--theme-shadow-glow);
}

.color-theme-swatch-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    border-radius: 10px;
    overflow: hidden;
    height: 60px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.color-theme-swatch-preview span {
    width: 100%;
    height: 100%;
}

.color-theme-swatch-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--theme-text-secondary);
    letter-spacing: 0.4px;
    transition: color var(--transition-theme);
}

.color-theme-swatch--custom {
    border-color: var(--theme-border);
}

.color-theme-swatch-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(212, 175, 55, 0.2);
    color: #f5f1d6;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    padding: 3px 8px;
    border-radius: 999px;
    pointer-events: none;
}

.color-theme-swatch-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(197, 0, 57, 0.4);
    background: rgba(122, 6, 32, 0.35);
    color: #ffd6e0;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.color-theme-swatch-remove:hover {
    background: rgba(197, 0, 57, 0.55);
    box-shadow: 0 8px 16px rgba(197, 0, 57, 0.35);
    transform: translateY(-1px);
}

.color-theme-custom-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px 16px;
    align-items: center;
}

.color-theme-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--theme-accent-primary);
    opacity: 0.75;
    transition: color var(--transition-theme);
}

.color-theme-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-theme-name-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-theme-picker {
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.4);
    background: transparent;
    cursor: pointer;
}

.color-theme-hex {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--theme-input-border);
    background: var(--theme-input-bg);
    color: var(--theme-text-secondary);
    font-family: var(--font-main);
    font-size: 13px;
    letter-spacing: 0.6px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-theme), color var(--transition-theme);
    text-transform: uppercase;
}

.color-theme-hex:focus {
    border-color: var(--theme-accent-primary);
    box-shadow: 0 0 0 2px var(--theme-shadow-glow);
}

.color-theme-hex[data-invalid="true"] {
    border-color: rgba(197, 0, 57, 0.7);
    box-shadow: 0 0 0 2px rgba(197, 0, 57, 0.35);
    color: #ffd6e0;
}

.color-theme-name-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--theme-input-border);
    background: var(--theme-input-bg);
    color: var(--theme-text-secondary);
    font-family: var(--font-main);
    font-size: 13px;
    letter-spacing: 0.5px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-theme), color var(--transition-theme);
}

.color-theme-name-input:focus {
    border-color: var(--theme-accent-primary);
    box-shadow: 0 0 0 2px var(--theme-shadow-glow);
}

.color-theme-name-input[data-invalid="true"] {
    border-color: rgba(197, 0, 57, 0.7);
    box-shadow: 0 0 0 2px rgba(197, 0, 57, 0.35);
    color: #ffd6e0;
}

.color-theme-name-button {
    padding: 11px 18px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #d4af37 0%, #b68a15 100%);
    color: #111;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.color-theme-name-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.35);
}

.color-theme-helper-row {
    grid-column: 1 / -1;
}

.color-theme-helper {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.6px;
    color: rgba(212, 175, 55, 0.8);
}

.color-theme-helper[data-state="success"] {
    color: #7bdba7;
}

.color-theme-helper[data-state="error"] {
    color: #ff9bb3;
}

.color-theme-helper[data-state="warn"] {
    color: #f6d58e;
}

.color-theme-preview {
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-theme-preview-board {
    --preview-light: #EEE4D1;
    --preview-dark: #1A8E78;
    width: 140px;
    height: 140px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(212, 175, 55, 0.25);
}

.color-theme-preview-light {
    background: var(--preview-light);
}

.color-theme-preview-dark {
    background: var(--preview-dark);
}

.color-theme-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--theme-border);
    background: var(--theme-input-bg);
}

.color-theme-btn {
    min-width: 120px;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.color-theme-btn.primary {
    background: linear-gradient(135deg, #d4af37 0%, #b68a15 100%);
    border-color: rgba(212, 175, 55, 0.5);
    color: #111;
    box-shadow: 0 12px 24px rgba(212, 175, 55, 0.35);
}

.color-theme-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(212, 175, 55, 0.42);
}

.color-theme-btn.secondary {
    background: linear-gradient(135deg, #b40830 0%, #7a0620 100%);
    border-color: rgba(197, 0, 57, 0.6);
    color: #fdf1e0;
    box-shadow: 0 12px 26px rgba(197, 0, 57, 0.35);
}

.color-theme-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(197, 0, 57, 0.45);
}

.color-theme-btn.ghost {
    background: transparent;
    border-color: rgba(212, 175, 55, 0.25);
    color: rgba(212, 175, 55, 0.8);
}

.color-theme-btn.ghost:hover {
    border-color: rgba(212, 175, 55, 0.45);
    color: #d4af37;
    box-shadow: 0 12px 28px rgba(212, 175, 55, 0.2);
}

@media (max-width: 640px) {
    .color-theme-modal {
        width: 100%;
        border-radius: 12px;
    }

    .color-theme-body {
        max-height: 65vh;
    }

    .color-theme-custom-grid {
        grid-template-columns: 1fr;
    }

    .color-theme-label {
        text-align: left;
    }

    .color-theme-input-group {
        flex-wrap: wrap;
    }

    .color-theme-name-group {
        flex-direction: column;
        align-items: stretch;
    }

    .color-theme-name-button {
        width: 100%;
    }

    .color-theme-picker {
        width: 44px;
        height: 44px;
    }

    .color-theme-btn {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .color-theme-body {
        padding: 0 18px 18px;
    }

    .color-theme-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== MÓVILES HORIZONTALES ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .color-theme-overlay {
        padding: 12px !important;
    }

    .color-theme-modal {
        width: min(320px, 90vw) !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
    }

    .color-theme-header {
        padding: 12px 16px 10px !important;
    }

    .color-theme-title {
        font-size: 16px !important;
    }    .color-theme-close {
        width: 30px !important;
        height: 30px !important;
        font-size: 18px !important;
    }

    .color-theme-body {
        padding: 0 16px 16px !important;
        gap: 16px !important;
        max-height: 65vh !important;
    }

    .color-theme-section {
        gap: 12px !important;
    }

    .color-theme-section-title {
        font-size: 12px !important;
        letter-spacing: 1.4px !important;
    }

    .color-theme-swatches {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important;
        gap: 8px !important;
    }

    .color-theme-swatch {
        padding: 10px !important;
        gap: 6px !important;
    }

    .color-theme-swatch-preview {
        height: 50px !important;
    }

    .color-theme-swatch-name {
        font-size: 11px !important;
    }    .color-theme-custom-grid {
        grid-template-columns: 1fr !important;
        gap: 10px 12px !important;
    }

    .color-theme-label {
        font-size: 11px !important;
        letter-spacing: 1px !important;
    }

    .color-theme-picker {
        width: 40px !important;
        height: 40px !important;
    }    .color-theme-hex {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }

    .color-theme-name-input {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }

    .color-theme-name-button {
        padding: 9px 14px !important;
        font-size: 11px !important;
        letter-spacing: 1.2px !important;
    }

    .color-theme-helper {
        font-size: 10px !important;
    }

    .color-theme-preview-board {
        width: 120px !important;
        height: 120px !important;
    }

    .color-theme-footer {
        padding: 12px 16px !important;
        gap: 8px !important;
    }    .color-theme-btn {
        min-width: 100px !important;
        padding: 10px 14px !important;
        font-size: 11px !important;
        letter-spacing: 1.2px !important;
    }
}
