/* ============================================
   LiteBook - Facebook Lite Clone
   Main Stylesheet - Mobile First Design
   ============================================ */

:root {
    --fb-blue: #1877F2;
    --fb-blue-dark: #166FE5;
    --fb-blue-light: #E7F0FD;
    --fb-green: #42B72A;
    --fb-green-dark: #36A420;
    --fb-red: #E41E3F;
    --fb-gray-bg: #F0F2F5;
    --fb-gray-light: #F7F8FA;
    --fb-gray-border: #D8DADF;
    --fb-gray-text: #65676B;
    --fb-dark-text: #050505;
    --fb-secondary: #65676B;
    --fb-hover: #F0F2F5;
    --fb-white: #FFFFFF;
    --fb-shadow: 0 1px 2px rgba(0,0,0,0.1);
    --fb-shadow-lg: 0 2px 8px rgba(0,0,0,0.15);
    --nav-height: 50px;
    --bottom-nav-height: 50px;
    --max-width: 600px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--fb-gray-bg);
    color: var(--fb-dark-text);
    line-height: 1.4;
    font-size: 15px;
    padding-bottom: var(--bottom-nav-height);
    min-height: 100vh;
}

a {
    color: var(--fb-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

/* ============ AUTH PAGES ============ */

.auth-page {
    min-height: 100vh;
    background: var(--fb-gray-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 16px;
}

.auth-container {
    width: 100%;
    max-width: 396px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 16px;
}

.auth-logo h1 {
    color: var(--fb-blue);
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.auth-logo p {
    color: var(--fb-dark-text);
    font-size: 18px;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.3;
}

.auth-card {
    background: var(--fb-white);
    border-radius: 8px;
    box-shadow: var(--fb-shadow-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--fb-gray-border);
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 12px;
    background: var(--fb-white);
    color: var(--fb-dark-text);
    transition: border-color 0.15s;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--fb-blue);
    box-shadow: 0 0 0 2px rgba(24,119,242,0.2);
}

.auth-form input::placeholder {
    color: #909499;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 16px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    transition: background 0.15s;
    font-family: inherit;
}

.btn-primary {
    background: var(--fb-blue);
    color: var(--fb-white);
}

.btn-primary:hover {
    background: var(--fb-blue-dark);
    text-decoration: none;
}

.btn-green {
    background: var(--fb-green);
    color: var(--fb-white);
}

.btn-green:hover {
    background: var(--fb-green-dark);
    text-decoration: none;
}

.btn-secondary {
    background: var(--fb-gray-light);
    color: var(--fb-dark-text);
    border: 1px solid var(--fb-gray-border);
}

.btn-secondary:hover {
    background: var(--fb-hover);
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    width: auto;
}

.auth-divider {
    border-bottom: 1px solid var(--fb-gray-border);
    margin: 16px 0;
}

.auth-footer {
    text-align: center;
    font-size: 14px;
}

.auth-footer a {
    color: var(--fb-dark-text);
    font-weight: 600;
}

.flash-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    text-align: center;
}

.flash-error {
    background: #FDE7E9;
    color: var(--fb-red);
    border: 1px solid #FADCE0;
}

.flash-success {
    background: #DFF5E0;
    color: var(--fb-green-dark);
    border: 1px solid #C8ECC9;
}

.form-error {
    color: var(--fb-red);
    font-size: 13px;
    margin-top: -8px;
    margin-bottom: 12px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row > * {
    flex: 1;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--fb-gray-text);
    margin-bottom: 6px;
    font-weight: 600;
}

/* ============ TOP NAVIGATION ============ */

.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--fb-white);
    height: var(--nav-height);
    border-bottom: 1px solid var(--fb-gray-border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    box-shadow: var(--fb-shadow);
}

.top-nav .nav-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--fb-blue);
    margin-right: auto;
    letter-spacing: -0.5px;
}

.top-nav-icons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--fb-dark-text);
    position: relative;
    transition: background 0.15s;
}

.nav-icon:hover {
    background: var(--fb-hover);
    text-decoration: none;
}

.nav-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

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

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--fb-gray-border);
}

.search-bar {
    flex: 1;
    margin: 0 8px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: none;
    border-radius: 20px;
    background: var(--fb-gray-bg);
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    background: var(--fb-white);
    box-shadow: 0 0 0 2px var(--fb-blue);
}

.search-bar svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: var(--fb-gray-text);
}

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

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--fb-white);
    border-top: 1px solid var(--fb-gray-border);
    display: flex;
    z-index: 100;
    max-width: var(--max-width);
    margin: 0 auto;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fb-gray-text);
    position: relative;
    transition: color 0.15s;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--fb-blue);
    text-decoration: none;
}

.bottom-nav-item svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

/* ============ MAIN LAYOUT ============ */

.main-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 8px;
}

.page-content {
    padding-bottom: 20px;
}

.page-header {
    background: var(--fb-white);
    padding: 12px 16px;
    border-bottom: 1px solid var(--fb-gray-border);
    position: sticky;
    top: var(--nav-height);
    z-index: 50;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
}

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

.card {
    background: var(--fb-white);
    border-radius: 8px;
    box-shadow: var(--fb-shadow);
    margin-bottom: 8px;
    overflow: hidden;
}

.card-header {
    padding: 12px;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--fb-gray-border);
}

/* ============ POST COMPOSER ============ */

.composer {
    background: var(--fb-white);
    border-radius: 8px;
    box-shadow: var(--fb-shadow);
    margin-bottom: 8px;
    padding: 12px;
}

.composer-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.composer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.composer-input {
    flex: 1;
    background: var(--fb-gray-bg);
    border: none;
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 15px;
    color: var(--fb-dark-text);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.composer-input:hover {
    background: var(--fb-hover);
}

.composer-divider {
    height: 1px;
    background: var(--fb-gray-border);
    margin: 10px 0;
}

.composer-actions {
    display: flex;
    gap: 4px;
}

.composer-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 6px;
    color: var(--fb-gray-text);
    font-weight: 600;
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.composer-btn:hover {
    background: var(--fb-hover);
}

.composer-btn svg {
    width: 20px;
    height: 20px;
}

.composer-textarea {
    width: 100%;
    border: none;
    resize: vertical;
    min-height: 80px;
    padding: 8px 0;
    font-size: 16px;
    font-family: inherit;
    background: transparent;
}

.composer-textarea:focus {
    outline: none;
}

.composer-preview {
    margin-top: 10px;
    position: relative;
}

.composer-preview img {
    width: 100%;
    border-radius: 8px;
    max-height: 400px;
    object-fit: cover;
}

.composer-preview .remove-img {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.composer-actions-bar {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.composer-actions-bar .btn {
    width: auto;
    flex: 0;
}

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

.post {
    background: var(--fb-white);
    border-radius: 8px;
    box-shadow: var(--fb-shadow);
    margin-bottom: 8px;
}

.post-header {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    gap: 10px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.post-meta {
    flex: 1;
    min-width: 0;
}

.post-author {
    font-weight: 600;
    font-size: 15px;
    color: var(--fb-dark-text);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.post-author a {
    color: var(--fb-dark-text);
}

.post-author a:hover {
    color: var(--fb-blue);
    text-decoration: underline;
}

.post-subtext {
    font-size: 12px;
    color: var(--fb-gray-text);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.post-subtext .privacy-icon {
    width: 12px;
    height: 12px;
    fill: var(--fb-gray-text);
}

.post-menu {
    margin-left: auto;
    position: relative;
}

.post-menu-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-menu-btn:hover {
    background: var(--fb-hover);
}

.post-menu-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--fb-gray-text);
}

.post-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--fb-white);
    border-radius: 8px;
    box-shadow: var(--fb-shadow-lg);
    min-width: 180px;
    z-index: 10;
    display: none;
    overflow: hidden;
}

.post-menu-dropdown.show {
    display: block;
}

.post-menu-dropdown a,
.post-menu-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    color: var(--fb-dark-text);
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.post-menu-dropdown a:hover,
.post-menu-dropdown button:hover {
    background: var(--fb-hover);
    text-decoration: none;
    color: var(--fb-dark-text);
}

.post-content {
    padding: 0 12px 12px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-image {
    width: 100%;
    cursor: pointer;
}

.post-image img {
    width: 100%;
    display: block;
}

.post-stats {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--fb-gray-text);
    border-bottom: 1px solid var(--fb-gray-border);
}

.post-stats .likes-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

.like-icon-small {
    width: 18px;
    height: 18px;
    background: var(--fb-blue);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.like-icon-small svg {
    width: 12px;
    height: 12px;
    fill: white;
}

.post-stats .comments-count {
    margin-left: auto;
}

.post-actions {
    display: flex;
    border-bottom: 1px solid var(--fb-gray-border);
}

.post-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    color: var(--fb-gray-text);
    font-weight: 600;
    font-size: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    border-radius: 0;
    transition: background 0.15s;
}

.post-action-btn:hover {
    background: var(--fb-hover);
}

.post-action-btn svg {
    width: 20px;
    height: 20px;
}

.post-action-btn.liked {
    color: var(--fb-blue);
}

.post-action-btn.liked svg {
    fill: var(--fb-blue);
}

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

.comments-section {
    padding: 8px 12px 12px;
}

.comment {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-bubble {
    background: var(--fb-gray-bg);
    border-radius: 18px;
    padding: 8px 12px;
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--fb-dark-text);
}

.comment-text {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.comment-meta {
    font-size: 11px;
    color: var(--fb-gray-text);
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

.comment-meta a {
    color: var(--fb-gray-text);
    font-weight: 600;
}

.comment-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.comment-form input {
    flex: 1;
    border: none;
    background: var(--fb-gray-bg);
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 14px;
    font-family: inherit;
}

.comment-form input:focus {
    outline: none;
    background: var(--fb-white);
    box-shadow: 0 0 0 2px var(--fb-blue);
}

.comment-form button {
    background: none;
    border: none;
    color: var(--fb-blue);
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
    font-family: inherit;
}

.comment-form button:disabled {
    color: var(--fb-gray-border);
    cursor: default;
}

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

.profile-cover {
    height: 180px;
    background: linear-gradient(135deg, #1877F2, #42B72A);
    position: relative;
    overflow: hidden;
}

.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-cover-gradient {
    background: linear-gradient(135deg, #1877F2 0%, #166FE5 50%, #0A5BC4 100%);
}

.profile-header {
    background: var(--fb-white);
    padding: 0 0 12px;
    text-align: center;
    position: relative;
    margin-bottom: 8px;
}

.profile-avatar-wrapper {
    position: relative;
    margin-top: -60px;
    display: inline-block;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--fb-white);
    object-fit: cover;
    background: var(--fb-white);
}

.profile-avatar-edit {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--fb-gray-bg);
    border: 2px solid var(--fb-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.profile-avatar-edit svg {
    width: 18px;
    height: 18px;
    fill: var(--fb-dark-text);
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    margin-top: 8px;
}

.profile-username {
    color: var(--fb-gray-text);
    font-size: 14px;
    margin-bottom: 8px;
}

.profile-bio {
    color: var(--fb-gray-text);
    font-size: 14px;
    padding: 0 16px;
    margin-bottom: 8px;
}

.profile-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-actions .btn {
    width: auto;
    flex: 1;
    min-width: 120px;
}

.profile-info-grid {
    background: var(--fb-white);
    border-radius: 8px;
    box-shadow: var(--fb-shadow);
    margin-bottom: 8px;
    padding: 12px;
}

.profile-info-grid h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: var(--fb-gray-text);
    font-size: 14px;
}

.info-item svg {
    width: 20px;
    height: 20px;
    fill: var(--fb-gray-text);
    flex-shrink: 0;
}

/* ============ TABS ============ */

.tabs {
    display: flex;
    background: var(--fb-white);
    border-bottom: 1px solid var(--fb-gray-border);
    overflow-x: auto;
    position: sticky;
    top: var(--nav-height);
    z-index: 40;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 14px 8px;
    color: var(--fb-gray-text);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    cursor: pointer;
}

.tab:hover {
    background: var(--fb-hover);
    text-decoration: none;
    color: var(--fb-gray-text);
}

.tab.active {
    color: var(--fb-blue);
    border-bottom-color: var(--fb-blue);
}

/* ============ FRIENDS / PEOPLE LIST ============ */

.person-card {
    background: var(--fb-white);
    border-radius: 8px;
    box-shadow: var(--fb-shadow);
    margin-bottom: 8px;
    overflow: hidden;
    display: flex;
}

.person-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    flex-shrink: 0;
}

.person-info {
    flex: 1;
    padding: 10px;
    min-width: 0;
}

.person-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-name a {
    color: var(--fb-dark-text);
}

.person-subtext {
    font-size: 12px;
    color: var(--fb-gray-text);
    margin-bottom: 8px;
}

.person-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.person-actions .btn {
    width: auto;
    flex: 1;
    min-width: 90px;
    padding: 6px 10px;
    font-size: 13px;
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.person-grid-card {
    background: var(--fb-white);
    border-radius: 8px;
    box-shadow: var(--fb-shadow);
    overflow: hidden;
}

.person-grid-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.person-grid-info {
    padding: 8px;
    text-align: center;
}

.person-grid-info .person-name {
    font-size: 14px;
    margin-bottom: 6px;
}

.person-grid-info .btn {
    width: 100%;
    padding: 6px;
    font-size: 13px;
}

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

.conversation-list {
    background: var(--fb-white);
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--fb-gray-border);
    cursor: pointer;
    position: relative;
}

.conversation-item:hover {
    background: var(--fb-hover);
    text-decoration: none;
}

.conversation-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--fb-dark-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 13px;
    color: var(--fb-gray-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 11px;
    color: var(--fb-gray-text);
}

.unread-dot {
    width: 10px;
    height: 10px;
    background: var(--fb-blue);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Chat view */
.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--fb-white);
    border-bottom: 1px solid var(--fb-gray-border);
    position: sticky;
    top: var(--nav-height);
    z-index: 40;
}

.chat-header img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header .chat-name {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
}

.chat-back {
    color: var(--fb-blue);
    font-size: 20px;
    padding: 4px 8px;
}

.chat-messages {
    padding: 12px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

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

.message-bubble.received {
    align-self: flex-start;
    background: var(--fb-white);
    color: var(--fb-dark-text);
    border-bottom-left-radius: 4px;
    box-shadow: var(--fb-shadow);
}

.message-time {
    font-size: 10px;
    color: var(--fb-gray-text);
    margin-top: 2px;
}

.message-time.sent {
    text-align: right;
}

.chat-input-bar {
    position: fixed;
    bottom: var(--bottom-nav-height);
    left: 0;
    right: 0;
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: var(--fb-white);
    border-top: 1px solid var(--fb-gray-border);
    z-index: 50;
}

.chat-input-bar input {
    flex: 1;
    border: 1px solid var(--fb-gray-border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    font-family: inherit;
}

.chat-input-bar input:focus {
    outline: none;
    border-color: var(--fb-blue);
}

.chat-input-bar button {
    background: none;
    border: none;
    color: var(--fb-blue);
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
    font-family: inherit;
}

.chat-input-bar button:disabled {
    color: var(--fb-gray-border);
}

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

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--fb-white);
    border-bottom: 1px solid var(--fb-gray-border);
}

.notification-item.unread {
    background: var(--fb-blue-light);
}

.notification-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.notification-icon-wrapper {
    position: relative;
    flex-shrink: 0;
}

.notification-type-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--fb-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-type-icon.like { background: var(--fb-blue); }
.notification-type-icon.comment { background: #00A878; }
.notification-type-icon.friend { background: #9B59B6; }
.notification-type-icon.message { background: var(--fb-green); }

.notification-type-icon svg {
    width: 12px;
    height: 12px;
    fill: white;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    font-size: 14px;
    line-height: 1.4;
}

.notification-text strong {
    font-weight: 600;
}

.notification-time {
    font-size: 12px;
    color: var(--fb-gray-text);
    margin-top: 2px;
}

/* ============ MENU PAGE ============ */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.menu-grid-item {
    background: var(--fb-white);
    border-radius: 8px;
    box-shadow: var(--fb-shadow);
    padding: 16px 8px;
    text-align: center;
    color: var(--fb-dark-text);
}

.menu-grid-item:hover {
    text-decoration: none;
    background: var(--fb-hover);
}

.menu-grid-item svg {
    width: 28px;
    height: 28px;
    fill: var(--fb-blue);
    margin: 0 auto 6px;
}

.menu-grid-item span {
    display: block;
    font-size: 12px;
    font-weight: 600;
}

.menu-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    background: var(--fb-white);
    border-bottom: 1px solid var(--fb-gray-border);
    color: var(--fb-dark-text);
}

.menu-list-item:hover {
    background: var(--fb-hover);
    text-decoration: none;
    color: var(--fb-dark-text);
}

.menu-list-item svg {
    width: 22px;
    height: 22px;
    fill: var(--fb-blue);
    flex-shrink: 0;
}

.menu-list-item span {
    flex: 1;
    font-size: 15px;
}

.menu-list-item .arrow {
    fill: var(--fb-gray-text);
    width: 16px;
    height: 16px;
}

/* ============ UTILITIES ============ */

.text-center { text-align: center; }
.text-muted { color: var(--fb-gray-text); }
.text-small { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-12 { padding: 12px; }
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--fb-gray-text);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    fill: var(--fb-gray-border);
    margin: 0 auto 12px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--fb-dark-text);
    margin-bottom: 4px;
}

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

.hashtag {
    color: var(--fb-blue);
    font-weight: 500;
}

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

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-sheet {
    background: var(--fb-white);
    width: 100%;
    max-width: var(--max-width);
    border-radius: 12px 12px 0 0;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--fb-gray-border);
    position: sticky;
    top: 0;
    background: var(--fb-white);
}

.modal-header h3 {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
}

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

.modal-close:hover {
    background: var(--fb-hover);
}

.modal-body {
    padding: 16px;
}

/* ============ RESPONSIVE ============ */

@media (min-width: 768px) {
    .main-container {
        padding: 16px;
    }
}

/* Avatar fallback background */
.avatar-fallback {
    background: var(--fb-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--fb-gray-border);
    border-top: 3px solid var(--fb-blue);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Online indicator */
.online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #42B72A;
    border-radius: 50%;
    border: 2px solid var(--fb-white);
}
