/* ===== MODAL DE SELECCIÓN DE ESTILOS GLOBALES ===== */

.style-selection-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: 12001;
    transition: opacity var(--transition-normal);
}

.style-selection-overlay.hidden {
    display: none !important;
}

.style-selection-modal {
    width: min(680px, 100%);
    max-height: 90vh;
    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);
}

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

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

.style-selection-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 0.2s ease;
}

.style-selection-close:hover {
    background: var(--theme-input-bg);
    border-color: var(--theme-accent-primary);
    transform: scale(1.1);
}

.style-selection-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    flex: 1;
}

.style-selection-description {
    font-size: 14px;
    color: var(--theme-text-secondary);
    line-height: 1.6;
    margin: 0;
    transition: color var(--transition-theme);
}

.style-selection-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.style-selection-option {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--theme-border);
    background: var(--theme-input-bg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.style-selection-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--theme-button-hover);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

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

.style-selection-option:hover::before {
    opacity: 0.1;
}

.style-selection-option[data-active="true"] {
    border-color: var(--theme-accent-primary);
    box-shadow: 
        0 0 0 2px var(--theme-accent-primary),
        0 12px 32px var(--theme-shadow-glow);
    background: var(--theme-input-bg);
}

.style-selection-option[data-active="true"]::before {
    opacity: 0.15;
}

.style-selection-preview {
    position: relative;
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--theme-border);
    z-index: 1;
}

.style-selection-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    width: 100%;
    height: 100%;
}

.style-selection-preview-cell {
    width: 100%;
    height: 100%;
    transition: all var(--transition-theme);
}

/* Preview específico para Dark Matrix */
.style-selection-option[data-theme="dark-matrix"] .style-selection-preview-cell:nth-child(odd) {
    background: #0d0d0d;
}

.style-selection-option[data-theme="dark-matrix"] .style-selection-preview-cell:nth-child(even) {
    background: #1a1a1a;
}

.style-selection-option[data-theme="dark-matrix"] .style-selection-preview-cell:nth-child(1),
.style-selection-option[data-theme="dark-matrix"] .style-selection-preview-cell:nth-child(6),
.style-selection-option[data-theme="dark-matrix"] .style-selection-preview-cell:nth-child(11),
.style-selection-option[data-theme="dark-matrix"] .style-selection-preview-cell:nth-child(16) {
    background: linear-gradient(135deg, #d4af37 0%, #ff3333 100%);
    opacity: 0.6;
}

/* Preview específico para Light Matrix */
.style-selection-option[data-theme="light-matrix"] .style-selection-preview-cell:nth-child(odd) {
    background: #ffffff;
}

.style-selection-option[data-theme="light-matrix"] .style-selection-preview-cell:nth-child(even) {
    background: #f8f9fa;
}

.style-selection-option[data-theme="light-matrix"] .style-selection-preview-cell:nth-child(1),
.style-selection-option[data-theme="light-matrix"] .style-selection-preview-cell:nth-child(6),
.style-selection-option[data-theme="light-matrix"] .style-selection-preview-cell:nth-child(11),
.style-selection-option[data-theme="light-matrix"] .style-selection-preview-cell:nth-child(16) {
    background: linear-gradient(135deg, #64B5F6 0%, #81C784 100%);
    opacity: 0.5;
}

/* Preview específico para Quantum Matrix */
.style-selection-option[data-theme="quantum-matrix"] .style-selection-preview-cell:nth-child(odd) {
    background: #1a0a2e;
}

.style-selection-option[data-theme="quantum-matrix"] .style-selection-preview-cell:nth-child(even) {
    background: #16213e;
}

.style-selection-option[data-theme="quantum-matrix"] .style-selection-preview-cell:nth-child(1),
.style-selection-option[data-theme="quantum-matrix"] .style-selection-preview-cell:nth-child(6),
.style-selection-option[data-theme="quantum-matrix"] .style-selection-preview-cell:nth-child(11),
.style-selection-option[data-theme="quantum-matrix"] .style-selection-preview-cell:nth-child(16) {
    background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 100%);
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

/* Preview específico para Aurum Matrix */
.style-selection-option[data-theme="aurum-matrix"] .style-selection-preview-cell:nth-child(odd) {
    background: #2A1F0F;
}

.style-selection-option[data-theme="aurum-matrix"] .style-selection-preview-cell:nth-child(even) {
    background: #1A1509;
}

.style-selection-option[data-theme="aurum-matrix"] .style-selection-preview-cell:nth-child(1),
.style-selection-option[data-theme="aurum-matrix"] .style-selection-preview-cell:nth-child(6),
.style-selection-option[data-theme="aurum-matrix"] .style-selection-preview-cell:nth-child(11),
.style-selection-option[data-theme="aurum-matrix"] .style-selection-preview-cell:nth-child(16) {
    background: linear-gradient(135deg, #F6E7CB 0%, #D4B87A 100%);
    opacity: 0.7;
    box-shadow: 0 0 8px rgba(246, 231, 203, 0.4);
}

/* Preview específico para Rose Matrix */
.style-selection-option[data-theme="rose-matrix"] .style-selection-preview-cell:nth-child(odd) {
    background: #1a0a1a;
}

.style-selection-option[data-theme="rose-matrix"] .style-selection-preview-cell:nth-child(even) {
    background: #2a0a2a;
}

.style-selection-option[data-theme="rose-matrix"] .style-selection-preview-cell:nth-child(1),
.style-selection-option[data-theme="rose-matrix"] .style-selection-preview-cell:nth-child(6),
.style-selection-option[data-theme="rose-matrix"] .style-selection-preview-cell:nth-child(11),
.style-selection-option[data-theme="rose-matrix"] .style-selection-preview-cell:nth-child(16) {
    background: linear-gradient(135deg, #FF1493 0%, #FF10F0 100%);
    opacity: 0.7;
    box-shadow: 0 0 8px rgba(255, 20, 147, 0.4);
}

/* Preview específico para Falling Code Matrix */
.style-selection-option[data-theme="falling-code-matrix"] .style-selection-preview-cell:nth-child(odd) {
    background: #000000;
}

.style-selection-option[data-theme="falling-code-matrix"] .style-selection-preview-cell:nth-child(even) {
    background: #0a0a0a;
}

.style-selection-option[data-theme="falling-code-matrix"] .style-selection-preview-cell:nth-child(1),
.style-selection-option[data-theme="falling-code-matrix"] .style-selection-preview-cell:nth-child(6),
.style-selection-option[data-theme="falling-code-matrix"] .style-selection-preview-cell:nth-child(11),
.style-selection-option[data-theme="falling-code-matrix"] .style-selection-preview-cell:nth-child(16) {
    background: linear-gradient(135deg, #00FF41 0%, #00FF00 100%);
    opacity: 0.8;
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.6);
}

.style-selection-option-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1;
    position: relative;
}

.style-selection-option-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-text-primary);
    transition: color var(--transition-theme);
}

.style-selection-option-description {
    font-size: 12px;
    color: var(--theme-text-muted);
    line-height: 1.4;
    transition: color var(--transition-theme);
}

.style-selection-option-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--theme-accent-primary);
    color: var(--theme-bg-primary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    transition: all var(--transition-theme);
}

.style-selection-option[data-active="true"] .style-selection-option-badge {
    background: var(--theme-accent-secondary);
    box-shadow: 0 0 8px var(--theme-shadow-glow);
}

.style-selection-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--theme-border);
}

.style-selection-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.style-selection-btn.ghost {
    background: transparent;
    color: var(--theme-text-secondary);
    border-color: var(--theme-border);
}

.style-selection-btn.ghost:hover {
    background: var(--theme-input-bg);
    border-color: var(--theme-accent-primary);
    color: var(--theme-accent-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .style-selection-modal {
        width: 95%;
        max-height: 85vh;
    }

    .style-selection-options {
        grid-template-columns: 1fr;
    }

    .style-selection-body {
        padding: 16px;
    }
}

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

    .style-selection-modal {
        width: min(320px, 90vw) !important;
        max-height: 85vh !important;
    }

    .style-selection-header {
        padding: 12px 16px 10px !important;
    }

    .style-selection-title {
        font-size: 16px !important;
    }

    .style-selection-close {
        width: 30px !important;
        height: 30px !important;
        font-size: 18px !important;
    }

    .style-selection-body {
        padding: 16px !important;
        gap: 16px !important;
    }

    .style-selection-description {
        font-size: 12px !important;
    }

    .style-selection-options {
        gap: 12px !important;
    }

    .style-selection-option {
        padding: 14px !important;
        gap: 8px !important;
    }

    .style-selection-preview {
        height: 90px !important;
    }

    .style-selection-option-name {
        font-size: 14px !important;
    }

    .style-selection-option-description {
        font-size: 11px !important;
    }

    .style-selection-footer {
        padding: 12px 16px !important;
        gap: 8px !important;
    }

    .style-selection-btn {
        padding: 8px 16px !important;
        font-size: 12px !important;
    }
}

