/**
 * pages/settings.css — Settings Modal
 * Settings list UI, accordion cards, ios-switch toggle,
 * segmented-control (settings variant with white active state).
 * NOTE: This is the CANONICAL definition of .ios-switch.
 * The duplicate that existed in style.css has been removed.
 */

/* ============================================
   SETTINGS MODAL TABS (3 tabs compact)
   ============================================ */
#settings-modal .toggle-group {
    gap: 2px;
}

#settings-modal .toggle-group .toggle-btn {
    font-size: 0.78rem;
    padding: 7px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   SETTINGS CARD (Accordion container)
   ============================================ */
.setting-item {
    margin-bottom: 0;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-item label:not(.toggle-switch-wrapper) {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Accordion specifics */
details.settings-card {
    padding-bottom: 4px;
}

details.settings-card[open] summary {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

summary.setting-item {
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 24px;
}

summary.setting-item::-webkit-details-marker {
    display: none;
}

summary.setting-item::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

details[open]>summary.setting-item::after {
    transform: translateY(-50%) rotate(180deg);
}

.setting-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.8;
    margin-top: 2px;
    margin-bottom: 10px;
    display: block;
}

/* ============================================
   SETTINGS LIST (Minimalist mobile UI)
   ============================================ */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 4px;
    border-bottom: 1px solid var(--border-color);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
    padding-right: 12px;
}

.setting-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}

.setting-subtext {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.setting-control {
    flex-shrink: 0;
}

.settings-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 24px 4px 8px 4px;
}

/* ============================================
   SEGMENTED CONTROL (Settings variant)
   Uses white active state. Finance uses green variant
   (.segmented-group in finance.css).
   ============================================ */
.segmented-control {
    display: flex;
    background: var(--bg-body);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.segmented-control .segmented-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: calc(var(--radius-md) - 2px);
    transition: all 0.2s;
}

.segmented-control .segmented-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .segmented-control .segmented-btn.active {
    background: var(--bg-card);
    color: var(--primary);
}

/* ============================================
   iOS SWITCH TOGGLE
   Canonical definition — do not duplicate elsewhere.
   ============================================ */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .3s;
    border-radius: 24px;
}

.ios-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.ios-slider {
    background-color: var(--primary);
}

input:focus+.ios-slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked+.ios-slider:before {
    transform: translateX(20px);
}

/* ============================================
   ACCOUNT & SAAS ADMIN PREMIUM STYLING
   ============================================ */
.guest-banner {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.05);
}

.guest-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.1);
}

.btn-google {
    transition: all 0.2s ease;
}

.btn-google:hover {
    background: #f8f9fa !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-google:active {
    transform: translateY(0);
}

.admin-profile-card {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.admin-profile-card:hover {
    transform: scale(1.01);
}

.admin-badge {
    animation: adminBadgePulse 2s infinite ease-in-out;
}

@keyframes adminBadgePulse {
    0% {
        box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
    }

    50% {
        box-shadow: 0 2px 14px rgba(243, 156, 18, 0.5);
    }

    100% {
        box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
    }
}

.account-spinner {
    border-top: 2px solid var(--primary) !important;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Sidebar profile hover styling */
.sidebar-profile {
    transition: all 0.2s ease;
    border-radius: 12px;
}

.sidebar-profile:hover {
    background: rgba(255, 255, 255, 0.05);
}