/* Theme Picker Styles */

.theme-picker-container {
    padding: 0 0 10px 0;
    width: 100%;
    /* Ensure full width */
    margin: 0 auto;
    /* Center the container itself */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    /* Space between text and first dot */
}

.theme-picker-container .cta .mood-label {
    margin: 0 10px 0 0;
    /* Reduced margin */
    font-size: 0.85rem;
    /* Reduced from 1rem */
    opacity: 0.8;
    /* Slightly less opacity to reduce competition */
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
    border: none;
    padding: 0;
    display: inline-block;
}

.theme-picker-container .cta .mood-label strong {
    display: inline-block;
    width: 120px;
    text-align: center;
}

/* Standard block/inline-block behavior within flex */

/* .cta is now just the wrapper for buttons side-by-side with text */
.theme-picker-container .cta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    /* Vertically align text and buttons */
    gap: 15px;
    /* Increased gap slightly */
    position: relative;
    z-index: 10;
    padding: 0;
    margin: 0;
    /* No heavy container */
    background: transparent;
    border: none;
    border-radius: 0;
}

/* Base Theme Button Styles */
.theme-picker-container .cta button.theme {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    height: 24px;
    min-height: 24px;
    max-height: 24px;
    aspect-ratio: 1;
    /* Reduced from 36px */
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Subtle border */
    cursor: pointer;
    background-size: cover;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1), 0 0 10px rgba(0, 0, 0, 0.5), inset 0 0 5px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    /* Colors defined by ID below */
}

.theme-picker-container .cta button.theme:hover {
    transform: scale(1.15);
    box-shadow: 0 0 15px var(--glow);
    z-index: 2;
}

/* Active State: White Border glow */
.theme-picker-container .cta button.theme.active-theme {
    border: none;
    box-shadow: 0 0 0 3px #ffffff, 0 0 15px var(--glow), 0 0 5px #fff;
    transform: scale(1.1);
}

/* Remove old pseudo-elements */
.theme-picker-container .cta button.theme::after {
    display: none;
}

#green-theme {
    background: radial-gradient(circle at 30% 30%, #4dff4d, #00cc00);
    box-shadow: 0 0 10px #00cc00;
}

#dark-green-theme {
    background: radial-gradient(circle at 30% 30%, #00cc00, #006600);
    box-shadow: 0 0 10px #006600;
}

#blue-theme {
    background: radial-gradient(circle at 30% 30%, #40dfff, #00bfff);
    box-shadow: 0 0 10px #00bfff;
}

#dark-blue-theme {
    background: radial-gradient(circle at 30% 30%, #668cff, #3366ff);
    box-shadow: 0 0 10px #3366ff;
}

#red-theme {
    background: radial-gradient(circle at 30% 30%, #ff8082, #ff4d4f);
    box-shadow: 0 0 10px #ff4d4f;
}

#purple-theme {
    background: radial-gradient(circle at 30% 30%, #e6ccff, #d8b4fe);
    box-shadow: 0 0 10px #d8b4fe;
}

#yellow-theme {
    background: radial-gradient(circle at 30% 30%, #ffeb4d, #ffd700);
    box-shadow: 0 0 10px #ffd700;
}

#orange-theme {
    background: radial-gradient(circle at 30% 30%, #ffb340, #ff9000);
    box-shadow: 0 0 10px #ff9000;
}

#pink-theme {
    background: radial-gradient(circle at 30% 30%, #ff99cc, #ff69b4);
    box-shadow: 0 0 10px #ff69b4;
}

#gray-theme {
    background: radial-gradient(circle at 30% 30%, #cccccc, #a0a0a0);
    box-shadow: 0 0 10px #a0a0a0;
}

/* If active, box-shadow is overridden by active class, so we rely on var(--glow) there, 
   but we need to set --glow properly in JS. 
   Or add specific active shadows here if needed. */



/* Custom Theme Popover Styles */
.custom-theme-wrapper {
    position: relative;
    display: inline-block;
}

.theme-popover {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    left: auto;
    transform: none;
    background: rgba(20, 25, 35, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--main-color);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    min-width: 265px;
    flex-direction: column;
    gap: 12px;
}

.theme-popover.visible {
    display: flex;
}

.theme-popover .popover-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
}

.theme-popover .color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    background-color: var(--custom-theme-color, #00ff9d);
    transition: transform 0.2s ease;
}

.theme-popover .color-swatch:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.picker-anchor {
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.picker-anchor input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
}

.theme-popover .popover-actions {
    display: flex;
    gap: 10px;
}

.popover-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.popover-btn.apply {
    background: #28a745;
    /* Standard Green */
    color: #fff;
}

.popover-btn.apply:hover {
    background: #218838;
    transform: translateY(-1px);
}

.popover-btn.reset {
    background: #6c757d;
    /* Standard Grey */
    color: #fff;
}

.popover-btn.reset:hover {
    background: #5a6268;
}

/* Arrow indicator */
.theme-popover::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    left: auto;
    transform: rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(20, 25, 35, 0.95);
    border-left: 1px solid var(--main-color);
    border-top: 1px solid var(--main-color);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .theme-picker-container {
        flex-direction: column;
        gap: 10px;
    }

    .theme-picker-container>p {
        margin-right: 0;
        border-right: none;
        padding-right: 0;
        text-align: center;
        justify-content: center;
        min-width: auto;
        margin-bottom: 5px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 5px;
        width: 100%;
        height: auto;
    }

    .theme-picker-container .cta {
        flex-direction: row;
        justify-content: center;
    }

    .theme-picker-container .cta button.theme {
        width: 28px;
        min-width: 28px;
        max-width: 28px;
        height: 28px;
        min-height: 28px;
        max-height: 28px;
        /* Slightly larger for touch */
        padding: 0;
        font-size: 0;
    }
}