/* ==================== THEME SELECTOR - Position ==================== */
.theme-selector-floating {
    position: fixed;
    right: 7.5rem;
    bottom: 100px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(-100px);
    transition: all 0.4s ease;
    pointer-events: none;
}

.theme-selector-floating.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.theme-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: rgba(22, 22, 22, 0.98);
    backdrop-filter: blur(15px) saturate(120%);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-trigger:hover {
    background: rgba(30, 30, 30, 0.98);
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.5);
    transform: scale(1.05) translateY(-2px);
}

.theme-text {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #ffffff;
}

.theme-trigger:hover .theme-text {
    color: var(--color-primary);
    text-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.5);
}

.theme-arrow {
    color: var(--color-primary);
    transition: transform 0.3s ease;
}

.theme-trigger:hover .theme-arrow {
    transform: rotate(180deg);
}

.theme-menu {
    position: absolute;
    bottom: calc(100% + 0.65rem);
    right: 0;
    min-width: 272px;
    max-width: 272px;
    max-height: 425px;
    overflow-y: auto;
    background: rgba(22, 22, 22, 0.98);
    backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 0.4rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10000;
}

.theme-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==================== NEW TOGGLE OVAL DESIGN ==================== */
.theme-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    margin-bottom: 0.35rem;
    transition: all 0.3s ease;
}

.theme-option:hover {
    transform: scale(1.02);
}

.theme-toggle-oval {
    position: relative;
    width: 100%;
    height: 42px;
    border-radius: 21px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-option:hover .theme-toggle-oval {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.theme-option.active .theme-toggle-oval {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Background Image */
.theme-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.theme-option:hover .theme-bg-image {
    opacity: 0.8;
}

.theme-option.active .theme-bg-image {
    opacity: 1;
}

/* Theme Name Overlay */
.theme-name {
    position: relative;
    z-index: 2;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8),
                 0 0 20px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    transition: all 0.3s ease;
}

.theme-option.active .theme-name {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9),
                 0 0 30px rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Color Badge Toggle */
.theme-badge {
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
                inset 0 2px 4px rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}

/* Badge moves to right when active */
.theme-option.active .theme-badge {
    left: calc(100% - 37px);
}

/* Add the theme color to the badge */
.theme-option[data-theme="copper"] .theme-badge {
    background: linear-gradient(135deg, #da9146 0%, #f0a855 50%, #b8722f 100%);
    box-shadow: 0 4px 12px rgba(218, 145, 70, 0.6),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.theme-option[data-theme="ocean"] .theme-badge {
    background: linear-gradient(135deg, #46a0d2 0%, #6bb8e0 50%, #2d7ba8 100%);
    box-shadow: 0 4px 12px rgba(70, 160, 210, 0.6),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.theme-option[data-theme="mahogany"] .theme-badge {
    background: linear-gradient(135deg, #b4733c 0%, #d49050 50%, #8f5a2e 100%);
    box-shadow: 0 4px 12px rgba(180, 115, 60, 0.6),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.theme-option[data-theme="emerald"] .theme-badge {
    background: linear-gradient(135deg, #50b482 0%, #6fc99a 50%, #3d8f66 100%);
    box-shadow: 0 4px 12px rgba(80, 180, 130, 0.6),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.theme-option[data-theme="slate"] .theme-badge {
    background: linear-gradient(135deg, #8c9baf 0%, #a8b5c7 50%, #6a7a8f 100%);
    box-shadow: 0 4px 12px rgba(140, 155, 175, 0.6),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.theme-option[data-theme="midnight"] .theme-badge {
    background: linear-gradient(135deg, #969696 0%, #b8b8b8 50%, #707070 100%);
    box-shadow: 0 4px 12px rgba(150, 150, 150, 0.6),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.theme-option[data-theme="highland"] .theme-badge {
    background: linear-gradient(135deg, #8c9b69 0%, #a8b885 50%, #6d7a50 100%);
    box-shadow: 0 4px 12px rgba(140, 155, 105, 0.6),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.theme-option[data-theme="crimson"] .theme-badge {
    background: linear-gradient(135deg, #dc5050 0%, #f07070 50%, #b83c3c 100%);
    box-shadow: 0 4px 12px rgba(220, 80, 80, 0.6),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.theme-option[data-theme="amethyst"] .theme-badge {
    background: linear-gradient(135deg, #a05adc 0%, #be78f0 50%, #7d45b0 100%);
    box-shadow: 0 4px 12px rgba(160, 90, 220, 0.6),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.theme-option[data-theme="arctic"] .theme-badge {
    background: linear-gradient(135deg, #8c6446 0%, #a87c5a 50%, #6e4e35 100%);
    box-shadow: 0 4px 12px rgba(140, 100, 70, 0.6),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

/* Hover effects on badge */
.theme-option:hover .theme-badge {
    transform: translateY(-50%) scale(1.1);
}

/* Scrollbar styling for theme menu */
.theme-menu::-webkit-scrollbar {
    width: 5px;
}

.theme-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.theme-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.theme-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .theme-selector-floating {
        right: 1rem;
        bottom: 80px;
    }
    
    .theme-menu {
        min-width: 250px;
        max-width: 250px;
    }
    
    .theme-toggle-oval {
        height: 38px;
        border-radius: 19px;
    }
    
    .theme-name {
        font-size: 0.68rem;
    }
    
    .theme-badge {
        width: 28px;
        height: 28px;
    }
    
    .theme-option.active .theme-badge {
        left: calc(100% - 33px);
    }
}

@media (max-width: 480px) {
    .theme-selector-floating {
        right: 0.5rem;
        bottom: 70px;
    }
    
    .theme-menu {
        min-width: 220px;
        max-width: 220px;
        max-height: 350px;
    }
    
    .theme-toggle-oval {
        height: 35px;
        border-radius: 17.5px;
    }
    
    .theme-name {
        font-size: 0.6rem;
    }
}