/* btbroo global theme and responsive components */

:root {
    --brand: #7c3aed;
    --brand-2: #6d28d9;
    --accent: #a855f7;
    --fg: #17202a;
    --muted: #687582;
    --bg: #f4f7f9;
    --card: #ffffff;
    --border: #dce4e8;
    --shadow: 0 10px 30px rgba(23, 32, 42, .08);
    --radius: 14px;
    --transition-speed: 0.22s;
}

/* Base resets */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { margin: 0; font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif; color: var(--fg); background: radial-gradient(circle at 0 0, rgba(168,85,247,.12), transparent 32rem), var(--bg); line-height: 1.55; }

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); text-decoration: none; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid rgba(124,58,237,.35); outline-offset: 2px; }

/* Layout helpers */
.container { width: min(1100px, 94%); margin: 0 auto; }
.row { display: flex; gap: 16px; }
.col { flex: 1; }
.hidden { display: none !important; }

/* Top Bar */
#top-bar {
    min-height: 60px;
    background: linear-gradient(120deg, var(--brand-2), var(--brand) 58%, var(--accent) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 101;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.bt-container { width: min(1100px, 94%); margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 0; }
.brand { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; font-size: 32px; letter-spacing: .2px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; opacity: 0.8; }

/* ===== Modern Navigation Bar ===== */
.main-nav {
    display: block;
    background: var(--card);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 60px;
    z-index: 100;
    width: 100%;
    margin: 0 auto;
    max-width: 1200px;
    border-radius: 0 0 16px 16px;
}

@media (min-width: 769px) {
    .main-nav {
        margin-top: 29px; /* More gap from top bar on desktop */
        top: 89px; /* 60px + 29px margin */
    }
}

.main-nav-list {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 8px 16px;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.main-nav-list::-webkit-scrollbar {
    display: none;
}

.main-nav-item {
    flex-shrink: 0;
}

.main-nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    position: relative;
    white-space: nowrap;
    min-width: 120px;
    justify-content: center;
}

.main-nav-item a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    border-radius: 12px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.main-nav-item a:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.main-nav-item a:hover::before,
.main-nav-item a.active::before {
    opacity: 1;
    transform: scale(1);
}

.main-nav-item a.active {
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.main-nav-item a i {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.main-nav-item a:hover i {
    transform: scale(1.15);
}

.main-nav-item a.logout-nav-link {
    color: #ef4444;
}

.main-nav-item a.logout-nav-link::before {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.main-nav-item a.logout-nav-link:hover {
    color: #fff;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.theme-dark .main-nav {
    background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
    border-bottom-color: #333;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.theme-dark .main-nav-item a {
    color: var(--muted);
}

.theme-dark .main-nav-item a:hover,
.theme-dark .main-nav-item a.active {
    color: #fff;
}

/* Mobile responsive navigation */
@media (max-width: 768px) {
    .main-nav {
        top: 56px;
        border-radius: 0;
        max-width: 100%;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .main-nav-list {
        padding: 6px 12px;
        gap: 2px;
        justify-content: flex-start;
    }
    
    .main-nav-item a {
        padding: 12px 16px;
        font-size: 13px;
        min-width: auto;
        border-radius: 10px;
    }
    
    .main-nav-item .nav-text {
        display: inline;
    }
}

@media (max-width: 480px) {
    .main-nav-list {
        padding: 4px 8px;
    }
    
    .main-nav-item a {
        padding: 10px 12px;
        font-size: 12px;
        gap: 6px;
    }
    
    .main-nav-item a i {
        font-size: 1.1rem;
    }
    
    .main-nav-item .nav-text {
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .main-nav-item a {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .main-nav-item .nav-text {
        display: none;
    }
    
    .main-nav-item a {
        justify-content: center;
        min-width: 44px;
    }
}

/* ===== Profile Section Navigation ===== */
.profile-section-nav {
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin: 16px auto;
    max-width: 1200px;
    padding: 8px;
    border: 1px solid var(--border);
    position: sticky;
    top: 120px;
    z-index: 90;
}

.profile-nav-list {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.profile-nav-list::-webkit-scrollbar {
    display: none;
}

.profile-nav-item {
    flex-shrink: 0;
}

.profile-nav-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    font-weight: 600;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    position: relative;
    white-space: nowrap;
    min-width: 110px;
    justify-content: center;
}

.profile-nav-item a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    border-radius: 10px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.profile-nav-item a:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.profile-nav-item a:hover::before,
.profile-nav-item a.active::before {
    opacity: 1;
    transform: scale(1);
}

.profile-nav-item a.active {
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.profile-nav-item a i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.profile-nav-item a:hover i {
    transform: scale(1.15);
}

.profile-nav-item a .count {
    background: rgba(124, 58, 237, 0.15);
    color: var(--brand);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
    transition: all 0.3s ease;
}

.profile-nav-item a:hover .count,
.profile-nav-item a.active .count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.theme-dark .profile-section-nav {
    background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
    border-color: #333;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.theme-dark .profile-nav-item a {
    color: var(--muted);
}

.theme-dark .profile-nav-item a:hover,
.theme-dark .profile-nav-item a.active {
    color: #fff;
}

.theme-dark .profile-nav-item a .count {
    background: rgba(124, 58, 237, 0.2);
    color: var(--accent);
}

@media (max-width: 768px) {
    .profile-section-nav {
        top: 110px;
        margin: 12px 12px 8px;
        border-radius: 12px;
        padding: 6px;
    }

    .profile-section-nav .profile-nav-list {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 4px 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none;
        -ms-overflow-style: none;
        white-space: nowrap !important;
        width: 100% !important;
    }

    .profile-section-nav .profile-nav-list::-webkit-scrollbar {
        display: none;
    }

    .profile-section-nav .profile-nav-item {
        flex: 0 0 auto !important;
    }

    .profile-section-nav .profile-nav-item a {
        display: inline-flex !important;
        padding: 10px 14px !important;
        font-size: 13px !important;
        min-width: 0 !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
    }

    .profile-section-nav .profile-nav-item a span {
        display: inline !important;
    }

    .profile-section-nav .profile-nav-item a .count {
        font-size: 10px !important;
        padding: 1px 6px !important;
    }
}

@media (max-width: 480px) {
    .profile-section-nav .profile-nav-list {
        padding: 3px 6px !important;
    }

    .profile-section-nav .profile-nav-item a {
        padding: 8px 12px !important;
        font-size: 12px !important;
        gap: 5px !important;
    }

    .profile-section-nav .profile-nav-item a i {
        font-size: 1rem !important;
    }

    .profile-section-nav .profile-nav-item a .count {
        display: inline-block !important;
    }
}

@media (max-width: 360px) {
    .profile-nav-item a {
        padding: 6px 10px;
        font-size: 11px;
        min-width: 36px;
        justify-content: center;
    }
    
    .profile-nav-item a span {
        display: none;
    }
    
    .profile-nav-item a i {
        font-size: 1.1rem;
    }
}

/* Live Search Results */
#live-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff; /* Always white for contrast */
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    transition: background-color 0.2s;
}
.search-result-item:hover {
    background-color: #f0f2f5;
}
.result-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.result-info { flex-grow: 1; }
.result-title { font-weight: 600; color: #1c1e21; }
.result-subtitle { font-size: 0.85rem; color: #65676b; }
.no-results { padding: 15px; text-align: center; color: #65676b; }
.user-card { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.user-card + .user-card { margin-top: 8px; }
.user-card:hover { border-color: var(--brand); box-shadow: 0 8px 18px rgba(23,32,42,.08); transform: translateY(-1px); }
.user-card-avatar { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; object-fit: cover; }
.user-card-details { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.user-card-details strong { overflow: hidden; color: var(--fg); text-overflow: ellipsis; white-space: nowrap; }
.user-card-details small { color: var(--muted); font-size: 12px; }
.user-card-arrow { color: var(--muted); font-size: 12px; }
.search-result-item:hover, .search-result-item:hover .result-title, .search-result-item:hover .result-subtitle {
    text-decoration: none;
}

/* Inputs */
.input, #text, #post-box, select#text { height: 44px; width: 100%; max-width: 360px; border-radius: 10px; border: 1px solid #d1d5db; padding: 8px 12px; font-size: 16px; outline: none; transition: border-color .2s ease, box-shadow .2s ease; background: #fff; }
.input:focus, #text:focus, #post-box:focus, select#text:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,.18); }

/* Cards and panels */
.card, #timeline-posts, #friends-bar, .panel {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.7s;
}
.card:hover::before { left: 100%; }

/* Profile & timeline common elements */
#cover-photo { width: min(1100px, 94%); margin: 16px auto; min-height: auto; }
#button-post { background: var(--brand); color: #fff; border-radius: 10px; padding: 10px 16px; width: auto; min-width: 100px; cursor: pointer; transition: background .2s ease, transform .06s ease; border: none; font-weight: 700; }
#button-post:hover { background: var(--brand-2); }
#posts { display: flex; gap: 12px; align-items: flex-start; }

/* Utilities */
.text-muted { color: var(--muted); }
.mt-2{ margin-top:8px } .mt-3{ margin-top:12px } .mt-4{ margin-top:16px }
.mb-2{ margin-bottom:8px } .mb-3{ margin-bottom:12px } .mb-4{ margin-bottom:16px }
.p-2{ padding:8px } .p-3{ padding:12px } .p-4{ padding:16px }
.rounded{ border-radius: var(--radius) }
.shadow{ box-shadow: var(--shadow) }

/* Responsive */
.profile-picture-container {
    display: flex;
    justify-content: center;
    margin-top: -80px;
}
.profile-picture {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 4px solid var(--card);
    box-shadow: var(--shadow);
}

@media (max-width: 1200px) {
  .container { width: 95%; }
}

@media (max-width: 900px) {
  .row { flex-direction: column; gap: 8px; }
  /* .bt-container { flex-direction: column; gap: 8px; } */
  /* #search-box { max-width: none; order: 2; } */
  /* .right { order: 3; margin-left: 0; } */
  #cover-photo { min-height: 200px; }
  .profile-picture { width: 120px; height: 120px; margin-top: -60px; }
  .main-nav-list { justify-content: flex-start; }
  /* .main-nav { top: 184px; } Adjusted for column layout of top-bar */
}

@media (max-width: 768px) {
  .container, .timeline-container, .profile-container, .group-container { padding: 10px; }
  .bt-container { padding: 8px 0; }
  #timeline-posts { padding: 8px; }
  .main-nav-item a { padding: 10px 12px; font-size: 13px; }
  .profile-header { padding: 20px; }
  .profile-avatar { width: 100px; height: 100px; }
  .profile-section-nav .profile-nav-list { flex-direction: row !important; justify-content: flex-start !important; align-items: center !important; overflow-x: auto !important; }
  .group-header { flex-direction: column; text-align: center; }
  .group-actions { flex-direction: column; width: 100%; }
  .group-btn { width: 100%; margin-bottom: 10px; }
    body { background: var(--bg); padding: 10px; }
  .main-nav-list {
    justify-content: space-around; /* Distribute items evenly */
  }
  .main-nav-item { flex: 1; text-align: center; }
  .container { padding: 0; }
  .post-card, .card { margin: 10px; border-radius: 16px; }
  #friends-bar .card { margin-bottom: 20px; }
  .post-create-box { margin: 10px; padding: 15px; }
  #top-bar .right a {
    flex: 1;
    text-align: center;
  }
  #top-bar .logout-link {
    font-size: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  #top-bar .logout-link::before {
    content: "\f2f5" !important;
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
    font-size: 24px !important;
  }
  /* Mobile styles for header icons */
  .header-icon {
    width: auto; /* Let flexbox handle the width */
    flex-grow: 1;
    background-color: transparent !important; /* Remove background on mobile */
    color: #fff !important; /* Always white on mobile */
  }
  .header-icon.active {
    color: #fff !important; /* Keep active icon white */
  }
}

@media (max-width: 480px) {
  .bt-container { font-size: 18px; }
  .profile-picture { width: 100px; margin-top: -50px; }
  .profile-name { font-size: 1.2rem; }
  .profile-username { font-size: 0.9rem; }
  #menu-button { padding: 6px 10px; font-size: 14px; }
  .post-card { margin-bottom: 12px; }
  .post-image { max-width: 100%; }
  .main-nav-item a { padding: 9px 10px; font-size: 12px; }
  .login-container, .forgot-password-container { padding: 20px; }
  .brand { font-size: 24px; }
  .login-card, .forgot-password-container { padding: 20px; }
  .timeline-post, .group-post, .post-create { padding: 12px; }
  .post-card, .card { padding: 15px; margin: 5px; }
  .post-create-box { padding: 12px; }
  #friends-bar img { width: 80px !important; height: 80px !important; }
}
@media (max-width: 600px) {
    .main-nav .nav-text {
        display: block;
        font-size: 10px;
        line-height: 1.1;
    }
    .main-nav-item a {
        justify-content: center;
    }
    .main-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .main-nav-list {
        min-height: 68px;
    }
    .main-nav-item a {
        min-height: 68px;
        padding-top: 8px;
        padding-bottom: 7px;
    }
    .main-nav-item a.active::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 4px;
        width: 18px;
        height: 3px;
        border-radius: 999px;
        background: #c084fc;
        transform: translateX(-50%);
        box-shadow: 0 0 12px rgba(192, 132, 252, 0.75);
    }
}

/* Subtle focus ring utility */
.focus-ring { box-shadow: 0 0 0 3px rgba(124,58,237,.18); }

/* Attractive button styles */
.btn-attractive {
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-attractive:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-attractive:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .btn-attractive {
        padding: 12px 24px;
        font-size: 16px;
    }
}

/* Post styles */
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border-color: var(--brand);
}
.post-card {
    background: linear-gradient(145deg, var(--card), rgba(255,255,255,0.1));
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}
.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.post-header-info {
    flex-grow: 1;
}
.post-author-name {
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}
.post-author-name:hover {
    text-decoration: underline;
}
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 5px;
    border-radius: 50%;
    color: #fff;
    background: #3b82f6;
    font-size: 9px;
    vertical-align: 1px;
}
.post-text.is-collapsed {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    overflow: hidden;
}
.post-see-more {
    margin-top: 6px;
    padding: 0;
    border: 0;
    color: var(--brand-2);
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.post-reaction-control {
    position: relative;
}
.post-reaction-palette {
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translate(-50%, 8px);
    padding: 7px;
    gap: 3px;
    white-space: nowrap;
}
.post-reaction-control:hover .post-reaction-palette,
.post-reaction-control:focus-within .post-reaction-palette {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}
.post-reaction-palette.reaction-palette-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translate(-50%, 8px) !important;
}
.reaction-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 3px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}
.reaction-choice:hover {
    background: rgba(124, 58, 237, 0.1);
    transform: translateY(-4px) scale(1.12);
}
.reaction-choice img {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
}

.post-actions .reaction-icon-small {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    object-fit: contain;
    flex: 0 0 18px;
}
.post-timestamp {
    font-size: 13px;
    color: #65676b;
}
.theme-dark .post-timestamp {
    color: #a8abaf;
}
.post-options {
    display: flex;
    gap: 8px;
}
.post-content p {
    margin: 0;
    line-height: 1.5;
}
.post-media img, .post-media video {
    max-width: 100%;
    border-radius: 12px;
    display: block;
}
.post-media {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}
.post-media video {
    width: min(100%, 920px);
    max-width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #000;
    filter: none;
    -webkit-filter: none;
    margin: 0 auto;
}
.post-video-player {
    isolation: isolate;
    position: relative;
    width: min(100%, 920px);
    max-width: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: radial-gradient(ellipse at 50% 35%, #1b2433 0%, #080b11 72%);
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    box-shadow: 0 16px 38px rgba(3, 7, 18, 0.25);
}
.post-video-label {
    position: absolute;
    z-index: 1;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #fff;
    background: rgba(8, 11, 17, 0.72);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    pointer-events: none;
    backdrop-filter: blur(8px);
}
.post-video-label i {
    color: #a78bfa;
    font-size: 9px;
}
.post-upload-hint {
    display: block;
    flex-basis: 100%;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}
.post-video-player video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    border-radius: 15px;
    filter: none;
    -webkit-filter: none;
    margin: 0 auto;
}
.post-video-player:fullscreen,
.post-video-player:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: #000;
}
.post-video-player:fullscreen video,
.post-video-player:-webkit-full-screen video {
    width: 100%;
    height: 100%;
    max-height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
}
.post-video-exit {
    display: none;
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 5;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 50%;
    color: #fff;
    background: rgba(15,23,42,.78);
    font-size: 22px;
    cursor: pointer;
}
.post-video-fullscreen {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 50%;
    color: #fff;
    background: rgba(15,23,42,.72);
    cursor: pointer;
}
.post-video-fullscreen:hover {
    background: rgba(124,58,237,.9);
}
.post-video-player:fullscreen .post-video-exit,
.post-video-player:-webkit-full-screen .post-video-exit {
    display: inline-flex;
}
.post-video-player:fullscreen .post-video-fullscreen,
.post-video-player:-webkit-full-screen .post-video-fullscreen {
    display: none;
}
.post-video-exit:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}
.post-stats {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    color: #65676b;
    border-bottom: 1px solid var(--border);
}
.theme-dark .post-stats {
    color: #a8abaf;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Responsive posts */
@media (max-width: 600px) {
  .post-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px;
    padding: 0 0 14px;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
  }

  .post-header {
    position: relative;
    z-index: 2;
    padding: 16px 14px 10px;
    background: rgba(255,255,255,0.74);
    backdrop-filter: blur(8px);
  }

  .post-content {
    padding: 0 14px 12px;
    color: var(--fg);
    font-size: 15px;
    line-height: 1.55;
  }

  .post-media {
    margin: 0;
    position: relative;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
  }

  .post-media::after {
    display: none;
  }

  .post-media img, .post-media video {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    border-radius: 12px;
    display: block;
    min-height: auto;
    max-height: none;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    filter: none;
    background: #020617;
  }

  .post-content p {
        margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.35);
  }

  .post-stats {
    padding: 12px 14px 0;
    color: rgba(255,255,255,0.8);
    border-bottom: none;
    border-top: 1px solid rgba(255,255,255,0.08);
        font-size: 12px;
        gap: 8px;
        white-space: nowrap;
  }

  .post-actions {
        position: relative;
        right: auto;
        bottom: auto;
    display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        gap: 4px;
        background: rgba(255,255,255,0.96);
        border-top: 1px solid rgba(15,23,42,0.08);
        border-bottom: 0;
        padding: 6px 8px;
        z-index: 4;
  }

  .action-btn {
    position: relative;
        flex: 1 1 0;
        width: auto;
        height: 42px;
        border-radius: 10px;
        justify-content: center;
        background: transparent;
        color: #475569;
        box-shadow: none;
        border: 0;
        padding: 0 8px;
        font-size: 17px;
    display: flex;
    align-items: center;
        gap: 7px;
  }

  .action-btn .reaction-text {
        display: inline;
        font-size: 12px;
        font-weight: 700;
    }

    .action-btn .action-label {
        display: inline;
        font-size: 12px;
        font-weight: 700;
  }

  .action-btn .action-count {
        position: static;
        transform: none;
        padding: 0;
        border-radius: 0;
        background: transparent;
        color: inherit;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.1;
        min-width: 0;
        text-align: left;
        box-shadow: none;
  }

  .action-btn:hover {
    transform: translateY(-2px) scale(1.04);
  }

    .post-card:has(.post-media) {
        min-height: auto;
        padding-bottom: 0;
        border: 1px solid rgba(15,23,42,0.08);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        background: var(--card);
    }

    .post-card:has(.post-media)::after {
        display: none;
    }

    .post-card:has(.post-media) .post-media {
        order: 3;
        width: 100%;
        aspect-ratio: 16 / 9;
        height: min(56.25vw, 420px);
        min-height: 0;
        z-index: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000;
        border-radius: 12px;
        padding: 0;
    }

    .post-card:has(.post-media) .post-media a {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 0;
        max-width: none;
        margin: 0 auto;
    }

    .post-card:has(.post-media) .post-media img,
    .post-card:has(.post-media) .post-media video {
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: none;
        margin-left: 0;
        object-fit: contain;
        aspect-ratio: auto;
        filter: none;
        background: #020617;
    }

    .post-card:has(.post-media video) .post-media::after {
        display: none;
    }

    .post-card:has(.post-media) .post-header {
        position: relative;
        inset: auto;
        order: 1;
        z-index: 1;
        padding: 16px 14px 10px;
        background: rgba(255,255,255,0.74);
    }

    .post-card:has(.post-media) .post-content {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        order: 2;
        z-index: 1;
        padding: 0 14px 12px;
        font-size: 15px;
        font-weight: 500;
    }

    .post-card:has(.post-media) .post-stats {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        order: 4;
        z-index: 1;
        padding: 12px 14px 0;
        border: 0;
        color: var(--muted);
    }

    .post-card:has(.post-media) .post-actions {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        order: 5;
        z-index: 1;
        background: rgba(255,255,255,0.96);
        border-top-color: rgba(15,23,42,0.08);
    }

    #main-content-container {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .post-card:has(.post-media) .action-btn {
        color: #475569;
    }

        .theme-dark .post-actions {
            background: rgba(15,23,42,0.96);
            border-top-color: rgba(255,255,255,0.1);
        }

    .post-card:has(.post-media) .action-btn:hover,
    .post-card:has(.post-media) .action-btn:active {
        background: rgba(0,0,0,0.04);
    }

  .post-author-name,
  .post-timestamp {
    color: inherit;
  }
}

.theme-dark .action-btn {
    color: #a8abaf;
}
.action-btn:hover {
    background-color: rgba(0,0,0,0.05);
}
.theme-dark .action-btn:hover {
    background-color: rgba(255,255,255,0.1);
}
.action-btn.active {
    color: var(--brand);
}
.post-comments {
    padding-top: 10px;
}
.comment-create {
    display: flex;
    gap: 8px;
    align-items: center;
}
.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}
.comment-create form {
    flex-grow: 1;
}

/* Profile layout responsiveness */
.profile-layout { display: flex; gap: 20px; }
@media (max-width: 768px) {
  .profile-layout { flex-direction: column; gap: 10px; }
}

/* Notifications */
.right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.profile-img { width: 120px; height: 120px; border-radius: 50%; border: 2px solid #fff; transition: transform 0.2s; object-fit: cover; }
.top-bar-profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
}
.profile-img:hover { transform: scale(1.05); }
.logout-link { color: #fff; font-size: 14px; text-decoration: none; padding: 8px 12px; border-radius: 6px; transition: background 0.2s; }
.logout-link:hover { background: rgba(255,255,255,0.1); }
.notification-link { position: relative; }
.notification-badge { position: absolute; top: -5px; right: -10px; background: #ef4444; color: #fff; border-radius: 50%; padding: 2px 6px; font-size: 12px; font-weight: bold; min-width: 20px; text-align: center; line-height: 16px; }
.notification-container { max-width: 800px; margin: 2rem auto; padding: 1rem; }
.notification-list { display: flex; flex-direction: column; gap: 0.75rem; }
.notification-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: background-color 0.3s, transform 0.2s;
    border-left: 4px solid transparent;
}
.notification-item:hover { background-color: #f0f2f5; transform: translateY(-2px); text-decoration: none; }
.notification-item.unread { border-left-color: var(--brand); background-color: #f0f3ff; }
.notification-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.notification-profile-link { display: inline-flex; flex: 0 0 auto; border-radius: 50%; }
.notification-actor-link { color: inherit; text-decoration: none; }
.notification-actor-link:hover,
.notification-actor-link:focus-visible { color: var(--brand); text-decoration: underline; }
.notification-content { flex-grow: 1; }
.notification-content p { margin: 0; line-height: 1.4; }
.notification-content .timestamp { font-size: 0.8rem; color: var(--muted); }
.notification-target-link { display: inline-block; margin-top: 4px; text-decoration: none; }
.notification-target-link:hover .timestamp { color: var(--brand); }
.no-notifications { text-align: center; padding: 3rem; background-color: var(--card); border-radius: var(--radius); }

/* Dark Theme */
.theme-dark {
  --bg: #121212;
  --card: #1e1e1e;
  --fg: #e4e6eb;
  --muted: #cccccc;
  --border: #333333;
}
.theme-dark body, .theme-dark .login-container {
    background: radial-gradient(circle at top, rgba(168,85,247,0.18), transparent 36%), linear-gradient(135deg, #111827 0%, #1f2937 100%);
}

.theme-dark #top-bar {
  background: linear-gradient(90deg, #333333, #555555);
}

.theme-dark .btn-primary {
  background: #555555;
  color: #ffffff;
}

.theme-dark .btn-primary:hover {
  background: #777777;
}

.theme-dark .input, .theme-dark #text, .theme-dark #post-box, .theme-dark select#text {
  background: #2a2a2a;
  color: var(--fg);
  border-color: #555555;
}

.theme-dark .card, .theme-dark #timeline-posts, .theme-dark #friends-bar, .theme-dark .panel {
  background: var(--card);
  color: var(--fg);
}

.theme-dark .notification-item:hover {
    background-color: #2a2a2a;
}

.theme-dark .notification-item.unread {
    background-color: #2c2c3a;
}
.theme-dark .post-card,
.theme-dark .card {
    background: linear-gradient(145deg, var(--card), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.1);
}

.post-create-box {
    background: linear-gradient(145deg, var(--card), rgba(255,255,255,0.1));
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    animation: bounceIn 0.6s ease-out;
}

.post-create-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}
.post-create-top img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.post-create-top textarea {
    flex-grow: 1;
    background: transparent;
    border: none;
    resize: none;
    font-size: 18px;
    color: inherit;
    font-family: inherit;
}
.post-create-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
}
.theme-dark .post-create-box, .theme-dark .login-card {
    background: linear-gradient(145deg, var(--card), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.1);
}
.comment-input {
    width: 100%;
    background-color: #f0f2f5;
    border: 1px solid #ccd0d5;
    border-radius: 16px;
    padding: 8px 12px;
    font-family: inherit;
}
.theme-dark .comment-input {
    background-color: #3a3b3c;
    border-color: #3a3b3c;
    color: #e4e6eb;
}

.view-more-comments-container {
    padding-top: 10px;
}

.view-more-comments {
    color: #606770;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

.view-more-comments:hover {
    text-decoration: underline;
}

.theme-dark .view-more-comments {
    color: #b0b3b8;
}

/* Profile Navigation */
.profile-nav {
    background-color: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    padding: 8px;
    margin-bottom: 16px;
}
.profile-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto; /* For smaller screens */
}
.profile-nav-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    color: var(--muted);
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}
.profile-nav-item a:hover {
    background-color: #f0f2f5;
    color: var(--fg);
    text-decoration: none;
}
.theme-dark .profile-nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.profile-nav-item a.active {
    background-color: var(--brand);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;

}
.profile-nav-item i {
    font-size: 1.1em;
}
.profile-nav-item a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.75s; /* Slightly slower for better visibility */
}

/* Group Styles */
.group-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.group-header-container {
    background: var(--card);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.group-cover {
    width: 100%;
    max-height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 0 0 12px 12px;
    position: relative;
    margin-bottom: 0;
    box-shadow: none;
    overflow: hidden;
}

.group-cover-change {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background var(--transition-speed);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.group-cover-change:hover {
    background: #fff;
}

.group-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: -50px; /* Pulls the header up over the cover */
    padding-left: 120px; /* Make space for the avatar */
    position: relative;
    min-height: 50px; /* Ensure it has height even with negative margin */
}

.group-avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    position: absolute; /* Position it relative to group-header */
    left: 20px;
    bottom: 10px; /* Adjust vertical position */
    border-radius: 50%;
    border: 4px solid var(--card);
    background-color: var(--card);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.group-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.group-info {
    flex-grow: 1;
    min-width: 0; /* Allows flex item to shrink and prevent overflow */
}

.group-info h1 {
    margin: 0 0 4px 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--fg);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
}

.group-info p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.group-nav-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
}

.group-nav {
    display: flex;
    gap: 4px;
}

.group-nav-link {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 6px;
    transition: background-color 0.2s;
    border-bottom: 3px solid transparent;
}

.group-nav-link:hover {
    background-color: #f0f2f5;
    text-decoration: none;
}

.group-nav-link.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.theme-dark .group-nav-link:hover {
    background-color: #3a3b3c;
}

.group-actions {
    display: flex;
    gap: 8px;
}

.group-btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.group-btn.join { background: var(--brand); color: white; }
.group-btn.leave { background: #e4e6eb; color: #1c1e21; }
.group-btn.invite { background: #e4e6eb; color: #1c1e21; }
.group-btn.settings { background: #e4e6eb; color: #1c1e21; }

.group-btn:hover {
    filter: brightness(0.95);
    text-decoration: none;
}

.group-body {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 16px;
    padding: 16px 0;
}

.group-main-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.group-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.group-section {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: none;
    border: 1px solid var(--border);
    padding: 16px;
}

.group-section h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fg);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.sidebar-member-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    background-color: #f0f2f5;
}
.theme-dark .sidebar-member-search {
    background-color: #3a3b3c;
    border-color: #444;
}

.no-members-found {
    color: var(--muted);
    text-align: center;
    padding: 1rem 0;
}

.invite-section {
    display: none;
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 8px;
    background: #f9f9f9;
    margin-bottom: 20px;
}

.theme-dark .invite-section {
    background: #242526;
    margin-top: 15px;
}

.friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.friend-item:hover {
    background: #f0f0f0;
}

.theme-dark .friend-item:hover {
    background: #3a3b3c;
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.friend-info img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.sidebar-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}
.sidebar-member-item:hover {
    background-color: #f0f2f5;
    text-decoration: none;
}
.members-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: #f8f9fa;
    transition: transform 0.2s;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.theme-dark .member-card {
    background: #3a3b3c;
}

.member-card-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.member-card img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.member-role {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.post-create {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px;
    box-shadow: none;
}

.post-create textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    resize: vertical;
    background: #f0f2f5;
}

.theme-dark .post-create textarea {
    background: #3a3b3c;
    background: transparent;
}

.post-create button {
    background: var(--brand);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.3s;
}

.post-create button:hover {
    background: var(--brand-2);
}

.post-create .post-create-bottom {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.group-posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.group-post {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px;
    box-shadow: none;
}

.group-post.pinned {
    border-left: 5px solid var(--brand);
    background: linear-gradient(135deg, #f0f8ff 0%, var(--card) 100%);
}

.pinned-badge {
    background: var(--brand);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}
.theme-dark .group-post.pinned {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, var(--card) 100%);
}

.post-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.post-info h4 {
    margin: 0;
    font-size: 1.1rem;
}

.post-info span {
    color: var(--muted);
    font-size: 14px;
}

.post-content {
    margin-bottom: 15px;
    line-height: 1.6;
}

.post-actions {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.action-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem; /* Larger icons */
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.action-btn .action-count {
    font-size: 0.9rem;
    font-weight: 600;
}

.action-btn:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--brand);
    transform: translateY(-2px) scale(1.05);
}
.theme-dark .action-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.action-btn.liked {
    color: var(--brand);
}
.action-btn.active {
    color: var(--brand);
    animation: like-bounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes like-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.comments-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.comment {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.comment img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.comment-content {
    flex: 1;
}

.comment-form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.comment-form textarea {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px 12px;
    resize: none;
}

.comment-form button {
    background: var(--brand);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 16px;
    cursor: pointer;
}

.search-section {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
}
.theme-dark .search-input { background: #3a3b3c; }
/* Responsive */
@media (max-width: 768px) {
    .group-body {
        grid-template-columns: 1fr;
    }
    .group-container {
        padding: 0;
    }
    .group-cover {
        border-radius: 0;
    }
    .group-header, .group-nav-actions {
        padding-left: 10px;
        padding-right: 10px;
    }
    .group-sidebar {
        padding: 0 10px;
    }

    .members-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .post-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .group-nav-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .group-info h1 {
        font-size: 1.8rem;
    }

    .members-list {
        grid-template-columns: 1fr;
    }

    .member-card {
        flex-direction: column;
    }

    .member-card {
        justify-content: center;
        text-align: center;
    }
}

/* Loading and animations */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Timeline Styles */
.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.timeline-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timeline-sidebar {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    height: fit-content;
}

.timeline-post {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

.timeline-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Profile Styles */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.profile-header {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    margin: 0 auto 15px;
    display: block;
}

.profile-nav {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    padding: 10px;
    margin-bottom: 20px;
}

.profile-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    gap: 10px;
}

.profile-nav-item a {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.profile-nav-item a:hover {
    background: var(--brand);
    color: white;
    transform: translateY(-2px);
}

.profile-nav-item a.active {
    background: var(--brand);
    color: white;
}

/* General Responsive */
@media (max-width: 1024px) {
    .timeline-container {
        grid-template-columns: 1fr;
    }

    .timeline-sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    .container, .timeline-container, .profile-container, .group-container {
        padding: 10px;
    }

    .profile-header {
        padding: 20px;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }
}

/* Enhanced Attractiveness */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.container {
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Profile Sidebar Enhancement */
#friends-bar .card {
    background: linear-gradient(145deg, var(--card), rgba(124,58,237,0.05));
    border: 2px solid transparent;
    background-clip: padding-box;
}

#friends-bar .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, rgba(124,58,237,0.1), rgba(168,85,247,0.1));
    border-radius: 12px;
    z-index: -1;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a1a;
        --card: #2a2a2a;
        --border: #444;
        --fg: #e0e0e0;
        --muted: #b0b0b0;
    }
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(168,85,247,0.12), transparent 30%), linear-gradient(135deg, #f5f7fa 0%, #e9eef8 100%);
    padding: 20px;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
}

.login-container *,
.login-container *::before,
.login-container *::after {
    box-sizing: border-box;
}

.login-header {
    width: min(100%, 560px);
    min-width: 0;
    text-align: center;
    margin-bottom: 28px;
}

.login-header .brand {
    font-size: 3.2rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--brand), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -0.04em;
}

.login-header p {
    color: var(--muted);
    font-size: 1.06rem;
    width: 100%;
    margin: 0 auto;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.login-card {
    background: rgba(255,255,255,0.8);
    padding: 32px 28px;
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    width: min(100%, 430px);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(124,58,237,0.12);
    min-width: 0;
}

.login-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    background: rgba(248, 250, 252, 0.8);
    color: var(--fg);
}

.login-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(124,58,237,0.12);
    background: white;
}

.login-button {
    width: 100%;
    padding: 15px 18px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
}

.login-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.02);
    box-shadow: 0 14px 28px rgba(124,58,237,0.35);
}

.login-button:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

.forgot-password-link {
    color: var(--brand);
    text-decoration: none;
    font-size: 14px;
    align-self: center;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.forgot-password-link:hover {
    text-decoration: underline;
    color: var(--brand-2);
}

.signup-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.signup-section p {
    margin: 0 0 12px;
    color: var(--muted);
}

.signup-button {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 20px rgba(34,197,94,0.2);
}

.signup-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(34,197,94,0.28);
}

.error-alert {
    background: #fff1f2;
    color: #be123c;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(190,18,60,0.18);
    margin-bottom: 20px;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
}

.success-alert {
    background: #ecfdf5;
    color: #166534;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(22,101,52,0.18);
    margin-bottom: 20px;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
}

.signup-wizard {
    text-align: left;
}

.signup-wizard [hidden] {
    display: none !important;
}

.wizard-progress {
    margin-bottom: 4px;
}

.wizard-progress-copy {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
}

#wizard-percent {
    color: var(--brand);
}

.wizard-progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.12);
}

#wizard-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    transition: width 0.25s ease;
}

.wizard-step-titles {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.wizard-step-titles span {
    display: flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    font-size: 0;
}

.wizard-step-titles span::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
    content: "";
}

.wizard-step-titles .is-current::before {
    width: 10px;
    height: 10px;
    background: var(--brand);
}

.wizard-step-titles .is-complete::before {
    background: #15803d;
}

.signup-step h2 {
    margin: 14px 0 4px;
    color: var(--fg);
    font-size: 1.2rem;
    text-align: left;
}

.wizard-hint {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.availability-message {
    min-height: 1.2em;
    margin-top: -10px;
    font-size: 0.84rem;
    line-height: 1.4;
}

.availability-message.is-available {
    color: #15803d;
}

.availability-message.is-unavailable {
    color: #be123c;
}

.wizard-actions {
    display: flex;
    gap: 10px;
}

.wizard-actions .login-button {
    flex: 1;
}

.wizard-back {
    min-width: 88px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: transparent;
    color: var(--fg);
    font-size: 16px;
    font-weight: 650;
    cursor: pointer;
}

.wizard-back:hover {
    background: rgba(124, 58, 237, 0.08);
}

@media (max-width: 480px) {
    .login-container {
        width: 100%;
        padding: 12px;
    }

    .login-header {
        margin-bottom: 18px;
    }

    .login-card {
        width: 100%;
        padding: 24px 18px;
        border-radius: 18px;
    }

    .login-header .brand {
        font-size: 2.7rem;
    }

    .login-form,
    .login-input,
    .login-button,
    .signup-section,
    .signup-button {
        min-width: 0;
        max-width: 100%;
    }
}

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card {
    animation: slideIn 0.6s ease-out;
}


.profile-nav-item a {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bio-header {
    margin-bottom: 15px;
    color: #333;
    display: flex; /* Use flexbox to align items */
    justify-content: space-between; /* Push items to the edges */
    align-items: center;
}

.bio-display {
    font-size: 1.1em;
    color: #555;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left; /* Aligns text to the left */
}
.bio-display p {
    margin: 0;
}

.bio-edit-form {
    display: none; /* Initially hidden */
}

.bio-edit-form textarea.form-control {
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 10px;
    font-size: 1em;
    resize: vertical;
}

.bio-edit-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.bio-edit-buttons .btn {
    padding: 8px 20px;
    border-radius: 8px;
}

/* Group Card Styles */
.group-card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
}

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.group-card-cover {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
}

.group-card-avatar {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--card);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    object-fit: cover;
}

.group-card-content {
    padding: 100px 16px 16px;
    text-align: center;
}

.group-card-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.group-stats {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.group-card .btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.group-card .btn-primary {
    background: linear-gradient(45deg, var(--brand), var(--brand-2));
    color: white;
    box-shadow: 0 2px 4px rgba(124,58,237,0.3);
}

.group-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(124,58,237,0.4);
}

.group-card .btn-danger {
    background: linear-gradient(45deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 4px rgba(239,68,68,0.3);
}

.group-card .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239,68,68,0.4);
}

/* Image Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.94);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.modal.is-open {
    opacity: 1;
}
.modal-content {
    margin: 0;
    display: block;
    max-width: min(90vw, 1200px);
    max-height: 86vh;
    width: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.45);
    animation: image-viewer-in 0.25s ease both;
}
.close {
    border: 0;
    background: transparent;
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2;
}
.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
.image-modal-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 50%;
    color: #fff;
    background: rgba(15,23,42,0.72);
    cursor: pointer;
    transform: translateY(-50%);
}
.image-modal-nav:hover { background: rgba(124,58,237,0.85); }
.image-modal-prev { left: 24px; }
.image-modal-next { right: 24px; }
.image-modal-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    z-index: 2;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 700;
    transform: translateX(-50%);
}
body.image-viewer-open { overflow: hidden; }
@keyframes image-viewer-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
@media (max-width: 600px) {
    .modal-content { max-width: 100vw; max-height: 82vh; border-radius: 0; }
    .image-modal-prev { left: 10px; }
    .image-modal-next { right: 10px; }
    .close { top: 10px; right: 14px; font-size: 34px; }
}

/* Generic Form Modal */
.form-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
}

.form-modal-content {
    background-color: var(--card);
    margin: auto;
    padding: 25px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.form-modal-close {
    color: var(--muted);
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.form-modal-close:hover,
.form-modal-close:focus {
    color: var(--fg);
    text-decoration: none;
}

.form-modal-content h2 {
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--fg);
}

.form-modal-content p {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--muted);
}

.file-input-label {
    display: inline-block;
    padding: 10px 15px;
    background-color: #f0f2f5;
    color: var(--fg);
    border: 1px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.file-input-label:hover { background-color: #e4e6eb; }
.theme-dark .file-input-label { background-color: #3a3b3c; }
.theme-dark .file-input-label:hover { background-color: #4e4f50; }

#cover-file-input { display: none; }
#cover-preview { max-width: 100%; max-height: 200px; border-radius: 8px; object-fit: cover; }

/* --- Invite to Group Page --- */
.friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.2s, opacity 0.5s;
    border-bottom: 1px solid var(--border);
}
.friend-item:last-child {
    border-bottom: none;
}
.friend-item:hover {
    background-color: var(--bg-color-2);
}
.friend-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.friend-info img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}
.invite-button, .invited-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.invite-button {
    background-color: var(--brand);
    color: white;
}
.invite-button:hover { background-color: var(--brand-2); }
.invited-button { background-color: #e4e6eb; color: #1c1e21; cursor: default; }
.theme-dark .invited-button { background-color: #3a3b3c; color: #e4e6eb; }

/* Shared post action bar: bottom-aligned, balanced, and touch-friendly. */
.post-card > .post-actions {
    display: flex;
    align-items: center;
    justify-content: stretch;
    gap: 6px;
    width: 100%;
    margin-top: 2px;
    padding: 8px 4px;
    border-top: 1px solid var(--border);
    border-bottom: 0;
}
.post-card > .post-actions .post-reaction-control,
.post-card > .post-actions > .action-btn {
    flex: 1 1 0;
    min-width: 0;
}
.post-card > .post-actions > .action-btn,
.post-card > .post-actions .post-reaction-control > .action-btn {
    min-height: 42px;
    justify-content: center;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 700;
}
.post-card > .post-actions .action-label,
.post-card > .post-actions .action-count {
    font-size: 13px;
    font-weight: 700;
}
.post-card > .post-actions .action-count {
    color: var(--muted);
}
.post-card > .post-actions .action-btn.active .action-count,
.post-card > .post-actions .action-btn.active .action-label {
    color: var(--brand);
}
.theme-dark .post-card > .post-actions {
    border-top-color: rgba(255,255,255,0.1);
}
.theme-dark .post-card > .post-actions .action-count {
    color: #cbd5e1;
}

/* Final mobile post action bar override. */
@media screen and (max-width: 768px) {
    .post-card .post-actions {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        min-height: 54px !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-around !important;
        gap: 4px !important;
        padding: 6px 8px !important;
        background: #ffffff !important;
        border-top: 1px solid rgba(15,23,42,0.1) !important;
        border-bottom: 0 !important;
        z-index: 10 !important;
    }
    .post-card .post-reaction-control,
    .post-card .post-actions > .action-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
    }
    .post-card .post-reaction-control {
        position: relative !important;
        align-items: center !important;
    }
    .post-card .post-actions > .action-btn,
    .post-card .post-reaction-control > .action-btn {
        width: 100% !important;
        min-height: 42px !important;
        align-items: center !important;
        justify-content: center !important;
        color: #475569 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }
    .theme-dark .post-card .post-actions {
        background: #0f172a !important;
        border-top-color: rgba(255,255,255,0.12) !important;
    }
    .theme-dark .post-card .post-actions > .action-btn,
    .theme-dark .post-card .post-reaction-control > .action-btn {
        color: #f8fafc !important;
    }
    .post-card:has(.post-media) .post-actions {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        background: var(--card) !important;
        border-top-color: var(--border) !important;
        z-index: 1 !important;
    }
    .post-card:has(.post-media) .post-actions > .action-btn,
    .post-card:has(.post-media) .post-reaction-control > .action-btn {
        color: var(--muted) !important;
    }
}

@media (max-width: 768px) {
    .timeline-container {
        width: 100%;
        max-width: 100%;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 10px;
    }
    .timeline-main,
    #timeline-posts,
    .post-card,
    .post-content,
    .post-header-info {
        min-width: 0;
    }
    #timeline-posts {
        width: 100%;
        padding: 8px;
    }
    .post-card {
        width: 100%;
        max-width: 100%;
        margin: 0 0 14px;
        overflow: visible;
        overflow-wrap: anywhere;
    }
    .post-header {
        flex-direction: row;
        align-items: center;
    }
    .post-header-info,
    .post-author-name {
        overflow-wrap: anywhere;
    }
    .post-options {
        flex: 0 0 auto;
    }
    .post-options a,
    .post-options button {
        display: inline-flex;
        min-width: 40px;
        min-height: 40px;
        align-items: center;
        justify-content: center;
    }
    .post-content,
    .post-text {
        overflow-wrap: anywhere;
        word-break: normal;
    }
    .post-stats {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 6px 14px;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .post-stats .stat-item {
        min-width: 0;
    }
    .post-media {
        max-width: 100%;
    }
    .post-media img,
    .post-media video {
        max-width: 100%;
    }
    .post-card > .post-actions,
    .post-card:has(.post-media) .post-actions {
        flex-wrap: nowrap;
        min-width: 0;
        overflow: visible;
    }
    .post-card .post-actions > .action-btn,
    .post-card .post-reaction-control > .action-btn {
        min-width: 0;
        padding-right: 4px;
        padding-left: 4px;
        gap: 4px;
        font-size: clamp(11px, 3.2vw, 14px);
    }
    .post-card .post-actions .action-label,
    .post-card .post-actions .action-count {
        font-size: clamp(10px, 2.8vw, 12px);
    }
}

@media (max-width: 360px) {
    .timeline-container {
        padding-right: 6px;
        padding-left: 6px;
    }
    #timeline-posts {
        padding-right: 4px;
        padding-left: 4px;
    }
    .post-card {
        border-radius: 12px;
    }
    .post-card .post-actions .action-label {
        max-width: 54px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 600px) {
    .modal {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 8px;
    }
    .image-modal-close {
        position: fixed;
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        z-index: 10002;
        display: inline-flex;
        width: 48px;
        height: 48px;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 1px solid rgba(255,255,255,.32);
        border-radius: 50%;
        color: #fff;
        background: rgba(15,23,42,.82);
        font-size: 21px;
        line-height: 1;
        -webkit-tap-highlight-color: transparent;
    }
    .image-modal-nav {
        width: 44px;
        height: 44px;
    }
}
