/* public/css/settings.css */
:root {
    --apple-blue: #007AFF;
    --medium-gray: #E5E5EA;
}

#settings-container {
    position: relative;
    display: inline-block;
}

#settings-popover {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    width: 260px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 60;
    transform-origin: top center;
    transition: 
        transform 200ms cubic-bezier(0.16, 1, 0.3, 1), 
        opacity 200ms cubic-bezier(0.16, 1, 0.3, 1),
        visibility 200ms;
    opacity: 0;
    visibility: hidden;
}

#settings-popover.is-open {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Triangle Arrow */
#settings-popover::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: white;
    border-left: 1px solid rgba(0,0,0,0.08);
    border-top: 1px solid rgba(0,0,0,0.08);
    z-index: -1;
}

.segmented-control {
    display: flex;
    background-color: var(--medium-gray);
    border-radius: 0.5rem;
    padding: 3px;
}

.segmented-control button {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.segmented-control button.active {
    background-color: white;
    color: black;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}

/* Responsive: Only align right on actual mobile devices (<640px) */
@media (max-width: 640px) {
    #settings-popover {
        left: auto;
        right: -10px; /* Pull slightly right to align with screen edge */
        transform: scale(0.95);
        transform-origin: top right;
        max-width: calc(100vw - 20px);
    }
    #settings-popover.is-open {
        transform: scale(1);
    }
    #settings-popover::before {
        left: auto;
        right: 24px; /* Move arrow to align with the cog button on mobile */
        transform: rotate(45deg);
    }
}
