/* ============================================================
   ACCOUNT SCREEN + MESSAGES + MODALS
   Save as frontend/css/account.css
   ============================================================ */

/* ── Account screen ──────────────────────────────── */
.account-screen { padding-bottom: 3rem; }

.account-header {
    display: flex; align-items: center;
    justify-content: space-between; padding: 0.5rem 0 1rem;
}

.account-title {
    font-family: var(--font-display);
    font-size: 1.1rem; color: var(--cream);
}

.account-section-label {
    font-size: 0.72rem; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--amber);
    margin-bottom: 0.7rem;
}

/* ── Account info card ───────────────────────────── */
.account-card {
    background: var(--dark-card);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.account-info-row {
    display: flex; justify-content: space-between;
    align-items: baseline; gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.account-info-row:last-of-type { border-bottom: none; }

.account-info-label {
    font-size: 0.78rem; color: var(--text-dim);
    flex-shrink: 0;
}

.account-info-value {
    font-size: 0.92rem; color: var(--cream);
    text-align: right; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}

.account-actions {
    display: flex; flex-direction: column;
    gap: 0.6rem; margin-top: 1rem; padding-top: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.btn-account-action {
    width: 100%; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted); border-radius: var(--radius-sm);
    padding: 0.75rem; font-size: 0.92rem;
    text-align: left; transition: all 0.2s; touch-action: manipulation;
}

.btn-account-action:hover {
    background: rgba(255,255,255,0.09); color: var(--cream);
    border-color: rgba(255,255,255,0.18);
}

/* ── Messages ────────────────────────────────────── */
.account-messages {
    display: flex; flex-direction: column;
    gap: 0.6rem; margin-bottom: 1rem;
}

.message-card {
    background: var(--dark-card);
    border: 1px solid rgba(201,122,58,0.2);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: opacity 0.3s, transform 0.3s;
}

.message-removing {
    opacity: 0; transform: translateX(40px);
}

.message-saving {
    opacity: 0.5;
}

.message-subject {
    font-size: 0.95rem; font-weight: 500;
    color: var(--cream); margin-bottom: 0.4rem;
}

.message-body {
    font-size: 0.88rem; color: var(--text-muted);
    line-height: 1.55; margin-bottom: 0.6rem;
    white-space: pre-wrap;
}

.message-date {
    font-size: 0.72rem; color: var(--text-dim);
    margin-bottom: 0.6rem;
}

.message-actions {
    display: flex; gap: 0.5rem;
}

.btn-msg-save {
    background: rgba(155,79,26,0.15);
    border: 1px solid rgba(201,122,58,0.3);
    color: var(--amber); font-size: 0.78rem;
    padding: 0.3rem 0.8rem; border-radius: 100px;
    transition: all 0.2s; touch-action: manipulation;
}

.btn-msg-save:hover { background: rgba(155,79,26,0.28); }

.btn-msg-delete {
    background: none; border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-dim); font-size: 0.78rem;
    padding: 0.3rem 0.8rem; border-radius: 100px;
    transition: all 0.2s; touch-action: manipulation;
}

.btn-msg-delete:hover {
    border-color: rgba(192,57,43,0.35); color: #E07070;
}

/* ── Saved messages button ───────────────────────── */
.btn-saved-messages {
    width: 100%; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted); border-radius: var(--radius-md);
    padding: 0.8rem 1rem; font-size: 0.9rem;
    display: flex; align-items: center;
    justify-content: space-between;
    transition: all 0.2s; touch-action: manipulation;
    margin-bottom: 0.6rem;
}

.btn-saved-messages:hover {
    background: rgba(255,255,255,0.07); color: var(--cream);
}

/* ── Success flash ───────────────────────────────── */
.account-success-flash {
    background: rgba(107,175,122,0.12);
    border: 1px solid rgba(107,175,122,0.3);
    border-radius: var(--radius-sm);
    color: #6BAF7A; font-size: 0.88rem;
    padding: 0.7rem 1rem; text-align: center;
    margin-bottom: 0.8rem;
    animation: fadeUp 0.3s ease both;
}

/* ── Unread dot on username ──────────────────────── */
.app-username-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: var(--amber);
    color: var(--dark);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s;
    touch-action: manipulation;
}

.app-username-wrap:hover {
    background: var(--amber-glow);
}

.app-username {
    color: inherit;
}

.account-unread-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #E05050; display: none;
    position: absolute; top: -2px; right: -4px;
    box-shadow: 0 0 0 2px var(--dark-mid);
}

/* ── Modal overlay ───────────────────────────────── */
.account-modal-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,0.65);
    display: flex; align-items: flex-end;
    justify-content: center; padding: 1rem;
    opacity: 0; transition: opacity 0.2s;
}

.account-modal-overlay.account-modal-visible {
    opacity: 1;
}

.account-modal {
    width: 100%; max-width: 480px;
    background: var(--dark-mid);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px 20px 16px 16px;
    padding: 1.5rem 1.4rem 2rem;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 85vh; overflow-y: auto;
}

.account-modal-overlay.account-modal-visible .account-modal {
    transform: translateY(0);
}

.account-modal-close {
    position: absolute; top: 1rem; right: 1rem;
    background: rgba(255,255,255,0.07);
    border: none; color: var(--text-dim);
    width: 28px; height: 28px; border-radius: 50%;
    font-size: 0.85rem; display: flex;
    align-items: center; justify-content: center;
    transition: all 0.2s; touch-action: manipulation;
}

.account-modal-close:hover {
    background: rgba(255,255,255,0.12); color: var(--cream);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.1rem; color: var(--cream);
    margin-bottom: 1.2rem; padding-right: 2rem;
}

.btn-modal-save {
    width: 100%; background: var(--burnt); color: var(--cream);
    border: none; border-radius: var(--radius-md);
    padding: 0.9rem; font-size: 1rem; font-weight: 500;
    margin-top: 0.5rem; transition: background 0.2s;
    touch-action: manipulation;
}

.btn-modal-save:hover    { background: var(--amber-glow); }
.btn-modal-save:disabled { opacity: 0.6; cursor: not-allowed; }
