/* ===== CSS Variables & Theme ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --bg-card: #ffffff;
    --bg-hover: #f5f5f5;
    --text-primary: #262626;
    --text-secondary: #8e8e8e;
    --text-tertiary: #c7c7c7;
    --border-color: #dbdbdb;
    --border-light: #efefef;
    --accent: #0095f6;
    --accent-hover: #1877f2;
    --accent-light: #e3f2fd;
    --danger: #ed4956;
    --danger-hover: #c13543;
    --success: #58c322;
    --warning: #ff9800;
    --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);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;
    --nav-height: 60px;
    --bottom-nav-height: 56px;
    --max-width: 935px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #262626;
    --bg-card: #1e1e1e;
    --bg-hover: #2a2a2a;
    --text-primary: #f5f5f5;
    --text-secondary: #a8a8a8;
    --text-tertiary: #555555;
    --border-color: #363636;
    --border-light: #2a2a2a;
    --accent: #0095f6;
    --accent-light: #1a3a5c;
    --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: 14px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ===== Top Bar ===== */
.top-bar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--nav-height);
    background: var(--bg-primary); border-bottom: 1px solid var(--border-color);
    z-index: 1000; display: flex; align-items: center;
    box-shadow: var(--shadow-sm);
}
.top-bar-inner {
    width: 100%; max-width: var(--max-width); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
}
.logo {
    font-family: 'Georgia', serif; font-size: 1.7rem; font-weight: 700;
    color: var(--text-primary); letter-spacing: -1px;
}
.logo:hover { text-decoration: none; }
.top-bar-actions { display: flex; gap: 12px; align-items: center; position: relative; }

/* ===== Icons & Buttons ===== */
.icon-btn {
    background: none; border: none; cursor: pointer; color: var(--text-primary);
    padding: 8px; border-radius: var(--radius-full); position: relative;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); text-decoration: none; }
.icon-btn-sm { font-size: 1.2rem; padding: 4px 8px; }

.badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--danger); color: #fff; font-size: 0.65rem;
    min-width: 16px; height: 16px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px; border: none; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.85rem; cursor: pointer;
    transition: all var(--transition); gap: 6px;
    font-family: inherit; line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-outline:hover { background: var(--bg-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-text { background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 0.85rem; }
.btn-text:disabled { color: var(--text-tertiary); cursor: default; }
.btn-full { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-xs { padding: 3px 8px; font-size: 0.75rem; }

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-height); background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-around;
    z-index: 1000;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--text-secondary); font-size: 0.65rem; padding: 8px 16px;
    text-decoration: none; background: none; border: none; cursor: pointer;
    transition: color var(--transition);
}
.nav-item:hover, .nav-item.active { color: var(--text-primary); text-decoration: none; }
.nav-item.active { font-weight: 600; }

/* ===== Main Content ===== */
.main-content { padding-top: var(--nav-height); padding-bottom: calc(var(--bottom-nav-height) + 16px); }

/* ===== Auth Pages ===== */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px;
    background: linear-gradient(135deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
}
.auth-container { width: 100%; max-width: 400px; }
.auth-card {
    background: var(--bg-primary); border-radius: var(--radius-md);
    padding: 32px; box-shadow: var(--shadow-lg);
}
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-logo {
    font-family: 'Georgia', serif; font-size: 2.5rem; font-weight: 700;
    color: var(--text-primary); margin-bottom: 8px;
}
.auth-subtitle { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; }
.auth-footer { text-align: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-light); }
.auth-footer p { color: var(--text-secondary); }
.auth-divider {
    text-align: center; margin: 20px 0; position: relative;
}
.auth-divider::before {
    content: ''; position: absolute; top: 50%; left: 0; right: 0;
    height: 1px; background: var(--border-light);
}
.auth-divider span {
    background: var(--bg-primary); padding: 0 16px;
    color: var(--text-secondary); font-size: 0.8rem; font-weight: 600;
    position: relative;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.85rem; color: var(--text-secondary); }
.form-input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 0.95rem;
    background: var(--bg-primary); color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,149,246,0.15); }
textarea.form-input { resize: vertical; }

.location-input-row { display: flex; gap: 8px; align-items: center; }
.location-input-row .form-input { flex: 1; }
.location-gps-btn { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; flex-shrink: 0; transition: all 0.2s; }
.location-gps-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-accent); }
.location-gps-btn.loading { animation: spin 1s linear infinite; opacity: 0.6; pointer-events: none; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.gps-status { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; }

/* ===== Notification Dropdown ===== */
.dropdown-panel { position: absolute; top: 50px; right: 10px; width: 360px; max-height: 480px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0,0,0,0.15); z-index: 1000; display: flex; flex-direction: column; overflow: hidden; }
.dropdown-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.dropdown-header h3 { margin: 0; font-size: 1rem; }
.dropdown-list { overflow-y: auto; flex: 1; max-height: 400px; }
.form-error { color: var(--danger); font-size: 0.8rem; margin-top: 4px; display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 16px; color: var(--text-primary); }
.form-row-between { display: flex; justify-content: space-between; align-items: center; }

.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; cursor: pointer; }
.checkbox-label input { accent-color: var(--accent); }

.password-field { position: relative; }
.password-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--text-secondary);
}

/* ===== File Upload ===== */
.file-upload { position: relative; }
.file-upload input[type="file"] {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0; cursor: pointer; z-index: 2;
}
.file-upload-label {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 24px; border: 2px dashed var(--border-color); border-radius: var(--radius-md);
    cursor: pointer; text-align: center; transition: all var(--transition);
    color: var(--text-secondary);
}
.file-upload-label:hover { border-color: var(--accent); background: var(--accent-light); }
.file-upload-label span { font-weight: 500; }
.file-upload-label small { font-size: 0.75rem; }
.file-preview { margin-top: 8px; }
.file-preview img { max-width: 200px; max-height: 200px; border-radius: var(--radius-sm); }
.avatar-placeholder {
    width: 80px; height: 80px; border-radius: var(--radius-full);
    background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center;
}

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 16px; font-size: 0.9rem;
}
.alert-error { background: #fef2f2; color: #c53030; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
[data-theme="dark"] .alert-error { background: #4a1c1c; color: #fca5a5; border-color: #7f1d1d; }
[data-theme="dark"] .alert-success { background: #1a2e1a; color: #86efac; border-color: #14532d; }

/* ===== Feed ===== */
.feed-container {
    max-width: var(--max-width); margin: 0 auto;
    display: grid; grid-template-columns: 1fr 320px; gap: 32px;
    padding: 24px 16px;
}
.feed-main { max-width: 600px; }

.stories-bar {
    display: flex; gap: 12px; padding: 16px; background: var(--bg-card);
    border-radius: var(--radius-md); margin-bottom: 24px;
    border: 1px solid var(--border-light); overflow-x: auto;
}
.story-item { text-align: center; flex-shrink: 0; }
.story-ring {
    width: 64px; height: 64px; border-radius: var(--radius-full);
    padding: 3px; border: 2px solid var(--accent); overflow: visible; position: relative;
}
.story-ring img { width: 100%; height: 100%; border-radius: var(--radius-full); object-fit: cover; border: 2px solid var(--bg-card); }
.story-label { font-size: 0.7rem; color: var(--text-secondary); display: block; margin-top: 4px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Post Card ===== */
.post-card {
    background: var(--bg-card); border-radius: var(--radius-md);
    border: 1px solid var(--border-light); margin-bottom: 16px;
    overflow: hidden; box-shadow: var(--shadow-sm);
}
.post-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
}
.post-author { display: flex; align-items: center; gap: 10px; color: var(--text-primary); text-decoration: none; }
.post-author:hover { text-decoration: none; }
.author-name { font-weight: 600; font-size: 0.9rem; display: block; }
.post-location { font-size: 0.75rem; color: var(--text-secondary); display: block; }
.post-media { position: relative; background: #000; }
.post-image { width: 100%; display: block; object-fit: contain; max-height: 600px; }
.post-video { width: 100%; display: block; max-height: 600px; }
.post-audio { padding: 24px; text-align: center; }
.post-audio audio { width: 100%; }
.post-document {
    display: flex; align-items: center; gap: 12px; padding: 24px;
    color: var(--text-primary);
}
.post-actions { display: flex; gap: 4px; padding: 8px 12px; }
.action-btn {
    background: none; border: none; padding: 8px; cursor: pointer;
    color: var(--text-primary); border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.action-btn:hover { background: var(--bg-hover); }
.action-btn.liked { color: var(--danger); }
.action-btn.saved { color: var(--text-primary); }
.post-likes { padding: 0 16px; font-weight: 600; font-size: 0.9rem; }
.post-caption { padding: 4px 16px 8px; }
.caption-author { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.caption-text { font-size: 0.9rem; }
.view-comments { display: block; padding: 0 16px 4px; font-size: 0.85rem; color: var(--text-secondary); }
.post-time { padding: 0 16px 12px; font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.comment-form { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-light); }
.comment-input {
    flex: 1; border: none; background: transparent; font-size: 0.9rem;
    color: var(--text-primary); font-family: inherit;
}
.comment-input:focus { outline: none; }

/* ===== Comments ===== */
.comments-section { padding: 8px 16px; }
.comment-item { display: flex; gap: 8px; margin-bottom: 12px; }
.comment-item .avatar-sm { flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-author { font-weight: 600; font-size: 0.85rem; }
.comment-text { font-size: 0.85rem; }
.comment-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 4px; display: flex; gap: 12px; }

/* ===== Avatars ===== */
.avatar-sm { width: 32px; height: 32px; border-radius: var(--radius-full); object-fit: cover; display: block; flex-shrink: 0; }
.avatar-md { width: 44px; height: 44px; border-radius: var(--radius-full); object-fit: cover; }
.avatar-lg { width: 80px; height: 80px; border-radius: var(--radius-full); object-fit: cover; }

/* ===== Carousel ===== */
.carousel-container { position: relative; overflow: hidden; }
.carousel-track { display: flex; transition: transform 0.3s ease; }
.carousel-slide { min-width: 100%; }
.carousel-slide img, .carousel-slide video { width: 100%; display: block; }
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.9); border: none; width: 32px; height: 32px;
    border-radius: var(--radius-full); font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm); color: #333; z-index: 2;
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 4px;
}
.dot {
    width: 6px; height: 6px; border-radius: 3px;
    background: rgba(255,255,255,0.5); transition: all 0.3s;
}
.dot.active { background: #fff; width: 18px; }

/* ===== Profile ===== */
.profile-container { max-width: 935px; margin: 0 auto; padding: 0 16px; }
.profile-header { padding: 24px 0; }
.profile-cover { position: relative; min-height: 200px; background: linear-gradient(135deg, #0095f6 0%, #00c6ff 100%); border-radius: var(--radius-md); overflow: visible; }
.cover-photo { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius-md); }
.cover-upload {
    position: absolute; bottom: 12px; right: 12px;
    background: rgba(0,0,0,0.65); color: #fff; padding: 10px;
    border-radius: var(--radius-full); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}
.cover-upload:hover { background: rgba(0,0,0,0.85); }
.profile-info { display: flex; gap: 32px; align-items: flex-end; flex-wrap: wrap; margin-top: -75px; padding: 0 20px; position: relative; z-index: 2; }
.profile-pic-container { position: relative; flex-shrink: 0; }
.profile-pic-lg { width: 150px; height: 150px; border-radius: var(--radius-full); object-fit: cover; border: 4px solid var(--bg-card); background: var(--bg-card); }
.profile-pic-edit {
    position: absolute; bottom: 4px; right: 4px;
    background: var(--bg-primary); border: 1px solid var(--border-color);
    padding: 6px; border-radius: var(--radius-full); cursor: pointer;
}
.profile-details { flex: 1; min-width: 280px; }
.profile-name-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.profile-username { font-size: 1.6rem; font-weight: 300; }
.profile-stats { display: flex; gap: 32px; margin-bottom: 16px; }
.profile-stats span { font-size: 0.95rem; }
.profile-stats strong { font-weight: 700; }
.profile-bio { margin-bottom: 8px; font-size: 0.95rem; }
.profile-bio-text { font-size: 0.95rem; white-space: pre-wrap; margin-bottom: 8px; }
.profile-website { font-weight: 600; font-size: 0.9rem; }
.profile-location { font-size: 0.85rem; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-tabs {
    display: flex; gap: 0; border-top: 1px solid var(--border-color);
    margin-top: 24px; justify-content: center;
}
.tab-btn {
    flex: 1; max-width: 180px; padding: 16px; background: none; border: none;
    border-top: 1px solid transparent; color: var(--text-secondary);
    font-weight: 600; font-size: 0.8rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    text-transform: uppercase; letter-spacing: 1px;
    transition: all var(--transition);
}
.tab-btn.active { color: var(--text-primary); border-top-color: var(--text-primary); }
.profile-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 3px; padding: 3px 0;
}
.grid-item {
    position: relative; aspect-ratio: 1; overflow: hidden;
    background: var(--bg-tertiary); cursor: pointer;
}
.grid-item img { width: 100%; height: 100%; object-fit: cover; }
.grid-item video { width: 100%; height: 100%; object-fit: cover; }
.grid-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.3); display: flex; gap: 16px;
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
    color: #fff; font-weight: 700;
}
.grid-item:hover .grid-overlay { opacity: 1; }
.video-icon {
    position: absolute; top: 8px; right: 8px;
    color: #fff; font-size: 1.2rem; text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ===== Messages ===== */
.messages-container {
    max-width: var(--max-width); margin: 0 auto;
    display: grid; grid-template-columns: 340px 1fr;
    height: calc(100vh - var(--nav-height)); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); overflow: hidden; margin-top: 16px;
}
.conversations-panel {
    border-right: 1px solid var(--border-color); overflow-y: auto;
    background: var(--bg-card);
}
.panel-header { padding: 16px; border-bottom: 1px solid var(--border-light); }
.panel-header h2 { font-size: 1.2rem; font-weight: 700; }
.conversation-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; cursor: pointer;
    text-decoration: none; color: var(--text-primary);
    transition: background var(--transition);
}
.conversation-item:hover, .conversation-item.active { background: var(--bg-hover); text-decoration: none; }
.conv-info { flex: 1; min-width: 0; }
.conv-name { display: block; font-weight: 600; font-size: 0.9rem; }
.conv-last-msg { display: block; font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 0.7rem; color: var(--text-tertiary); flex-shrink: 0; }

.chat-panel { display: flex; flex-direction: column; background: var(--bg-primary); }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-color); }
.chat-user-info { display: flex; align-items: center; gap: 10px; }
.chat-user-info span { font-weight: 600; font-size: 0.95rem; }
.online-status { font-size: 0.75rem; color: var(--success); font-weight: 400 !important; }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.message { max-width: 65%; padding: 10px 14px; border-radius: 18px; font-size: 0.9rem; word-break: break-word; }
.message.sent { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.message.received { background: var(--bg-tertiary); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-time { font-size: 0.65rem; opacity: 0.6; display: block; margin-top: 4px; }
.msg-image { max-width: 240px; border-radius: 8px; margin-top: 4px; }
.msg-video { max-width: 280px; border-radius: 8px; margin-top: 4px; }
.msg-file {
    display: flex; align-items: center; gap: 6px; padding: 8px 12px;
    background: var(--bg-hover); border-radius: 8px; margin-top: 4px;
    color: var(--text-primary);
}

.typing-indicator { padding: 8px 16px; display: flex; gap: 4px; align-items: center; }
.typing-indicator .typing-text { font-size: 0.8rem; color: var(--text-secondary); font-style: italic; }
.typing-indicator .dot {
    width: 6px; height: 6px; background: var(--text-secondary); border-radius: 3px;
    animation: typingBounce 1.4s infinite;
}
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

.chat-input-form {
    display: flex; gap: 8px; padding: 12px 16px;
    border-top: 1px solid var(--border-color); align-items: center;
}
.chat-input-form input[type="text"] {
    flex: 1; padding: 10px 14px; border: 1px solid var(--border-color);
    border-radius: 20px; font-size: 0.9rem; background: var(--bg-tertiary);
    color: var(--text-primary); font-family: inherit;
}
.chat-input-form input[type="text"]:focus { outline: none; border-color: var(--accent); }

/* ===== Search ===== */
.search-container { max-width: 600px; margin: 0 auto; padding: 16px; }
.search-bar { margin-bottom: 24px; }
.search-form {
    display: flex; align-items: center; gap: 10px; padding: 10px 16px;
    background: var(--bg-card); border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.search-input {
    flex: 1; border: none; background: none; font-size: 0.95rem;
    color: var(--text-primary); font-family: inherit;
}
.search-input:focus { outline: none; }
.search-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border-color); }
.search-tab {
    flex: 1; padding: 12px; background: none; border: none;
    border-bottom: 2px solid transparent; color: var(--text-secondary);
    font-weight: 600; cursor: pointer; font-size: 0.85rem;
}
.search-tab.active { color: var(--text-primary); border-bottom-color: var(--text-primary); }
.search-section { margin-bottom: 24px; }
.search-section h3 { font-size: 1rem; margin-bottom: 12px; }
.search-user-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 0;
    color: var(--text-primary); text-decoration: none;
    border-bottom: 1px solid var(--border-light);
}
.search-user-item:hover { text-decoration: none; }
.search-username { display: block; font-weight: 600; font-size: 0.9rem; }
.search-name { display: block; font-size: 0.85rem; color: var(--text-secondary); }
.search-hashtag-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 0;
    color: var(--text-primary);
}
.hashtag-icon { font-size: 1.4rem; font-weight: 700; color: var(--text-secondary); }
.search-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }

/* ===== Settings ===== */
.settings-container { max-width: 600px; margin: 0 auto; padding: 16px; }
.settings-header { margin-bottom: 24px; }
.settings-header h2 { font-size: 1.5rem; font-weight: 700; }
.settings-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-color); margin-bottom: 24px; }
.settings-tab {
    padding: 12px 20px; background: none; border: none;
    border-bottom: 2px solid transparent; color: var(--text-secondary);
    font-weight: 600; cursor: pointer; font-size: 0.85rem;
}
.settings-tab.active { color: var(--text-primary); border-bottom-color: var(--text-primary); }
.settings-panel { display: none; background: var(--bg-card); padding: 24px; border-radius: var(--radius-md); border: 1px solid var(--border-light); }
.settings-panel.active { display: block; }
.settings-panel h3 { font-size: 1.1rem; margin: 20px 0 16px; }
.profile-pic-edit-row { display: flex; align-items: center; gap: 16px; }
.toggle-group { margin-bottom: 24px; }
.toggle-label {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.toggle-label input { accent-color: var(--accent); width: 18px; height: 18px; }

/* ===== Admin ===== */
.admin-layout { display: flex; min-height: calc(100vh - var(--nav-height)); }
.admin-sidebar {
    width: 240px; background: var(--bg-card); border-right: 1px solid var(--border-color);
    padding: 24px 0; flex-shrink: 0; position: sticky; top: var(--nav-height);
    height: calc(100vh - var(--nav-height)); overflow-y: auto;
}
.admin-logo { padding: 0 20px 20px; font-size: 1.2rem; font-weight: 700; }
.admin-nav { display: flex; flex-direction: column; }
.admin-nav-item {
    padding: 10px 20px; color: var(--text-primary); font-size: 0.9rem;
    text-decoration: none; transition: background var(--transition);
}
.admin-nav-item:hover { background: var(--bg-hover); text-decoration: none; }
.admin-nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.admin-main { flex: 1; padding: 24px; }
.admin-main h1 { font-size: 1.5rem; margin-bottom: 24px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
    background: var(--bg-card); padding: 20px; border-radius: var(--radius-md);
    text-align: center; border: 1px solid var(--border-light);
}
.stat-number { display: block; font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat-label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }
.stat-pending .stat-number { color: var(--warning); }
.stat-active .stat-number { color: var(--success); }

.admin-table-wrapper { overflow-x: auto; }
.admin-table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-card); border-radius: var(--radius-md);
}
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border-light); font-size: 0.85rem; }
.admin-table th { font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.admin-table a { color: var(--accent); }
.actions-cell { white-space: nowrap; }
.text-truncate { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pending-card {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); padding: 24px; margin-bottom: 20px;
}
.pending-card-header { display: flex; gap: 20px; margin-bottom: 16px; }
.pending-info p { font-size: 0.85rem; margin-bottom: 4px; }
.pending-id { margin: 16px 0; }
.pending-id h4 { font-size: 0.95rem; margin-bottom: 8px; }
.id-image { max-width: 400px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.pending-actions { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.reject-form { display: flex; gap: 8px; align-items: flex-end; }
.reject-form .form-input { width: 250px; }
.id-gallery { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.id-gallery img { max-width: 300px; max-height: 200px; object-fit: contain; border-radius: var(--radius-sm); border: 1px solid var(--border-color); cursor: pointer; }
.btn-xs { padding: 2px 8px; font-size: 0.72rem; }

.status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 600;
    background: var(--bg-tertiary); color: var(--text-secondary);
}
.status-pending { background: #fff3cd; color: #856404; }
.status-approved, .status-active { background: #d4edda; color: #155724; }
.status-rejected, .status-banned { background: #f8d7da; color: #721c24; }
.status-suspended { background: #fff3cd; color: #856404; }
.status-resolved { background: #d4edda; color: #155724; }
.status-dismissed { background: var(--bg-tertiary); color: var(--text-secondary); }

.filter-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.search-inline { display: flex; gap: 8px; }
.search-inline .form-input { width: 250px; }

/* ===== Loading & Empty ===== */
.loading-spinner { text-align: center; padding: 32px; }
.spinner {
    width: 32px; height: 32px; border: 3px solid var(--border-color);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state, .empty-state-sm {
    text-align: center; padding: 48px 16px; color: var(--text-secondary);
}
.empty-state svg { margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { color: var(--text-primary); margin-bottom: 8px; }
.empty-state-sm { padding: 24px; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 24px 0; }

/* ===== Modal ===== */
.modal {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.65); }
.modal-content {
    position: relative; background: var(--bg-card);
    border-radius: var(--radius-md); width: 100%; max-width: 520px;
    max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; border-bottom: 1px solid var(--border-light); flex-shrink: 0;
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close {
    background: none; border: none; font-size: 1.5rem; cursor: pointer;
    color: var(--text-secondary); padding: 4px;
}
#createPostForm { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-body { padding: 16px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-body textarea { width: 100%; border: none; background: none; font-size: 1rem; resize: none; color: var(--text-primary); font-family: inherit; min-height: 120px; }
.modal-body textarea:focus { outline: none; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border-light); flex-shrink: 0; }
.file-upload-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
    border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem;
    color: var(--text-secondary); transition: background var(--transition);
}
.file-upload-btn:hover { background: var(--bg-hover); }
.media-preview { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.media-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); }

/* ===== Theme Toggle ===== */
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: none; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .feed-container { grid-template-columns: 1fr; }
    .feed-sidebar { display: none; }
    .messages-container { grid-template-columns: 1fr; }
    .chat-panel { display: none; }
    .messages-container.chat-open .conversations-panel { display: none; }
    .messages-container.chat-open .chat-panel { display: flex; }
    .admin-sidebar { width: 200px; }
}

@media (max-width: 768px) {
    .profile-info { flex-direction: column; align-items: center; text-align: center; padding: 0; }
    .profile-name-row { justify-content: center; }
    .profile-stats { justify-content: center; }
    .profile-actions { justify-content: center; }
    .form-row { grid-template-columns: 1fr; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: static; }
    .admin-nav { flex-direction: row; overflow-x: auto; }
    .pending-card-header { flex-direction: column; align-items: center; text-align: center; }
    .modal { padding: 0; align-items: flex-end; }
    .modal-content { max-height: 85vh; border-radius: var(--radius-md) var(--radius-md) 0 0; }
    .modal-lg { max-width: 100%; }
    .story-viewer-container { max-height: 100%; border-radius: 0; }
    .story-creator-container { border-radius: 12px 12px 0 0; max-height: 90vh; }
    .story-creator-overlay { align-items: flex-end; }
    .cover-upload { bottom: 8px; right: 8px; padding: 8px; }
    .dropdown-panel { width: calc(100vw - 16px); right: 8px; }
    .notification-item p { font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .auth-card { padding: 24px 20px; }
    .top-bar-inner { padding: 0 12px; }
    .logo { font-size: 1.4rem; }
    .stories-bar { padding: 12px; gap: 10px; }
    .post-actions { gap: 0; }
    .profile-stats { gap: 16px; }
    .settings-container { padding: 12px; }
}

/* ===== Compact Admin Table ===== */
.compact-table { font-size: 0.82rem; table-layout: fixed; width: 100%; }
.compact-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 10px; }
.compact-table td { padding: 6px 10px; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
.compact-table .pending-row { cursor: pointer; transition: background var(--transition); }
.compact-table .pending-row:hover { background: var(--bg-hover); }
.compact-table .pending-row.row-removing { opacity: 0; transition: opacity 0.4s ease; }

.col-check { width: 32px; text-align: center; }
.compact-table .col-photo { width: 36px; min-width: 36px; max-width: 36px; white-space: nowrap; }
.compact-table .col-photo img { width: 28px; height: 28px; border-radius: var(--radius-full); object-fit: cover; display: block; }
.col-name { min-width: 120px; }
.col-username { min-width: 90px; color: var(--accent); }
.col-contact { max-width: 200px; }
.contact-email { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; font-size: 0.8rem; }
.contact-mobile { display: block; font-size: 0.75rem; color: var(--text-secondary); }
.col-id { width: 50px; }
.gov-id-thumb {
    display: inline-block; width: 32px; height: 32px; border-radius: 4px;
    overflow: hidden; border: 1px solid var(--border-color); vertical-align: middle; margin-right: 3px;
}
.gov-id-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gov-id-pdf {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 700; background: var(--bg-tertiary); color: var(--text-secondary);
}
.col-time { white-space: nowrap; font-size: 0.75rem; color: var(--text-secondary); min-width: 60px; }
.col-actions { min-width: 180px; }
.inline-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.inline-actions form { display: flex; gap: 4px; align-items: center; }
.form-input-xs { padding: 3px 6px; font-size: 0.72rem; width: 120px; }
.text-muted { color: var(--text-tertiary); font-size: 0.75rem; }

/* ===== Admin Section Headers ===== */
.admin-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.admin-section-header h2 { font-size: 1.1rem; margin-bottom: 0; }
.admin-section { margin-bottom: 32px; }
.admin-header-actions { display: flex; gap: 12px; align-items: center; }
.pending-count { font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }

/* ===== Stat Links ===== */
.stat-link { text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.stat-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); text-decoration: none; }

/* ===== Modal Large (Review) ===== */
.modal-lg { max-width: 720px; }
.review-profile { display: flex; gap: 20px; margin-bottom: 20px; }
.review-avatar { flex-shrink: 0; }
.review-avatar img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color); }
.review-info { flex: 1; }
.review-info h3 { font-size: 1.1rem; margin-bottom: 4px; }
.review-info .review-username { color: var(--accent); font-size: 0.9rem; margin-bottom: 8px; }
.review-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.review-field { font-size: 0.82rem; }
.review-field label { color: var(--text-secondary); font-weight: 600; display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.3px; }
.review-field span { color: var(--text-primary); }

.review-id-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.review-id-section h4 { font-size: 0.9rem; margin-bottom: 10px; color: var(--text-secondary); }
.review-id-gallery { display: flex; gap: 12px; flex-wrap: wrap; }
.review-id-img {
    max-width: 300px; max-height: 240px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-color); cursor: pointer; transition: transform 0.15s;
}
.review-id-img:hover { transform: scale(1.02); }
.review-id-pdf-link {
    display: flex; align-items: center; gap: 6px; padding: 12px 16px;
    background: var(--bg-tertiary); border-radius: var(--radius-sm); text-decoration: none;
    color: var(--text-primary); font-weight: 500; font-size: 0.85rem;
    transition: background var(--transition);
}
.review-id-pdf-link:hover { background: var(--bg-hover); text-decoration: none; }

/* ===== Modal Footer Actions ===== */
.modal-footer-actions { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.reject-group { display: flex; gap: 8px; align-items: center; flex: 1; max-width: 400px; }
.reject-group .form-input { flex: 1; }

@media (max-width: 600px) {
    .review-profile { flex-direction: column; align-items: center; text-align: center; }
    .review-fields { grid-template-columns: 1fr; }
    .modal-footer-actions { flex-direction: column; gap: 8px; }
    .reject-group { max-width: 100%; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ===== Animations ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.post-card { animation: fadeIn 0.3s ease; }

/* ===== Admin Toast ===== */
.admin-toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 3000;
    padding: 12px 20px; border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: 500; color: #fff;
    transform: translateY(20px); opacity: 0;
    transition: all 0.3s ease; pointer-events: none;
}
.admin-toast.show { transform: translateY(0); opacity: 1; }
.admin-toast-success { background: #28a745; }
.admin-toast-error { background: #dc3545; }

/* ===== Gov ID Image Popup ===== */
.gov-id-btn { white-space: nowrap; }
.id-popup-overlay {
    position: fixed; inset: 0; z-index: 5000;
    background: rgba(0,0,0,0.8); display: flex;
    align-items: center; justify-content: center; padding: 16px;
    animation: fadeIn 0.2s ease;
}
.id-popup-content {
    background: var(--bg-card); border-radius: var(--radius-md);
    max-width: 90vw; max-height: 90vh; overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.id-popup-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; border-bottom: 1px solid var(--border-light);
    font-weight: 600; font-size: 0.85rem;
}
.id-popup-close {
    background: none; border: none; font-size: 1.4rem; cursor: pointer;
    color: var(--text-secondary); padding: 2px 6px; line-height: 1;
}
.id-popup-close:hover { color: var(--text-primary); }
.id-popup-content img {
    display: block; max-width: 85vw; max-height: 80vh;
    object-fit: contain;
}

/* ===== Dynamic Elements ===== */
.comments-list { margin-top: 12px; }
.comment-item { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border-light); }
.comment-avatar { flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-like-btn { background: none; border: none; cursor: pointer; color: var(--text-secondary); font-size: 0.75rem; padding: 2px 4px; }
.comment-like-btn:hover { color: var(--accent); }
.reply-btn { background: none; border: none; cursor: pointer; color: var(--text-secondary); font-size: 0.75rem; padding: 2px 4px; }
.reply-btn:hover { color: var(--accent); }
.notification-item { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background var(--transition); text-decoration: none; color: inherit; align-items: flex-start; }
.notification-item:hover { background: var(--bg-hover); }
.notification-item.unread { background: var(--bg-accent); font-weight: 500; }
.notification-item img { margin-top: 2px; }
.notification-item div { flex: 1; min-width: 0; }
.notification-item p { margin: 0 0 2px; font-size: 0.85rem; line-height: 1.3; }
.notification-item small { color: var(--text-secondary); font-size: 0.75rem; }

/* ===== Stories ===== */
.story-add { position: absolute; bottom: -2px; right: -2px; width: 22px; height: 22px; background: var(--accent); color: #fff; border-radius: 50%; border: 2px solid var(--bg-card); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; line-height: 1; }
.story-ring { position: relative; }
.story-ring.has-story { border-color: var(--accent); }
.story-ring.viewed { border-color: #ccc; }
.story-view-btn { cursor: pointer; }
.story-view-btn:hover { opacity: 0.85; }

/* Story Viewer */
.story-viewer-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.92); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.story-viewer-container { position: relative; width: 100%; max-width: 420px; height: 100%; max-height: 750px; background: #1a1a2e; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.story-close-btn { position: absolute; top: 10px; right: 14px; z-index: 10; background: none; border: none; color: var(--text-primary); font-size: 28px; cursor: pointer; line-height: 1; opacity: 0.8; }
.story-close-btn:hover { opacity: 1; }
.story-viewer-container .story-close-btn { color: #fff; }
.story-mute-btn { position: absolute; bottom: 16px; right: 16px; z-index: 10; background: rgba(0,0,0,0.5); border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.story-mute-btn.muted .mute-off { display: none; }
.story-viewer-header { display: flex; align-items: center; gap: 10px; padding: 12px 50px 12px 16px; position: relative; z-index: 5; }
.story-viewer-header img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.story-viewer-header span { color: #fff; font-weight: 600; font-size: 14px; }
.story-viewer-header small { color: rgba(255,255,255,0.6); font-size: 12px; }
.story-delete-btn { margin-left: auto; background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer; padding: 4px; flex-shrink: 0; }
.story-delete-btn:hover { color: #ff4757; }
.story-viewer-progress { display: flex; gap: 3px; padding: 0 16px 8px; position: relative; z-index: 5; }
.story-bar-segment { flex: 1; height: 3px; background: rgba(255,255,255,0.3); border-radius: 2px; overflow: hidden; }
.story-bar-segment.done { background: #fff; }
.story-bar-segment.active { background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,0.3) 0%); animation: storyProgress 5s linear forwards; }
@keyframes storyProgress { from { background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,0.3) 0%); } to { background: linear-gradient(90deg, #fff 100%, rgba(255,255,255,0.3) 100%); } }
.story-viewer-content { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.story-media { width: 100%; height: 100%; object-fit: contain; }
.story-text-slide { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; font-size: 1.4rem; font-weight: 600; line-height: 1.5; word-break: break-word; }
.story-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; background: rgba(255,255,255,0.15); border: none; color: #fff; font-size: 32px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.story-nav-btn:hover { background: rgba(255,255,255,0.3); }
.story-prev { left: 8px; }
.story-next { right: 8px; }

/* Story Creator */
.story-creator-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.story-creator-container { width: 100%; max-width: 440px; background: var(--bg-card); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; max-height: 85vh; position: relative; }
.story-creator-container h3 { padding: 16px 20px 8px; margin: 0; font-size: 1.1rem; }
.story-creator-tabs { display: flex; gap: 0; padding: 0 20px; }
.story-tab { flex: 1; padding: 10px; border: none; background: none; font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; }
.story-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.story-creator-body { flex: 1; padding: 16px 20px; display: flex; align-items: center; justify-content: center; overflow-y: auto; min-height: 280px; }
.story-upload-area { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px; border: 2px dashed var(--border-color); border-radius: 12px; cursor: pointer; width: 100%; color: var(--text-secondary); transition: border-color 0.2s; }
.story-upload-area:hover { border-color: var(--accent); }
.story-upload-area p { margin: 0; font-size: 0.9rem; }
.story-preview { width: 100%; text-align: center; }
.story-preview img { max-width: 100%; max-height: 400px; border-radius: 12px; object-fit: contain; }
.story-text-area { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.story-text-preview { width: 100%; min-height: 200px; border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 24px; transition: background 0.3s, color 0.3s; }
.story-text-preview textarea { width: 100%; min-height: 140px; border: none; background: transparent; color: inherit; font-size: 1.3rem; font-weight: 600; text-align: center; resize: none; outline: none; font-family: inherit; }
.story-text-colors { display: flex; gap: 8px; justify-content: center; }
.color-btn { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: transform 0.15s; }
.color-btn.active { border-color: var(--accent); transform: scale(1.15); }
.story-creator-footer { padding: 12px 20px 16px; }

/* ===== Share Modal ===== */
.share-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 10000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.share-modal { background: var(--bg-card); border-radius: 16px; width: 100%; max-width: 400px; overflow: hidden; box-shadow: 0 16px 48px rgba(0,0,0,0.2); }
.share-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.share-modal-header h3 { margin: 0; font-size: 1rem; }
.share-modal-close { background: none; border: none; font-size: 22px; color: var(--text-secondary); cursor: pointer; padding: 0 4px; line-height: 1; }
.share-modal-close:hover { color: var(--text-primary); }
.share-modal-body { padding: 16px 20px 20px; }
.share-copy-row { display: flex; gap: 8px; margin-bottom: 16px; }
.share-copy-row .form-input { flex: 1; font-size: 0.85rem; background: var(--bg-primary); }
.share-platforms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.share-platform { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: none; background: none; cursor: pointer; text-decoration: none; color: var(--text-primary); border-radius: var(--radius-md); transition: background 0.15s; }
.share-platform:hover { background: var(--bg-hover); text-decoration: none; }
.share-platform-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.share-platform-icon.whatsapp { background: #25d366; }
.share-platform-icon.facebook { background: #1877f2; }
.share-platform-icon.twitter { background: #000; }
.share-platform-icon.native { background: var(--accent); }
.share-platform span { font-size: 0.72rem; color: var(--text-secondary); }

/* ===== Toast ===== */
.toast-container { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 10001; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #1e1e2e; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 0.85rem; font-weight: 500; opacity: 0; transform: translateY(12px); transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.3); white-space: nowrap; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
    .share-modal { margin: 0 12px; max-width: calc(100vw - 24px); }
    .share-platforms { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

.upload-progress-overlay {
    position: fixed; inset: 0; z-index: 50000;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(2px);
}
.upload-progress-box {
    background: var(--bg-card); border-radius: 12px; padding: 24px 32px;
    min-width: 280px; text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.upload-progress-text {
    font-weight: 600; font-size: 0.95rem; margin-bottom: 16px;
    color: var(--text-primary);
}
.upload-progress-bar-track {
    width: 100%; height: 6px; background: var(--border-light);
    border-radius: 3px; overflow: hidden;
}
.upload-progress-bar-fill {
    width: 0%; height: 100%; background: #0095f6;
    border-radius: 3px; transition: width 0.2s ease;
}
.upload-progress-percent {
    margin-top: 10px; font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary);
}
