@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Bebas+Neue&family=JetBrains+Mono:wght@400;500&display=swap');

/* ======== CSS VARIABLES ======== */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-hover: #1e1e1e;
    --border: #2a2a2a;
    --border-hover: #3a3a3a;
    --accent: #cc0000;
    --accent-hover: #ff1a1a;
    --accent-muted: rgba(204,0,0,0.15);
    --accent-glow: rgba(204,0,0,0.3);
    --text-primary: #f0f0f0;
    --text-secondary: #888;
    --text-muted: #555;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow: 0 4px 20px rgba(0,0,0,0.6);
    --shadow-accent: 0 4px 20px rgba(204,0,0,0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --nav-height: 64px;
    --bottom-nav: 65px;
    --font-display: 'Bebas Neue', cursive;
    --font-body: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: 0.2s ease;
}

body.light-mode {
    --bg-primary: #f0f4ff;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #e8edf8;
    --border: #d0d9f0;
    --border-hover: #b0bcdf;
    --accent: #1a56db;
    --accent-hover: #1343b5;
    --accent-muted: rgba(26,86,219,0.1);
    --accent-glow: rgba(26,86,219,0.25);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow: 0 4px 20px rgba(0,0,50,0.1);
    --shadow-accent: 0 4px 20px rgba(26,86,219,0.2);
}

/* ======== RESET & BASE ======== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: var(--font-body); border: none; outline: none; }
input, textarea, select { font-family: var(--font-body); outline: none; }

/* ======== SCROLLBAR ======== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ======== TYPOGRAPHY ======== */
.display-font { font-family: var(--font-display); letter-spacing: 1px; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; }

/* ======== LAYOUT ======== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 100;
    transition: all 0.3s ease;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    max-width: calc(100vw - 260px);
}

.content-area {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 16px 100px;
}

/* ======== LOGO ======== */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    padding: 8px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.logo-text span { color: var(--accent); }

/* ======== NAV ======== */
.nav-menu { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: all var(--transition);
    position: relative;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-muted);
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.nav-icon { font-size: 18px; width: 20px; text-align: center; }

/* ======== THEME TOGGLE ======== */
.theme-toggle-wrap {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.theme-toggle:hover { border-color: var(--accent); color: var(--text-primary); }

.toggle-switch {
    width: 36px; height: 20px;
    background: var(--border);
    border-radius: 10px;
    position: relative;
    transition: background 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

body.light-mode .toggle-switch { background: var(--accent); }
body.light-mode .toggle-switch::after { transform: translateX(16px); }

/* ======== CARDS ======== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.card:hover { border-color: var(--border-hover); }

/* ======== POST CARD ======== */
.post-card {
    padding: 20px;
    margin-bottom: 16px;
    animation: fadeUp 0.3s ease forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
    background: var(--accent-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--accent);
    overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.post-meta { flex: 1; min-width: 0; }
.post-author { font-weight: 600; font-size: 15px; }
.post-author span { color: var(--text-muted); font-weight: 400; font-size: 13px; }
.post-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.startup-badge {
    font-size: 11px;
    background: var(--accent-muted);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
    display: inline-block;
    margin-top: 3px;
}

.post-content {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 12px;
    word-break: break-word;
    white-space: normal;  /* explicitly normal set karo */
}

.post-content br {
    display: block;
    margin-bottom: 0;
    line-height: 0.5;  /* br ka gap compress karo */
    content: "";
}
.post-image {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.post-actions {
    display: flex;
    gap: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.action-btn.liked { color: var(--accent); }
.action-btn.liked .action-icon { animation: heartbeat 0.3s ease; }

@keyframes heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ======== COMMENTS ======== */
.comments-section { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; display: none; }
.comments-section.open { display: block; }

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.comment-avatar { width: 32px; height: 32px; font-size: 13px; }
.comment-body { flex: 1; }
.comment-author { font-size: 13px; font-weight: 600; }
.comment-text { font-size: 13px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }
.comment-time { font-size: 11px; color: var(--text-muted); }

.comment-form {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.comment-input {
    flex: 1;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-primary);
    transition: border var(--transition);
}

.comment-input:focus { border-color: var(--accent); }
.comment-input::placeholder { color: var(--text-muted); }

/* ======== FORMS ======== */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 100px; }

/* ======== BUTTONS ======== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-full { width: 100%; }

/* ======== MODALS ======== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title { font-size: 20px; font-weight: 700; }

.modal-close {
    width: 32px; height: 32px;
    background: var(--bg-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 18px;
    transition: all var(--transition);
}

.modal-close:hover { background: var(--accent-muted); color: var(--accent); }

/* ======== BOTTOM NAV (Mobile) ======== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 0 4px 4px;
    align-items: center;
    justify-content: space-around;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
 
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: all var(--transition);
    min-width: 52px;
}
 
.bottom-nav-item:hover, .bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item .nav-icon { font-size: 20px; }
 
.bottom-nav-item.add-btn {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 50%, #990000 100%);
    color: white;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    min-width: 56px;
    padding: 0;
    font-size: 0;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(204,0,0,0.55), 0 0 0 3px rgba(204,0,0,0.18);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
    border: 2px solid rgba(255,100,100,0.35);
}
 
.bottom-nav-item.add-btn::before {
    content: '+';
    font-size: 30px;
    font-weight: 300;
    line-height: 1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
 
.bottom-nav-item.add-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,80,80,0.25), transparent 60%);
    pointer-events: none;
}
 
.bottom-nav-item.add-btn:hover {
    transform: scale(1.12) translateY(-2px);
    box-shadow: 0 8px 28px rgba(204,0,0,0.7), 0 0 0 5px rgba(204,0,0,0.15);
}
 
.bottom-nav-item.add-btn:active {
    transform: scale(0.96);
}

/* ======== PAGE HEADER ======== */
.page-header {
    padding: 20px 0 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
}

/* ======== AUTH PAGES ======== */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .display-font {
    font-size: 36px;
    color: var(--text-primary);
}

.auth-logo .display-font span { color: var(--accent); }
.auth-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a { color: var(--accent); font-weight: 600; }

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ======== NOTES ======== */
.note-card {
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
    cursor: pointer;
}

.note-card:hover { border-color: var(--accent); }

.note-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.note-preview {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.note-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.note-badge.private { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.note-badge.public { background: var(--accent-muted); color: var(--accent); }

/* ======== PROFILE ======== */
.profile-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    text-align: center;
}

.profile-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    border: 3px solid var(--accent);
    font-size: 30px;
}

.profile-name { font-size: 22px; font-weight: 700; }
.profile-username { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.profile-bio { color: var(--text-secondary); font-size: 14px; margin: 12px 0; line-height: 1.6; }

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 16px 0;
}

.stat { text-align: center; }
.stat-num { font-size: 20px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-muted); }

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

@media (max-width: 400px) {
    .profile-actions .btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}

.tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-hover);
}

/* ======== SEARCH ======== */
.search-input-wrap {
    position: relative;
    margin-bottom: 24px;
}

.search-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.search-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 12px 16px 12px 44px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

/* ======== USER ITEM ======== */
.user-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 10px;
    transition: all var(--transition);
}

.user-item:hover { border-color: var(--border-hover); }
.user-info { flex: 1; }
.user-name { font-weight: 600; font-size: 15px; }
.user-startup { font-size: 12px; color: var(--text-muted); }

/* ======== TOAST ======== */
.toast-container {
    position: fixed;
    bottom: 80px; right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    animation: toastIn 0.3s ease;
    min-width: 200px;
    max-width: 300px;
    box-shadow: var(--shadow);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ======== ADD POST AREA ======== */
.add-post-card {
    padding: 20px;
    margin-bottom: 20px;
}

.add-post-inner {
    display: flex;
    gap: 12px;
}

.post-textarea {
    flex: 1;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 15px;
    color: var(--text-primary);
    resize: none;
    min-height: 80px;
    transition: border var(--transition);
}

.post-textarea:focus { border-color: var(--accent); }
.post-textarea::placeholder { color: var(--text-muted); }

.post-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ======== EMPTY STATE ======== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc { font-size: 14px; line-height: 1.6; }

/* ======== LOADING ======== */
.spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 40px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ======== ALERT ======== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid;
}

.alert-error { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #ef4444; }
.alert-success { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: #22c55e; }

/* ======== RESPONSIVE ======== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; max-width: 100vw; }
    .content-area { padding-bottom: 80px; }
    .bottom-nav { display: flex; }
    .add-post-card { display: none; }
    .page-header { padding: 16px 0 12px; }
}

@media (min-width: 769px) {
    .bottom-nav { display: none; }
}

/* ======== ACCENT LINE ON TOP ======== */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent 60%);
    z-index: 999;
}

/* Note editor */
.note-editor {
    width: 100%;
    min-height: 300px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    resize: vertical;
    font-family: var(--font-body);
    transition: border var(--transition);
}

.note-editor:focus { border-color: var(--accent); }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: none;
    border: none;
}

.tab.active {
    background: var(--accent);
    color: white;
}

/* ======== FOUNDER CARD ======== */
#founder-card-modal {
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#founder-card {
    animation: cardReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

@keyframes cardReveal {
    from { opacity: 0; transform: rotateY(-20deg) scale(0.85) translateY(30px); }
    to   { opacity: 1; transform: rotateY(0deg) scale(1) translateY(0); }
}

/* ======== GROUPS PAGE ======== */
#chat-messages::-webkit-scrollbar { width: 3px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* Admin panel responsive */
@media (max-width: 768px) {
    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3),
    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        display: none;
    }
}

/* ======== SHARE SHEET ======== */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-family: var(--font-body);
    transition: all 0.15s ease;
}
.share-whatsapp  { background: rgba(37,211,102,0.12); color: #25d366; border: 1px solid rgba(37,211,102,0.25); }
.share-twitter   { background: rgba(255,255,255,0.06); color: var(--text-primary); border: 1px solid var(--border); }
.share-linkedin  { background: rgba(10,102,194,0.12); color: #0a66c2; border: 1px solid rgba(10,102,194,0.25); }
.share-telegram  { background: rgba(36,161,222,0.12); color: #24a1de; border: 1px solid rgba(36,161,222,0.25); }
.share-copy      { background: var(--accent-muted); color: var(--accent); border: 1px solid var(--accent); }
.share-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }

/* ======== COPYRIGHT BADGE on Notes ======== */
.copyright-stamp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 20px;
    font-family: var(--font-mono);
    margin-top: 8px;
}
.copyright-stamp.verified {
    color: var(--success);
    border-color: rgba(34,197,94,0.3);
    background: rgba(34,197,94,0.06);
}

/* Copyright certificate modal */
.cert-card {
    background: linear-gradient(135deg, #0a0a0a, #111);
    border: 1px solid rgba(204,0,0,0.4);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cert-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(204,0,0,0.02) 20px,
        rgba(204,0,0,0.02) 21px
    );
    pointer-events: none;
}

/* ======================================================
   MOBILE RESPONSIVE FIXES — POST MODAL & FORMS
   ====================================================== */

/* --- Modal base fix for all screen sizes --- */
.modal-overlay {
    padding: 12px !important;
    align-items: flex-end !important;
}

@media (min-width: 600px) {
    .modal-overlay {
        padding: 20px !important;
        align-items: center !important;
    }
}

.modal {
    width: 100% !important;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 20px 20px 16px 16px !important;
    padding: 20px 16px !important;
    margin: 0 auto;
}

@media (min-width: 600px) {
    .modal {
        border-radius: var(--radius-lg) !important;
        padding: 28px !important;
    }
}

/* --- Post modal inner layout --- */
#post-modal .modal {
    border-radius: 20px 20px 0 0 !important;
}

@media (min-width: 600px) {
    #post-modal .modal {
        border-radius: var(--radius-lg) !important;
    }
}

/* Avatar + Textarea row */
.add-post-inner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
}

/* Textarea inside modal — full width, no overflow */
.post-textarea {
    flex: 1;
    min-width: 0;          /* prevents flex overflow */
    width: 100%;
    box-sizing: border-box;
    font-size: 15px;
    min-height: 90px;
    resize: none;
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 480px) {
    .post-textarea {
        font-size: 14px;
        min-height: 80px;
    }

    /* Avatar smaller on tiny screens */
    #post-modal .avatar {
        width: 34px !important;
        height: 34px !important;
        font-size: 13px !important;
        flex-shrink: 0;
    }
}

/* Post form actions row — wrap on small screens */
.post-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    width: 100%;
}

.post-form-actions .btn {
    white-space: nowrap;
}

/* --- Register / Auth form fixes --- */
@media (max-width: 500px) {
    .auth-card {
        padding: 28px 18px !important;
        border-radius: 16px !important;
    }

    /* Stack two-column grids on tiny screens */
    .auth-card [style*="grid-template-columns:1fr 1fr"],
    .auth-card div[style*="display:grid"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    .form-input, .form-textarea, .form-select {
        font-size: 16px !important; /* prevents iOS zoom on focus */
    }
}

/* --- Edit Profile modal grid fix on mobile --- */
@media (max-width: 540px) {
    #edit-modal .modal {
        padding: 18px 14px !important;
    }

    /* Force grid to single column */
    #edit-modal [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* --- Note modal --- */
@media (max-width: 540px) {
    #note-modal .modal {
        padding: 18px 14px !important;
    }

    .note-editor {
        min-height: 200px;
        font-size: 14px;
    }
}

/* --- Card modal --- */
@media (max-width: 540px) {
    #card-modal .modal,
    #founder-card-modal {
        padding: 16px 12px !important;
    }

    /* ATM card scales down */
    #founder-card {
        height: 200px !important;
        padding: 18px 20px !important;
    }

    #card-details {
        grid-template-columns: 1fr !important;
    }
}

/* --- General form inputs — prevent iOS zoom --- */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="url"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Content area top padding on mobile */
    .content-area {
        padding-top: 16px;
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Post cards — better spacing */
    .post-card {
        padding: 16px !important;
        border-radius: 12px !important;
    }

    /* Post content text */
    .post-content {
        font-size: 14px;
        line-height: 1.6;
    }

    /* Post actions row */
    .post-actions {
        gap: 12px;
    }

    .action-btn {
        font-size: 13px;
        padding: 6px 8px;
    }

    /* Comment input */
    .comment-form {
        flex-wrap: wrap;
        gap: 8px;
    }

    .comment-input {
        flex: 1;
        min-width: 0;
    }

    /* Modal header */
    .modal-header {
        margin-bottom: 14px;
    }

    .modal-title {
        font-size: 17px;
    }

    /* Profile header */
    .profile-header {
        padding: 20px 16px;
    }

    .profile-avatar {
        width: 68px !important;
        height: 68px !important;
        font-size: 24px !important;
    }

    .profile-name {
        font-size: 18px;
    }

    .profile-stats {
        gap: 20px;
    }

    /* Page header */
    .page-header {
        padding: 14px 0 10px;
    }

    .page-title {
        font-size: 18px;
    }

    /* Notes */
    .note-card {
        padding: 14px 16px;
    }

    /* Search input */
    .search-input {
        font-size: 15px;
        padding: 11px 14px 11px 40px;
    }

    /* User items in search */
    .user-item {
        padding: 12px;
        gap: 10px;
    }
}

/* --- Bottom nav safe area (iPhone notch) --- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(65px + env(safe-area-inset-bottom));
    }

    .content-area {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* --- Smooth modal sheet from bottom on mobile --- */
@media (max-width: 600px) {
    .modal-overlay {
        transition: background 0.2s;
    }

    .modal {
        animation: slideUp 0.25s ease !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    @keyframes slideUp {
        from { transform: translateY(30px); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }
}

/* ======== FORM GRID — 2 col desktop, 1 col mobile ======== */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

@media (max-width: 500px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
