/* ═══════════════════════════════════════════════════════════
   MyNotes — app.css
   Romantic Blue & Gold Theme ✨
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Variables ────────────────────────────────────── */
:root {
    --blue-deep:    #0f1b3d;
    --blue-dark:    #162447;
    --blue-mid:     #1f4068;
    --blue-soft:    #2a5298;
    --blue-light:   #4a8fe7;
    --blue-pale:    #c3dafe;
    --blue-ghost:   #eaf2ff;

    --gold:         #d4a843;
    --gold-light:   #e8c36a;
    --gold-pale:    #f5e6b8;
    --gold-glow:    rgba(212,168,67,.25);

    --rose:         #e8b4b8;
    --rose-soft:    #f5d5d8;

    --bg-body:      #0e1628;
    --bg-card:      #162447;
    --bg-input:     #1a2d5a;
    --text-primary: #e8eaf0;
    --text-secondary:#a0aec0;
    --text-muted:   #6b7fa3;
    --border:       rgba(212,168,67,.15);
    --border-light: rgba(255,255,255,.08);

    --shadow-card:  0 4px 24px rgba(0,0,0,.35);
    --shadow-glow:  0 0 20px rgba(74,143,231,.15);
    --radius:       14px;
    --radius-sm:    10px;
}

/* ─── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-user-select: none;
    user-select: none;
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: underline; }

::selection {
    background: var(--gold);
    color: var(--blue-deep);
}

/* ─── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--blue-dark); }
::-webkit-scrollbar-thumb {
    background: var(--blue-soft);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ─── App Container ────────────────────────────────────── */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ─── Header ───────────────────────────────────────────── */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-dark) 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,.4);
    z-index: 100;
}
.app-logo {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--gold) !important;
    text-decoration: none !important;
    text-shadow: 0 0 12px var(--gold-glow);
}
.header-right { display: flex; align-items: center; gap: 1rem; }

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: .88rem;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    transition: all .2s;
}
.nav-link:hover {
    background: rgba(212,168,67,.08);
    color: var(--gold-light) !important;
}
.nav-link.active {
    background: rgba(212,168,67,.12);
    color: var(--gold) !important;
}
.nav-icon { font-size: 1rem; }
.nav-text { font-weight: 500; }

/* Login nav button */
.btn-login-nav {
    background: var(--gold) !important;
    color: var(--blue-deep) !important;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none !important;
    transition: all .2s;
}
.btn-login-nav:hover {
    background: var(--gold-light) !important;
    box-shadow: 0 0 14px var(--gold-glow);
}

/* Logout / Panic Button */
.inline-form { display: inline; }
.panic-btn {
    background: transparent;
    border: 1px solid rgba(232,180,184,.3);
    color: var(--rose);
    padding: 0.35rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all .2s;
}
.panic-btn:hover {
    background: rgba(232,75,75,.12);
    border-color: rgba(232,75,75,.4);
    color: #ff7b7b;
    box-shadow: 0 0 10px rgba(232,75,75,.1);
}

/* ─── Main ─────────────────────────────────────────────── */
.app-main {
    flex: 1;
    overflow-y: auto;
}

/* ─── Auth Pages ───────────────────────────────────────── */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: linear-gradient(160deg, #0a1020 0%, #0f1b3d 30%, #162447 60%, #1a2d5a 100%);
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-card), 0 0 40px rgba(74,143,231,.05);
}
.auth-card-wide {
    max-width: 600px;
}
.auth-title {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: .3rem;
    color: var(--gold);
    text-shadow: 0 0 16px var(--gold-glow);
}
.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: .95rem;
}
.auth-link {
    text-align: center;
    margin-top: 1.2rem;
    font-size: .9rem;
    color: var(--text-muted);
}

/* ─── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: .3rem;
    font-weight: 500;
    font-size: .9rem;
    color: var(--gold-pale);
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid rgba(212,168,67,.2);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    transition: all .25s;
    background: var(--bg-input);
    color: var(--text-primary);
    user-select: text;
    -webkit-user-select: text;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(26,45,90,.8);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

.form-hint {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .2rem;
    display: block;
}

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .93rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}
.btn-primary {
    background: var(--gold);
    color: var(--blue-deep);
    font-weight: 600;
}
.btn-primary:hover {
    background: var(--gold-light);
    box-shadow: 0 0 16px var(--gold-glow);
}
.btn-secondary {
    background: var(--blue-mid);
    color: var(--text-secondary);
}
.btn-secondary:hover {
    background: var(--blue-soft);
    color: var(--text-primary);
}
.btn-full { width: 100%; }
.btn-small { padding: 0.3rem 0.7rem; font-size: .8rem; }
.btn-send { padding: 0.5rem 1rem; border-radius: var(--radius-sm); }

/* ─── Alerts ───────────────────────────────────────────── */
.alert {
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: .9rem;
}
.alert-error {
    background: rgba(192,57,43,.15);
    color: #ff8a8a;
    border: 1px solid rgba(192,57,43,.3);
}
.alert-success {
    background: rgba(39,174,96,.12);
    color: #6ee7a0;
    border: 1px solid rgba(39,174,96,.25);
}

/* ─── Divider ──────────────────────────────────────────── */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* ─── Hint ─────────────────────────────────────────────── */
.hint {
    color: var(--text-muted);
    font-size: .85rem;
    margin-bottom: .8rem;
}

/* ─── Image Grid (Challenge) ───────────────────────────── */
.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.image-choice { cursor: pointer; }
.image-choice input[type="checkbox"] { display: none; }
.image-box {
    border: 2.5px solid rgba(212,168,67,.2);
    border-radius: var(--radius-sm);
    padding: 1.2rem 0.5rem;
    text-align: center;
    transition: all .2s;
    position: relative;
    background: var(--bg-input);
}
.image-choice:hover .image-box {
    border-color: rgba(212,168,67,.4);
    background: rgba(212,168,67,.05);
}
.image-choice.selected .image-box {
    border-color: var(--gold);
    background: rgba(212,168,67,.1);
    box-shadow: 0 0 12px var(--gold-glow);
}
.image-label { font-size: .85rem; color: var(--text-secondary); }
.image-order {
    position: absolute;
    top: 4px; right: 6px;
    background: var(--gold);
    color: var(--blue-deep);
    width: 20px; height: 20px;
    border-radius: 50%;
    font-size: .7rem;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.image-order:empty { display: none; }
.challenge-section { margin-bottom: 1.5rem; }
.challenge-section h3 {
    font-size: 1rem;
    margin-bottom: .5rem;
    color: var(--gold-pale);
}

/* ═══════════════════════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════════════════════ */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}
.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}
.about-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.about-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.about-hero h1 {
    font-size: 1.8rem;
    color: var(--gold);
    text-shadow: 0 0 16px var(--gold-glow);
    margin-bottom: .3rem;
}
.about-tagline {
    color: var(--text-secondary);
    font-size: .95rem;
    font-style: italic;
}
.about-section { margin-bottom: 1.8rem; }
.about-section h2 {
    font-size: 1.2rem;
    margin-bottom: .7rem;
    color: var(--gold-light);
}
.about-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.feature-item {
    background: rgba(74,143,231,.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    transition: all .2s;
}
.feature-item:hover {
    border-color: var(--gold);
    box-shadow: 0 0 16px var(--gold-glow);
    transform: translateY(-2px);
}
.feature-icon { font-size: 1.8rem; display: block; margin-bottom: 0.5rem; }
.feature-item h3 { font-size: .95rem; margin-bottom: .3rem; color: var(--gold-pale); }
.feature-item p { font-size: .82rem; color: var(--text-muted); }

/* ─── Announcements Page ──────────────────────────────── */
.announcements-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}
.announcements-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.announcements-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.announcements-hero h1 {
    font-size: 1.8rem;
    color: var(--gold);
    text-shadow: 0 0 16px var(--gold-glow);
    margin-bottom: .3rem;
}
.announcements-tagline {
    color: var(--text-secondary);
    font-size: .95rem;
    font-style: italic;
}
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.announcement-item {
    background: rgba(74,143,231,.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.4rem;
    transition: all .2s;
    animation: fadeInUp .3s ease-out;
}
.announcement-item:hover {
    border-color: rgba(212,168,67,.25);
    box-shadow: 0 0 12px var(--gold-glow);
}
.announcement-item.pinned {
    border-color: rgba(212,168,67,.3);
    background: rgba(212,168,67,.05);
}
.announcement-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}
.announcement-title {
    font-size: 1.1rem;
    color: var(--gold-pale);
    font-weight: 600;
    flex: 1;
}
.pin-badge { font-size: .9rem; }
.announcement-date {
    font-size: .78rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.announcement-content {
    font-size: .93rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0.6rem;
}
.announcement-footer {
    text-align: right;
}
.announcement-author {
    font-size: .82rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ─── Contact Page ─────────────────────────────────────── */
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}
.contact-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.contact-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.contact-hero h1 {
    font-size: 1.8rem;
    color: var(--gold);
    text-shadow: 0 0 16px var(--gold-glow);
    margin-bottom: .3rem;
}
.contact-tagline { color: var(--text-secondary); font-size: .95rem; }
.contact-form .form-group { margin-bottom: 1.2rem; }

/* ═══════════════════════════════════════════════════════════
   WALL PAGE
   ═══════════════════════════════════════════════════════════ */

.wall-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Post form */
.wall-create-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}
.wall-create-inner textarea {
    width: 100%;
    border: none;
    resize: none;
    font-size: .95rem;
    padding: 0.5rem 0;
    background: transparent;
    color: var(--text-primary);
    user-select: text;
    -webkit-user-select: text;
}
.wall-create-inner textarea:focus { outline: none; }
.wall-create-inner textarea::placeholder { color: var(--text-muted); }

.wall-create-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}
.file-upload-btn {
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: .85rem;
    color: var(--gold);
    background: rgba(212,168,67,.1);
    transition: all .2s;
    white-space: nowrap;
}
.file-upload-btn:hover {
    background: rgba(212,168,67,.18);
    box-shadow: 0 0 10px var(--gold-glow);
}
.file-name-display {
    font-size: .8rem;
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-send-post {
    margin-left: auto;
    padding: 0.45rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: .88rem;
}

/* Image preview */
.image-preview-container {
    margin-top: 0.8rem;
    position: relative;
    display: inline-block;
}
.image-preview {
    max-height: 200px;
    max-width: 100%;
    border-radius: var(--radius-sm);
    object-fit: cover;
}
.remove-image-btn {
    position: absolute;
    top: 6px; right: 6px;
    width: 28px; height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: .9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.remove-image-btn:hover { background: rgba(232,75,75,.6); }

/* Login prompt */
.wall-login-prompt {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}
.wall-login-prompt p { color: var(--text-secondary); font-size: .95rem; }

/* Post cards */
.wall-post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-card);
    animation: fadeInUp .3s ease-out;
    transition: border-color .2s, transform .2s;
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.wall-post-card:hover {
    border-color: rgba(212,168,67,.35);
    transform: translateY(-2px);
}
.wall-post-readmore {
    font-size: .82rem;
    color: var(--gold);
    margin-top: 0.7rem;
    font-weight: 500;
}
.wall-post-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
}
.wall-post-avatar {
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    background: var(--blue-mid);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wall-post-meta {
    font-size: .82rem;
    color: var(--text-muted);
}
.wall-post-text {
    font-size: .95rem;
    color: var(--text-secondary);
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0.5rem;
    user-select: text;
    -webkit-user-select: text;
}
.wall-post-image {
    margin-top: 0.5rem;
    border-radius: 12px;
    overflow: hidden;
}
.wall-post-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

/* Wall Detail Page */
.wall-detail-page {
    max-width: 750px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}
.wall-detail-back {
    margin-bottom: 1.2rem;
}
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--gold);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 500;
    padding: .5rem .8rem;
    border-radius: var(--radius);
    transition: background .2s, color .2s;
}
.btn-back:hover {
    background: rgba(212,168,67,.1);
    color: var(--gold-hover);
}
.wall-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2rem;
    box-shadow: var(--shadow-card);
    animation: fadeInUp .3s ease-out;
}
.wall-detail-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.wall-detail-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 1rem;
    user-select: text;
    -webkit-user-select: text;
}
.wall-detail-image {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
}
.wall-detail-image img {
    width: 100%;
    max-height: 700px;
    object-fit: contain;
    display: block;
    border-radius: 12px;
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--blue-mid);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   CHAT LAYOUT
   ═══════════════════════════════════════════════════════════ */

.chat-layout {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* Chat Main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-body);
}
.chat-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1.2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.chat-title {
    font-weight: 600;
    font-size: .95rem;
    color: var(--gold-pale);
    flex: 1;
}

/* Clear Messages Button */
.btn-clear-messages {
    background: rgba(232,75,75,.1);
    border: 1px solid rgba(232,75,75,.25);
    color: var(--rose);
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: .82rem;
    transition: all .2s;
    white-space: nowrap;
}
.btn-clear-messages:hover {
    background: rgba(232,75,75,.2);
    border-color: rgba(232,75,75,.45);
    color: #ff7b7b;
    box-shadow: 0 0 10px rgba(232,75,75,.15);
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: linear-gradient(180deg, rgba(15,27,61,.6) 0%, rgba(14,22,40,1) 100%);
}
.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    font-size: .95rem;
}
.empty-state a { color: var(--gold-light); }

/* Message Bubbles */
.message {
    max-width: 70%;
    padding: 0.65rem 1rem;
    border-radius: 16px;
    font-size: .93rem;
    line-height: 1.5;
    position: relative;
    animation: fadeIn .2s;
    word-break: break-word;
    user-select: text;
    -webkit-user-select: text;
}
.message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--blue-soft) 0%, var(--blue-light) 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(42,82,152,.3);
}
.message.received {
    align-self: flex-start;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.message .msg-time {
    font-size: .7rem;
    opacity: .6;
    margin-top: 2px;
    display: block;
}
.message .msg-timer {
    font-size: .7rem;
    opacity: .5;
    margin-left: .5rem;
}

.message.fading { animation: fadeOut .5s forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: scale(.95); }
}

/* Message Input */
.message-input-area {
    padding: 0.7rem 1rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}
.input-row {
    display: flex;
    gap: 0.5rem;
}
.input-row input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1.5px solid rgba(212,168,67,.2);
    border-radius: 22px;
    font-size: .93rem;
    background: var(--bg-input);
    color: var(--text-primary);
    user-select: text;
    -webkit-user-select: text;
    transition: all .25s;
}
.input-row input::placeholder { color: var(--text-muted); }
.input-row input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(26,45,90,.8);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

/* ─── Right Panel ──────────────────────────────────────── */
.right-panel {
    width: 280px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Users Panel */
.users-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.users-header {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
}
.users-header h3 {
    font-size: .95rem;
    font-weight: 600;
    color: var(--gold-pale);
}
.user-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding: 0.4rem;
}
.user-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s;
}
.user-item:hover {
    background: rgba(212,168,67,.06);
}
.user-item.active {
    background: rgba(212,168,67,.12);
    border: 1px solid rgba(212,168,67,.2);
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-soft), var(--gold));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .9rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.user-name {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-loading, .user-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .88rem;
}

/* Conv Wall Panel */
.conv-wall-panel {
    border-top: 1px solid var(--border);
}
.conv-wall-panel .wall-header {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
}
.conv-wall-panel .wall-header h3 {
    font-size: .92rem;
    font-weight: 600;
    color: var(--gold-pale);
}
.conv-wall-panel .wall-content {
    padding: 0.8rem 1rem;
}
.wall-text {
    font-size: .88rem;
    color: var(--text-secondary);
    min-height: 30px;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: text;
    -webkit-user-select: text;
}
.wall-edit textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1.5px solid rgba(212,168,67,.2);
    border-radius: 8px;
    resize: vertical;
    font-size: .88rem;
    background: var(--bg-input);
    color: var(--text-primary);
    user-select: text;
    -webkit-user-select: text;
}
.wall-edit textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.wall-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

/* ─── Conversation List ────────────────────────────────── */
.chat-list-container { padding: 2rem; max-width: 500px; margin: 0 auto; }
.chat-list-container h2 { margin-bottom: 1rem; color: var(--gold-pale); }
.conversation-list { list-style: none; margin-bottom: 1.5rem; }
.conversation-list li { margin-bottom: 0.5rem; }
.conv-link {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.8rem 1rem; background: var(--bg-card); border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: 0 1px 6px rgba(0,0,0,.1); transition: all .2s;
}
.conv-link:hover {
    background: rgba(212,168,67,.06);
    border-color: rgba(212,168,67,.25);
    text-decoration: none;
}
.conv-users { font-weight: 500; color: var(--text-primary); }
.conv-date { color: var(--text-muted); font-size: .8rem; }

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .app-header {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem 0.8rem;
        gap: 0.3rem;
    }
    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 0.15rem;
        padding-top: 0.3rem;
        border-top: 1px solid rgba(212,168,67,.1);
    }
    .nav-link {
        padding: 0.35rem 0.6rem;
        font-size: .8rem;
    }
    .nav-text { display: none; }
    .nav-icon { font-size: 1.1rem; }

    .chat-layout {
        flex-direction: column;
    }
    .right-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        max-height: 250px;
    }
    .message { max-width: 85%; }

    .feature-grid { grid-template-columns: 1fr; }

    .about-card, .contact-card { padding: 1.5rem; }
    .form-row { flex-direction: column; gap: 0; }

    .auth-card, .auth-card-wide { max-width: 100%; }

    .page-container { padding: 1rem 0.8rem; }
    .wall-page { padding: 1rem 0.5rem; }
}

@media (max-width: 480px) {
    .app-logo { font-size: 1rem; }
    .about-hero h1 { font-size: 1.5rem; }
    .wall-create-card { padding: 1rem; }
}

/* ─── Secure mode ──────────────────────────────────────── */
body.secure-mode {
    -webkit-touch-callout: none;
}
