/* ═══════════════════════════════════════════════════════════════════
   Settings Modal — matches notification modal aesthetic
   ═══════════════════════════════════════════════════════════════════ */

/* ── Account Dropdown ─────────────────────────────────────────────── */
.account-dropdown-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.account-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
    border: none;
    font: inherit;
}

.account-dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.account-dropdown-trigger .material-icons:last-child {
    font-size: 18px;
    transition: transform 0.2s;
}

.account-dropdown-wrapper.open .account-dropdown-trigger .material-icons:last-child {
    transform: rotate(180deg);
}

.account-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.account-dropdown-wrapper.open .account-dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.account-dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
}

.account-dropdown-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.account-dropdown-menu-item .material-icons {
    font-size: 20px;
    color: #888;
    transition: color 0.15s;
}

.account-dropdown-menu-item:hover .material-icons {
    color: #f5a623;
}

.account-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

.account-dropdown-menu-item.logout-item:hover {
    background: rgba(244, 67, 54, 0.08);
    color: #F44336;
}

.account-dropdown-menu-item.logout-item:hover .material-icons {
    color: #F44336;
}

/* ── Settings Modal Overlay ───────────────────────────────────────── */
.settings-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.settings-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Settings Modal Container ─────────────────────────────────────── */
.settings-modal {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    width: 700px;
    height: 580px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(10px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.settings-modal-overlay.active .settings-modal {
    transform: scale(1) translateY(0);
}

/* ── Header ───────────────────────────────────────────────────────── */
.settings-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.settings-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.settings-close-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* ── Body Layout (sidebar + content) ──────────────────────────────── */
.settings-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 380px;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.settings-sidebar {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #aaa;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.settings-sidebar-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.settings-sidebar-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid #f5a623;
    padding-left: 17px;
}

.settings-sidebar-item .material-icons {
    font-size: 20px;
}

/* ── Content Area ─────────────────────────────────────────────────── */
.settings-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.settings-content::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-track {
    background: transparent;
}

.settings-content::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.settings-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
}

/* ── Category Header ──────────────────────────────────────────────── */
.settings-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #f5a623;
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-category:first-of-type {
    margin-top: 0;
}

/* ── Setting Row ──────────────────────────────────────────────────── */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    margin-right: 16px;
}

.settings-row-label {
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
}

.settings-row-description {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

/* ── Toggle Switch ────────────────────────────────────────────────── */
.settings-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.settings-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-toggle-slider {
    position: absolute;
    inset: 0;
    background: #444;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.settings-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.settings-toggle input:checked + .settings-toggle-slider {
    background: #2bbb8a;
}

.settings-toggle input:checked + .settings-toggle-slider::before {
    transform: translateX(20px);
}


/* ── Action Buttons (Privacy tab) ─────────────────────────────────── */
.settings-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #ccc;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-family: inherit;
    flex-shrink: 0;
}

.settings-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.settings-action-btn .material-icons {
    font-size: 16px;
}

.settings-action-btn.danger {
    border-color: rgba(244, 67, 54, 0.3);
    color: #F44336;
}

.settings-action-btn.danger:hover {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.5);
}

/* ── Toast/Feedback ───────────────────────────────────────────────── */
.settings-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2bbb8a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10010;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.settings-toast.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Mobile Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
    .settings-modal {
        width: 100%;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .settings-body {
        flex-direction: column;
        min-height: auto;
    }

    .settings-sidebar {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 8px;
        overflow-x: auto;
        gap: 0;
    }

    .settings-sidebar-item {
        padding: 8px 14px;
        white-space: nowrap;
        font-size: 13px;
    }

    .settings-sidebar-item.active {
        border-left: none;
        border-bottom: 2px solid #f5a623;
        padding-left: 14px;
        border-radius: 0;
    }

    .settings-content {
        padding: 16px;
        max-height: 60vh;
    }

    .settings-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .settings-row-info {
        margin-right: 0;
    }

    .account-dropdown-menu {
        right: -20px;
        min-width: 180px;
    }
}

/* ── Animations ──────────────────────────────────────────────────── */
.settings-action-btn .material-icons.rotating {
    animation: settings-rotate 2s linear infinite;
    font-size: 18px;
}

@keyframes settings-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Account Tab Special Styles ──────────────────────────────────── */
.settings-loader-container {
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #888;
    font-size: 14px;
}

.settings-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-info-label {
    font-size: 13px;
    color: #888;
}

.settings-info-value {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.plan-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-free { background: #444; color: #ccc; }
.plan-pro { background: rgba(245, 166, 35, 0.2); color: #f5a623; border: 1px solid rgba(245, 166, 35, 0.3); }
.plan-lifetime { background: rgba(139, 92, 246, 0.2); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }

.settings-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ddd;
    background: rgba(255, 255, 255, 0.06);
    text-transform: uppercase;
}

.settings-status-badge .material-icons {
    font-size: 16px;
}

.settings-status-badge.is-connected {
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

.settings-status-badge.is-disconnected {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
}

.danger-text {
    color: #F44336 !important;
}

.settings-row.no-border {
    border-bottom: none;
}

/* ── Deletion Confirmation Modal ─────────────────────────────────── */
.deletion-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10005;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.deletion-confirm-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.deletion-confirm-modal {
    background: #1a1a1a;
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 16px;
    padding: 32px;
    width: 400px;
    max-width: 90vw;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
}

.deletion-confirm-overlay.active .deletion-confirm-modal {
    transform: scale(1) translateY(0);
}

.danger-icon {
    font-size: 48px;
    color: #F44336;
    margin-bottom: 16px;
}

.deletion-confirm-modal h3 {
    margin: 0 0 12px 0;
    color: #fff;
    font-size: 20px;
}

.deletion-confirm-modal p {
    margin: 0 0 24px 0;
    color: #aaa;
    font-size: 14px;
    line-height: 1.5;
}

.deletion-confirm-modal strong {
    color: #F44336;
}

.deletion-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.deletion-actions .settings-action-btn {
    min-width: 120px;
    justify-content: center;
}
