/* ================================================
   VENTBOOK - PWA MOBILE-FIRST DESIGN
   ================================================ */

/* CSS VARIABLES */
:root {
    /* Light Theme */
    --bg: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --bg-elevated: #ffffff;

    --text: #1a1a1a;
    --text-secondary: #6c757d;
    --text-tertiary:adb5bd;

    --border: #e9ecef;
    --border-light: #dee2e6;

    /* Colors */
    --primary: #4c6ef5;
    --primary-light: rgba(76, 110, 245, 0.1);
    --success: #40c057;
    --warning: #fab005;
    --error: #fa5252;

    /* Emotion Colors */
    --happy: #fcc419;
    --happy-bg: rgba(252, 196, 25, 0.15);
    --sad: #748ffc;
    --sad-bg: rgba(116, 143, 252, 0.15);
    --angry: #ff6b6b;
    --angry-bg: rgba(255, 107, 107, 0.15);
    --anxious: #ff922b;
    --anxious-bg: rgba(255, 146, 43, 0.15);
    --grateful: #51cf66;
    --grateful-bg: rgba(81, 207, 102, 0.15);
    --neutral: #868e96;
    --neutral-bg: rgba(134, 142, 150, 0.15);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Dark Theme */
body.dark-theme {
    --bg: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-elevated: #1f1f1f;

    --text: #f5f5f5;
    --text-secondary: #a0a0a0;
    --text-tertiary: #6a6a6a;

    --border: #2a2a2a;
    --border-light: #333333;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Mobile Container - Always centered */
#app {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Desktop: Add shadow and border on larger screens */
@media (min-width: 450px) {
    #app {
        min-height: 100vh;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
    }

    body {
        background: var(--bg-secondary);
        align-items: center;
        display: flex;
    }
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

input, textarea, select {
    font: inherit;
    color: inherit;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */

.toast-container {
    position: fixed;
    top: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    width: 90%;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-2);
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease;
    pointer-events: all;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }

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

/* ================================================
   LOADING SCREEN
   ================================================ */

.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-logo {
    font-size: 64px;
    margin-bottom: var(--space-6);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.small {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

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

/* ================================================
   AUTH SCREEN
   ================================================ */

.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-6);
}

.auth-card {
    width: 100%;
    max-width: 340px;
    text-align: center;
}

.auth-logo {
    font-size: 64px;
    margin-bottom: var(--space-4);
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.auth-card p {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.input-wrapper input {
    width: 100%;
    padding: 14px var(--space-4);
    font-size: 16px;
}

.error-message {
    background: var(--error);
    color: white;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 14px var(--space-5);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 16px;
    width: 100%;
    transition: opacity 0.15s ease;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-switch {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

/* ================================================
   TOP HEADER
   ================================================ */

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.header-logo {
    font-size: 24px;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.back-btn:hover {
    background: var(--bg-tertiary);
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 18px;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
}

.notification-btn {
    position: relative;
}

.notif-bell {
    font-size: 18px;
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: var(--error);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.theme-btn {
    font-size: 18px;
}

.page-title {
    padding: var(--space-4) var(--space-5);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.page-title h1 {
    font-size: 24px;
    font-weight: 700;
}

/* ================================================
   MAIN CONTENT
   ================================================ */

.main-content {
    flex: 1;
    padding: var(--space-4) var(--space-5) 100px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ================================================
   BOTTOM NAVIGATION
   ================================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    display: flex;
    align-items: center;
    padding: var(--space-2) 0;
    padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    z-index: 100;
    justify-content: space-around;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    position: relative;
    min-width: 60px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 22px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    min-width: 16px;
    height: 16px;
    background: var(--error);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* FAB - Center Button */
.nav-item.fab {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(76, 110, 245, 0.4);
    transition: transform 0.15s ease;
}

.nav-item.fab:active {
    transform: scale(0.95);
}

.fab-icon {
    font-size: 28px;
    font-weight: 300;
}

/* ================================================
   FEED
   ================================================ */

.feed-filters {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.filter-chip {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.filter-chip.active {
    background: var(--primary);
    color: white;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.tag-btn {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.tag-btn.active {
    background: var(--primary);
    color: white;
}

.dm-banner {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
}

.dm-arrow {
    margin-left: auto;
}

/* ================================================
   POST CARD
   ================================================ */

.post {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.post-author {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    font-size: 15px;
}

.post-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.post-more {
    color: var(--text-tertiary);
    font-size: 18px;
    padding: var(--space-1);
}

.post-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: var(--space-3);
}

.post-tag.happy { background: var(--happy-bg); color: var(--happy); }
.post-tag.sad { background: var(--sad-bg); color: var(--sad); }
.post-tag.angry { background: var(--angry-bg); color: var(--angry); }
.post-tag.anxious { background: var(--anxious-bg); color: var(--anxious); }
.post-tag.grateful { background: var(--grateful-bg); color: var(--grateful); }
.post-tag.neutral { background: var(--neutral-bg); color: var(--neutral); }

.post-text {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: var(--space-3);
    white-space: pre-wrap;
    font-size: 15px;
}

.post-image {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
}

.post-video-wrapper {
    margin-bottom: var(--space-3);
}

.post-video-wrapper video {
    width: 100%;
    border-radius: var(--radius-md);
    max-height: 400px;
}

.video-watched {
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.edited-badge {
    font-size: 11px;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: var(--space-3);
}

.post-actions {
    display: flex;
    gap: var(--space-1);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-secondary);
}

.action-btn:hover {
    background: var(--bg-tertiary);
}

.action-btn.active {
    color: var(--primary);
}

.action-icon {
    font-size: 16px;
}

/* ================================================
   SKELETON LOADING
   ================================================ */

.skeleton-post {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.skeleton-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-elevated) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: var(--space-3);
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-elevated) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: var(--space-2);
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ================================================
   EMPTY STATES
   ================================================ */

.empty-state {
    text-align: center;
    padding: var(--space-6) var(--space-5);
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 56px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: var(--space-2);
}

.empty-hint {
    font-size: 14px;
    color: var(--text-tertiary);
}

.empty-small {
    text-align: center;
    padding: var(--space-6) var(--space-5);
    color: var(--text-secondary);
}

.empty-small p {
    font-size: 14px;
}

.load-more {
    display: flex;
    justify-content: center;
    padding: var(--space-4);
}

/* ================================================
   SEARCH
   ================================================ */

.search-page {
    padding: var(--space-4) 0;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-4);
}

.search-icon {
    font-size: 18px;
    color: var(--text-tertiary);
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 16px;
}

.search-bar input:focus {
    box-shadow: none;
}

.search-results {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-section {
    margin-bottom: var(--space-6);
}

.search-section h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-3);
    padding: 0 var(--space-1);
}

.user-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
}

.user-handle {
    font-size: 13px;
    color: var(--text-secondary);
}

.search-placeholder {
    text-align: center;
    padding: var(--space-6) var(--space-5);
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.4;
}

.search-placeholder p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.search-placeholder span {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* ================================================
   MESSAGES
   ================================================ */

.messages-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.messages-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.messages-section h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-3);
}

.dm-request, .conversation-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
}

.conversation-item {
    cursor: pointer;
}

.conversation-item:hover {
    background: var(--bg-tertiary);
}

.dm-avatar, .conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.dm-name, .conv-name {
    flex: 1;
    font-weight: 500;
}

.dm-actions {
    display: flex;
    gap: var(--space-2);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.btn-icon.accept {
    background: var(--success);
    color: white;
}

.btn-icon.reject {
    background: var(--error);
    color: white;
}

.conv-arrow {
    color: var(--text-tertiary);
}

/* ================================================
   CHAT
   ================================================ */

.chat-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.chat-empty {
    text-align: center;
    padding: var(--space-6);
    color: var(--text-tertiary);
}

.chat-bubble {
    max-width: 80%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
}

.chat-bubble.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    align-self: flex-start;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.chat-bubble p {
    font-size: 14px;
    margin-bottom: 4px;
}

.msg-time {
    font-size: 11px;
    opacity: 0.7;
}

.chat-input-form {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.chat-input-form input {
    flex: 1;
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ================================================
   NOTIFICATIONS
   ================================================ */

.notifications-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.notif-header-bar {
    display: flex;
    justify-content: flex-end;
    padding: var(--space-3) 0;
}

.mark-all-btn {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    padding: var(--space-2) var(--space-3);
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.notif-item.read {
    opacity: 0.5;
}

.notif-icon {
    font-size: 20px;
}

.notif-content {
    flex: 1;
}

.notif-content p {
    font-size: 15px;
    margin-bottom: 4px;
}

.notif-time {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ================================================
   PROFILE
   ================================================ */

.profile-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.profile-header {
    text-align: center;
    padding: var(--space-6) var(--space-5);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto var(--space-4);
}

.profile-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.profile-username {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: var(--space-3);
}

.profile-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary);
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    margin: var(--space-4) 0;
}

.stat-item {
    text-align: center;
}

.stat-num {
    font-size: 24px;
    font-weight: 700;
    display: block;
}

.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-dm {
    margin-top: var(--space-4);
    padding: 12px var(--space-5);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.profile-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.profile-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.limits-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
}

.limit-box {
    text-align: center;
    padding: var(--space-3);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.limit-label {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.limit-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.limit-value.warning {
    color: var(--warning);
}

.limit-value.error {
    color: var(--error);
}

.mood-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.mood-select, .mood-note {
    width: 100%;
}

.btn-save {
    padding: 12px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.mood-list {
    border-top: 1px solid var(--border);
    padding-top: var(--space-4);
}

.mood-list h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: var(--space-3);
}

.mood-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
}

.mood-emoji {
    font-size: 20px;
}

.mood-note {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
}

.mood-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

.action-list {
    display: flex;
    flex-direction: column;
}

.action-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-1);
}

.action-row:hover {
    background: var(--bg-tertiary);
}

.action-icon {
    font-size: 18px;
}

.action-row span:not(.action-icon):not(.action-arrow) {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.action-arrow {
    color: var(--text-tertiary);
}

.action-row.logout {
    color: var(--error);
}

/* ================================================
   POSTS PAGE (Bookmarks/My Posts)
   ================================================ */

.posts-page h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--space-4);
    padding: 0 var(--space-1);
}

/* ================================================
   ABOUT PAGE
   ================================================ */

.about-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.about-hero {
    text-align: center;
    padding: var(--space-6) var(--space-5);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
}

.about-logo {
    font-size: 56px;
    margin-bottom: var(--space-4);
}

.about-hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--space-2);
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-hero p {
    color: var(--text-secondary);
}

.about-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.about-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.about-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.feature-grid {
    display: grid;
    gap: var(--space-2);
}

.feature-grid span {
    padding: var(--space-3);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.emotion-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.emotion-chip {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
}

.emotion-chip.happy { background: var(--happy-bg); color: var(--happy); }
.emotion-chip.sad { background: var(--sad-bg); color: var(--sad); }
.emotion-chip.angry { background: var(--angry-bg); color: var(--angry); }
.emotion-chip.anxious { background: var(--anxious-bg); color: var(--anxious); }
.emotion-chip.grateful { background: var(--grateful-bg); color: var(--grateful); }
.emotion-chip.neutral { background: var(--neutral-bg); color: var(--neutral); }

.about-section.safety {
    border: 1px solid var(--warning);
    background: rgba(250, 176, 5, 0.05);
}

.crisis-box {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.crisis-box p {
    margin-bottom: var(--space-2);
}

.about-footer {
    text-align: center;
    padding: var(--space-6) var(--space-5);
    color: var(--text-tertiary);
}

.version {
    font-size: 12px;
    margin-top: var(--space-2);
}

/* ================================================
   MODAL
   ================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    animation: fadeIn 0.2s ease;
}

.modal-sheet {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-sheet.small {
    max-width: 380px;
    border-radius: var(--radius-xl);
    margin: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5) var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-tertiary);
}

.modal-body {
    padding: var(--space-5);
}

.modal-footer {
    padding: var(--space-4) var(--space-5) var(--space-5);
    border-top: 1px solid var(--border);
    display: flex;
    gap: var(--space-2);
}

.emotion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.emotion-option {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.emotion-option.active {
    background: var(--primary);
    color: white;
}

.post-textarea {
    width: 100%;
    resize: none;
    font-size: 16px;
    line-height: 1.5;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: var(--space-2);
}

.char-count.warning {
    color: var(--warning);
}

.media-buttons {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.media-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-3);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
}

.media-icon {
    font-size: 18px;
}

.media-preview {
    position: relative;
    margin-top: var(--space-3);
}

.media-preview img, .media-preview video {
    width: 100%;
    border-radius: var(--radius-md);
    max-height: 200px;
    object-fit: cover;
}

.media-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 18px;
}

.btn-secondary {
    flex: 1;
    padding: 14px var(--space-5);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-weight: 500;
}

.btn-danger {
    flex: 1;
    padding: 14px var(--space-5);
    background: var(--error);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.text-input {
    width: 100%;
}

.modal-hint {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: var(--space-4);
}

/* ================================================
   COMMENTS
   ================================================ */

.comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: var(--space-4);
}

.comment-item {
    display: flex;
    gap: var(--space-3);
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.comment-body {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
}

.comment-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 2px 0;
}

.comment-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

.comment-form {
    display: flex;
    gap: var(--space-2);
}

.comment-form input {
    flex: 1;
}

.comment-form button {
    padding: 0 var(--space-4);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.comment-form button:disabled {
    opacity: 0.5;
}

/* ================================================
   SCROLLBAR
   ================================================ */

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}
