/* ===================== LIFETRACKER MEMBERSHIP ===================== */
/* Overrides the default LifeJournal style for /lifetracker/membership */
/* Mirrors the LifeTracker landing page design: purple accent, dark mode, modern cards */

/* ===================== VARIABLES ===================== */
:root {
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-light: rgba(124, 58, 237, 0.2);
    --text-primary: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #888;
    --bg-dark: #1a1a2e;

    --bg-body: #fff;
    --bg-surface: #f8f9fb;
    --bg-card: #fff;
    --bg-input: #f4f4f4;
    --border-color: #e8e8e8;
    --border-light: #eee;
    --nav-bg: rgba(255,255,255,0.95);
    --shadow-card: 0 6px 20px rgba(0,0,0,0.08);
    --footer-text: #aaa;
    --link-color: #7c3aed;
}

[data-theme="dark"] {
    --accent: #a78bfa;
    --accent-hover: #8b5cf6;
    --accent-light: rgba(167, 139, 250, 0.2);
    --text-primary: #e8e8f0;
    --text-secondary: #aaa;
    --text-muted: #777;
    --bg-dark: #0f0f1a;

    --bg-body: #111118;
    --bg-surface: #1a1a24;
    --bg-card: #1e1e2a;
    --bg-input: #252530;
    --border-color: #2a2a3a;
    --border-light: #222233;
    --nav-bg: rgba(17,17,24,0.95);
    --shadow-card: 0 6px 20px rgba(0,0,0,0.3);
    --footer-text: #777;
    --link-color: #a78bfa;
}


/* ===================== RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#content {
    flex: 1;
}

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }


/* ===================== NAV ===================== */
.lt-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
}

.lt-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.lt-nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.lt-nav-logo img {
    height: 60px;
    border-radius: 8px;
}

.lt-nav-logo span {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.lt-nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 0.95rem;
    font-weight: 500;
}

.lt-nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

.lt-nav-links a:hover { color: var(--accent); text-decoration: none; }

.lt-btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--accent);
    color: #fff !important;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s;
}

.lt-btn-nav:hover { background: var(--accent-hover); }

.lt-theme-toggle {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
}

.lt-theme-toggle:hover { color: var(--accent); }


/* ===================== CONTENT ===================== */
#content {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

#content h1 {
    font-size: 2rem;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

#content h2 {
    font-size: 1.5rem;
    margin-top: 48px;
    margin-bottom: 16px;
}

#content h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

#content p {
    margin-bottom: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

#warning p {
    color: inherit;
}

#content p strong {
    color: var(--text-primary);
    font-size: 1.05rem;
    display: block;
    margin-top: 32px;
    margin-bottom: 4px;
}

#content ul, #content ol {
    padding-left: 20px;
    margin-bottom: 16px;
}

#content li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Prose content (privacy, etc.) — restore list bullets */
.lt-prose ul {
    list-style: disc;
    padding-left: 24px;
}

.lt-prose ul ul {
    list-style: circle;
}

.lt-prose li {
    margin-bottom: 10px;
}


/* ===================== BUTTONS ===================== */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: background 0.2s, transform 0.15s;
    height: auto;
    font-family: inherit;
}

button:hover, .btn:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

.btn-primary, .btn-block {
    background: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
}

.btn-primary:hover, .btn-block:hover {
    background: var(--accent-hover) !important;
}

.fullWidth { width: 100%; }


/* ===================== FORMS (login/register) ===================== */
.form-signin, .registerForm, .loginForm {
    max-width: 400px;
    padding: 32px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    animation: lt-fade-in 0.35s ease;
}

@keyframes lt-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-signin h2, .registerForm h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    margin-top: 0;
    text-align: center;
}

.form-signin label, .registerForm label, .daimao-form label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

.form-control, #content input[type="text"], #content input[type="password"], #content input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text-primary);
    height: auto;
    margin-bottom: 12px;
    font-family: inherit;
}

.form-control:focus, #content input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.input-group {
    margin-bottom: 12px;
}

#login-feedback {
    color: #ef4444 !important;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.daimao-form .row {
    margin-top: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.daimao-form .row label {
    flex: 1;
    margin-right: 5px;
}


/* ===================== MEMBERSHIP ROWS ===================== */
.membership-row {
    padding: 24px;
    margin-bottom: 24px;
    cursor: pointer;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.membership-row:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--accent-light);
    background: var(--bg-card);
    color: var(--text-primary);
}

.membership-row.no-pointer {
    cursor: default;
}

.membership-row.no-pointer:hover {
    border-color: var(--border-color);
    box-shadow: none;
}

.membership-row h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.membership-row.with-price {
    display: flex;
    align-items: center;
    gap: 16px;
}

.membership-row.with-price .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-left: auto;
    white-space: nowrap;
}


/* ===================== TRIAL BLOCKS ===================== */
.big-trial-block {
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    margin-bottom: 24px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.big-trial-block:hover {
    border-color: var(--accent);
}

.big-trial-block .membership-row {
    margin-bottom: 0;
    border: none;
    border-radius: 0;
}

.trial-row {
    background: var(--accent-light);
    padding: 16px 24px;
}

.trial-header {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--accent);
}

.big-trial-block:hover .trial-row {
    background: var(--accent-light);
}

.big-trial-block:hover .membership-row {
    background: var(--bg-card);
    color: var(--text-primary);
}


/* ===================== NOTIFICATIONS ===================== */
.notification {
    padding: 16px 20px;
    margin: 16px 0;
    border: 1px solid var(--accent);
    background: var(--accent-light);
    border-radius: 10px;
    font-weight: 500;
}

.notification.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.notification.neutral {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}


/* ===================== DB LIST ===================== */
#db-list > div {
    margin: 12px 0;
}

#db-list button {
    display: inline-flex;
    height: auto;
    font-weight: 500;
    padding: 6px 14px;
    font-size: 0.85rem;
}

.db-entry {
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 8px;
}


/* ===================== FAQ ===================== */
.question {
    font-weight: 600;
    margin-top: 24px;
    color: var(--text-primary);
}

.answer {
    margin-top: 8px;
    margin-bottom: 24px;
    color: var(--text-secondary);
    line-height: 1.6;
}


/* ===================== MODAL ===================== */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    inset: 0;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 480px;
    margin: auto;
    box-shadow: var(--shadow-card);
}

.modal .close {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    background: none;
    border: none;
    line-height: 1;
}

.modal .close:hover { color: var(--text-primary); }

#share-with-user-feedback {
    padding: 12px 16px;
    color: #ef4444;
    background: rgba(239,68,68,0.1);
    border-radius: 8px;
    margin-bottom: 12px;
    display: none;
    font-size: 0.9rem;
}


/* ===================== USER BAR (logout) ===================== */
/* Move logout button into the sticky nav bar */
#content > div[style*="position:absolute"] {
    position: fixed !important;
    top: 0 !important;
    right: 60px !important;
    margin-right: 0 !important;
    z-index: 150;
    height: 60px;
    display: flex;
    align-items: center;
}

#content > div[style*="position:absolute"] a {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none !important;
}

#content > div[style*="position:absolute"] a:hover {
    color: var(--accent) !important;
}


/* ===================== SPINNER ===================== */
.lt-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: lt-spin 0.7s linear infinite;
    margin: 20px auto;
}

@keyframes lt-spin {
    to { transform: rotate(360deg); }
}

/* Replace GIF throbber with CSS spinner */
#loading-block-login img,
#loading-block img,
.loading-block img {
    display: none;
}

#loading-block-login::after,
#loading-block::after,
.loading-block::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: lt-spin 0.7s linear infinite;
    margin: 20px auto;
}


/* ===================== LISTS ===================== */
ul {
    list-style: none;
    padding: 0;
}

ul li {
    margin: 8px 0;
    padding: 0;
}

.active-shares li {
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* ===================== FOOTER ===================== */
.lt-footer {
    background: var(--bg-dark);
    color: var(--footer-text);
    padding: 32px 0;
}

.lt-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lt-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lt-footer-brand strong {
    color: #fff;
    font-size: 1.1rem;
}

.lt-footer-brand a {
    color: var(--accent);
}

.lt-footer-links {
    display: flex;
    gap: 24px;
}

.lt-footer-links a {
    color: var(--footer-text);
    text-decoration: none;
}

.lt-footer-links a:hover { color: #fff; }


/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .lt-nav-links {
        display: none;
    }

    #content {
        padding: 24px 16px 60px;
    }

    .membership-row.with-price {
        flex-direction: column;
        align-items: flex-start;
    }

    .membership-row.with-price .price {
        margin-left: 0;
    }

    .lt-footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .form-signin, .registerForm, .loginForm {
        padding: 24px 16px;
    }
}
