/* Shared settings modal styles used across home, splitter, and tutorials pages */

.settings-modal-content {
    width: 680px;
    max-width: 95vw;
    height: 550px;
    max-height: 85vh;
    padding: 0;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.dark .settings-modal-content {
    background: #1a1a1a;
    border-color: #4b5563;
}

.settings-modal-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    gap: 0.75rem;
}

.settings-modal-header .flexpromptheading,
#settings-modal-title {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.5rem;
    font-weight: 700;
}

.dark .settings-modal-header {
    border-color: #374151;
}

.settings-modal-close {
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 9999px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.settings-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.dark .settings-modal-close:hover {
    background: #374151;
    color: #fef3c7;
}

.settings-modal-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.settings-sidebar {
    width: 160px;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: #ffffff;
}

.dark .settings-sidebar {
    background: #1a1a1a;
    border-color: #374151;
}

.settings-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    margin: 0 0.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background 0.15s, color 0.15s;
    text-align: left;
}

.settings-tab-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.dark .settings-tab-btn:hover {
    background: #374151;
    color: #f9fafb;
}

.settings-tab-btn.active {
    background: #dc2626;
    color: #fff;
}

.dark .settings-tab-btn.active {
    background: #dc2626;
    color: #fff;
}

.settings-tab-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.settings-modal-body {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-tab-panel {
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.settings-tab-panel.active {
    display: flex;
}

.settings-modal-section {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    background: #ffffff;
}

.settings-modal-section h4 {
    margin: 0 0 0.1rem 0;
    font-size: 1rem;
    color: #111827;
}

.settings-modal-section p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.settings-section-copy {
    flex: 1 1 180px;
}

.settings-section-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#settings-tab-account .settings-section-actions {
    margin-left: auto;
    justify-content: flex-end;
}

.theme-toggle-icon {
    width: 20px;
    height: 20px;
}

.theme-toggle-icon-dark {
    display: none;
}

.dark .theme-toggle-icon-light {
    display: none;
}

.dark .theme-toggle-icon-dark {
    display: inline-block;
}

.settings-resource-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.settings-resource-link {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.25rem 0;
    display: inline-flex;
}

.settings-resource-link:hover {
    color: #dc2626;
}

.dark .settings-modal-section {
    background: #1a1a1a;
    border-color: #4b5563;
}

.dark .settings-modal-section h4 {
    color: #f9fafb;
}

.dark .settings-modal-section p {
    color: #9ca3af;
}

.dark .settings-resource-link {
    color: #f3f4f6;
}

.dark .settings-resource-link:hover {
    color: #f87171;
}

.settings-account-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.dark .settings-account-value {
    color: #f9fafb;
}

.settings-danger-btn {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.settings-danger-btn:hover {
    background: #b91c1c;
}

.settings-secondary-btn {
    background: #e5e7eb;
    color: #374151;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.settings-secondary-btn:hover {
    background: #d1d5db;
}

.dark .settings-secondary-btn {
    background: #374151;
    color: #f3f4f6;
}

.dark .settings-secondary-btn:hover {
    background: #4b5563;
}

/* Shared cancel-subscription modal styles (injected by account-actions.js) */
#cancel-subscription-modal {
    z-index: 1300;
}

.cancel-subscription-content {
    width: min(430px, 92vw) ;
    max-width: 430px ;
    border-radius: 1rem;
    padding: 1.5rem;
    background: #ffffff;
    text-align: center;
    border: 1px solid #e5e7eb;
    color: #000000;

}


.dark .cancel-subscription-content {
    background: #1a1a1a;
    border-color: #4b5563;
    color: #ffffff;
}

.cancel-subscription-title {
    margin-bottom: 0.8rem;
    color: #000000;
    font-family: Inter, sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 18px;
    line-height: 27px;
}

.dark .cancel-subscription-title {
    color: #ffffff;
}

.cancel-subscription-copy {
    margin: 0 auto 1.25rem;
    max-width: 330px;
    font-size: 0.86rem;
    line-height: 1.45;
    font-weight: 500;
}

.cancel-subscription-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.cancel-subscription-actions .btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.5;
    transition: background-color 0.2s;
}

.cancel-subscription-actions .btn:hover {
    filter: brightness(1.03);
}

.cancel-sub-dismiss-btn {
    background: #6b7280;
    color: #f3f4f6;
}

.cancel-sub-confirm-btn {
    background: #dc2626;
    color: #ffffff;
}

/* Shared delete-account modal styles (injected by account-actions.js) */
#delete-confirm-modal {
    z-index: 1200;
}

#delete-account-modal {
    z-index: 1300;

}

.delete-account-content {
    max-width: 150px;
}




.delete-account-content {
    width: min(430px, 92vw);
    max-width: 430px ;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;


}

.dark .delete-account-content {
    background: #1a1a1a;
    border-color: #4b5563;
}


.delete-account-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111827;
}

.dark .delete-account-title {
    color: #ffffff;
}

.delete-account-text {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 1rem;
}

.dark .delete-account-text {
    color: #d1d5db;
}

.delete-account-hint {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.dark .delete-account-hint {
    color: #d1d5db;
}

.delete-account-keyword {
    color: #dc2626;
    font-weight: 600;
}

.dark .delete-account-keyword {
    color: #f87171;
}

.delete-account-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: #ffffff;
    color: #111827;
    margin-bottom: 1rem;
}

.dark .delete-account-input {
    background-color: #374151;
    border-color: #4b5563;
    color: #ffffff;
}

.delete-account-error {
    font-size: 0.875rem;
    color: #dc2626;
    margin-bottom: 1rem;
}

.dark .delete-account-error {
    color: #f87171;
}

.delete-account-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.delete-account-cancel-btn {
    background-color: #e5e7eb;
    color: #374151;
}

.delete-account-cancel-btn:hover {
    background-color: #d1d5db;
}

.dark .delete-account-cancel-btn {
    background-color: #4b5563;
    color: #e5e7eb;
}

.dark .delete-account-cancel-btn:hover {
    background-color: #6b7280;
}

#delete-account-confirm-btn {
    background-color: #dc2626;
    color: #ffffff;
}

#delete-account-confirm-btn:hover:not(:disabled) {
    background-color: #b91c1c;
}

#delete-account-confirm-btn:disabled {
    background-color: #fca5a5;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 1;
}

.dark #delete-account-confirm-btn {
    background-color: #ef4444;
    color: #ffffff;
}

.dark #delete-account-confirm-btn:hover:not(:disabled) {
    background-color: #dc2626;
}

/* Phone settings modal: full-screen, single-column flow */
@media (max-width: 859px) {
    #settings-modal {
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
    }

    .settings-modal-content {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
    }

    .settings-modal-header {
        min-height: 72px;
        padding: 0.9rem 1rem;
        justify-content: center;
        position: relative;
    }

    .settings-modal-close {
        position: absolute;
        left: 0.85rem;
        width: 44px;
        height: 44px;
        border: 1px solid #4b5563;
        border-radius: 9999px;
        background: #1f2937;
        color: #f9fafb;
    }

    .settings-modal-close:hover {
        background: #374151;
        color: #ffffff;
    }

    .settings-modal-layout {
        display: flex;
        flex-direction: column;
    }

    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 0.55rem 0.8rem;
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: auto;
    }

    .dark .settings-sidebar {
        border-bottom-color: #374151;
    }

    .settings-tab-btn {
        margin: 0;
        flex: 1;
        min-width: 140px;
        justify-content: center;
        border-radius: 9999px;
        padding: 0.62rem 0.8rem;
    }

    .settings-modal-body {
        padding: 1rem;
        gap: 0.75rem;
    }

    .settings-modal-section {
        border-radius: 1rem;
        padding: 1rem;
    }
}

.dark #delete-account-confirm-btn:disabled {
    background-color: #7f1d1d;
    color: #ffffff;
    opacity: 1;
}
