/**
 * Estilos para el Selector de Temas
 * UI moderna y intuitiva para cambio de temas
 */

/* ===== SELECTOR DE TEMAS FLOTANTE ===== */
.theme-selector {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1060;
}

.theme-toggle-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-link-hover-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.theme-toggle-btn i {
    font-size: 1.3rem;
}

/* Tooltip */
.theme-tooltip {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.theme-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
}

.theme-toggle-btn:hover .theme-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ===== PANEL DE TEMAS ===== */
.theme-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    max-height: 70vh;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
}

.theme-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.theme-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-light);
}

.theme-panel-header h6 {
    margin: 0;
    color: var(--bs-dark);
    font-weight: 600;
}

.btn-close-theme {
    background: none;
    border: none;
    color: var(--bs-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-close-theme:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--bs-dark);
}

/* ===== GRID DE TEMAS ===== */
.theme-grid {
    max-height: 50vh;
    overflow-y: auto;
    padding: 10px;
}

.theme-option {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative;
}

.theme-option:hover {
    background: var(--bs-light);
    transform: translateX(4px);
}

.theme-option.active {
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-color: var(--bs-primary);
}

.theme-preview {
    display: flex;
    margin-right: 12px;
    gap: 4px;
}

.theme-color-primary,
.theme-color-secondary {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-info {
    flex: 1;
}

.theme-name {
    font-weight: 600;
    color: var(--bs-dark);
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.theme-description {
    font-size: 0.75rem;
    color: var(--bs-secondary);
    line-height: 1.3;
}

.theme-check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-primary);
    font-size: 1rem;
}

/* ===== NOTIFICACIONES ===== */
.theme-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bs-success);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1070;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.theme-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
.theme-grid::-webkit-scrollbar {
    width: 6px;
}

.theme-grid::-webkit-scrollbar-track {
    background: var(--bs-light);
    border-radius: 3px;
}

.theme-grid::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 3px;
}

.theme-grid::-webkit-scrollbar-thumb:hover {
    background: var(--bs-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .theme-selector {
        bottom: 15px;
        right: 15px;
    }

    .theme-toggle-btn {
        width: 45px;
        height: 45px;
    }

    .theme-toggle-btn i {
        font-size: 1.1rem;
    }

    .theme-panel {
        width: 280px;
        bottom: 55px;
    }

    .theme-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .theme-panel {
        width: calc(100vw - 30px);
        right: -50px;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes themeApplied {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.theme-option.applied {
    animation: themeApplied 0.3s ease;
}

/* ===== INTEGRACIÓN CON TEMAS ===== */
/* Tema ILUSIONES CON FUTURO (predeterminado) */
:root .theme-toggle-btn,
[data-theme="ilusiones"] .theme-toggle-btn {
    background: linear-gradient(135deg, #52b69a, #34a0a4);
}

[data-theme="turquoise"] .theme-toggle-btn {
    background: linear-gradient(135deg, #26c6da, #00acc1);
}

[data-theme="lavender"] .theme-toggle-btn {
    background: linear-gradient(135deg, #8b7ec8, #7b6cb8);
}

[data-theme="mint"] .theme-toggle-btn {
    background: linear-gradient(135deg, #7dd3c0, #6bc4b0);
}

[data-theme="coral"] .theme-toggle-btn {
    background: linear-gradient(135deg, #ff9a8b, #ff8a7b);
}

[data-theme="sky"] .theme-toggle-btn {
    background: linear-gradient(135deg, #87ceeb, #77bedb);
}

[data-theme="dusty-rose"] .theme-toggle-btn {
    background: linear-gradient(135deg, #d4a4a4, #c49494);
}

[data-theme="olive"] .theme-toggle-btn {
    background: linear-gradient(135deg, #a4ac86, #949c76);
}

[data-theme="mauve"] .theme-toggle-btn {
    background: linear-gradient(135deg, #b19cd9, #a18cc9);
}