/**
 * Mobile-First Community Site Styles
 * Beautiful Sage Green Color Palette
 * Designed for OrangeHost Shared Hosting
 */

/* CSS Reset & Variables */
:root {
    /* Custom Color Palette */
    --primary-color: #778873;
    --primary-dark: #5a6b57;
    --primary-light: #A1BC98;
    --secondary-color: #D2DCB6;
    --accent-color: #A1BC98;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    --bg-color: #F1F3E0;
    --bg-card: #ffffff;
    --bg-dark: #778873;
    --bg-nav: #ffffff;

    --text-primary: #333333;
    --text-secondary: #555555;
    --text-muted: #888888;
    --text-light: #ffffff;

    --border-color: #D2DCB6;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-pill: 25px;

    --shadow-sm: 0 2px 4px rgba(119, 136, 115, 0.1);
    --shadow-md: 0 4px 12px rgba(119, 136, 115, 0.15);
    --shadow-lg: 0 8px 24px rgba(119, 136, 115, 0.2);

    --header-height: 55px;
    --nav-height: 50px;
    --bottom-nav-height: 65px;

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 22px;
}

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

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* Container */
#container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Brand Bar */
#brand_bar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

#brand_bar #top {
    width: 100%;
    height: var(--header-height);
}

#brand_bar td {
    padding: 0 12px;
    vertical-align: middle;
}

#brand_bar .left {
    width: 50%;
}

#brand_bar .right {
    width: 50%;
    text-align: right;
}

.brandmark {
    color: var(--text-light);
    font-size: var(--font-size-xl);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brandmark:hover {
    color: var(--text-light);
}

.logo-text {
    letter-spacing: -0.5px;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-light);
    position: relative;
    margin-left: 5px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.nav-icon:hover {
    background: rgba(255,255,255,0.15);
    color: var(--text-light);
}

.nav-icon .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    font-weight: 500;
    padding: 10px 18px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--border-radius-pill);
    transition: background 0.2s ease;
}

.login-btn:hover {
    background: rgba(255,255,255,0.3);
    color: var(--text-light);
}

/* Search Bar */
.search-bar {
    padding: 10px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: var(--border-radius-pill);
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(161, 188, 152, 0.2);
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 18px;
    font-size: var(--font-size-base);
    background: transparent;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* Main Navigation */
#main-nav {
    display: none;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-color);
    padding: 0 10px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

#main-nav .nav-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 18px;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    gap: 4px;
    transition: color 0.2s ease;
}

#main-nav .nav-item i {
    font-size: var(--font-size-lg);
}

#main-nav .nav-item.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

#main-nav .nav-item:hover {
    color: var(--primary-color);
}

/* Breadcrumb */
.breadcrumb {
    padding: 10px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .separator {
    color: var(--text-muted);
    font-size: 10px;
}

/* Main Content */
#main-content {
    flex: 1;
    padding: 12px;
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
}

/* Bottom Navigation */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-nav);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--bottom-nav-height);
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(119, 136, 115, 0.1);
}

#bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    flex: 1;
    text-align: center;
    transition: all 0.2s ease;
    border-radius: var(--border-radius);
}

#bottom-nav .nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

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

#bottom-nav .nav-item:hover {
    color: var(--primary-color);
    background: rgba(119, 136, 115, 0.1);
}

#bottom-nav .nav-item.post-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    flex: none;
    margin-top: -25px;
    box-shadow: var(--shadow-md);
}

#bottom-nav .nav-item.post-btn i {
    font-size: 26px;
    margin: 0;
}

#bottom-nav .nav-item.post-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    overflow: hidden;
}

.card-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(161, 188, 152, 0.1), rgba(210, 220, 182, 0.1));
}

.card-header h1, .card-header h2, .card-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.card-body {
    padding: 15px;
}

.card-footer {
    padding: 12px 15px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--bg-card);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(161, 188, 152, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23778873' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 35px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text-light);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-light);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 10px 16px;
    font-size: var(--font-size-sm);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* Alerts */
.alert {
    padding: 14px 16px;
    margin: 12px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-sm);
    animation: slideIn 0.3s ease;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error, .alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.5;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

/* User Avatar */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--secondary-color);
    border: 2px solid var(--border-color);
}

.avatar-sm {
    width: 36px;
    height: 36px;
}

.avatar-lg {
    width: 65px;
    height: 65px;
}

.avatar-xl {
    width: 100px;
    height: 100px;
}

/* Post/Activity Item */
.post-item {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.post-header {
    display: flex;
    align-items: center;
    padding: 14px 15px;
    gap: 12px;
}

.post-user-info {
    flex: 1;
}

.post-username {
    font-weight: 600;
    color: var(--text-primary);
}

.post-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.post-options {
    color: var(--text-muted);
}

.post-content {
    padding: 0 15px 15px;
}

.post-image {
    width: 100%;
    margin-bottom: 12px;
    border-radius: var(--border-radius);
}

.post-actions {
    display: flex;
    border-top: 1px solid var(--border-color);
    padding: 10px 15px;
    gap: 8px;
}

.post-actions .btn {
    flex: 1;
    color: var(--text-secondary);
    background: none;
    font-size: var(--font-size-sm);
}

.post-actions .btn:hover {
    color: var(--primary-color);
    background: rgba(119, 136, 115, 0.1);
}

.post-actions .btn.liked {
    color: var(--danger-color);
}

/* Forum Categories */
.forum-category {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.forum-category:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.forum-category-header {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
}

.forum-category-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 20px;
    flex-shrink: 0;
}

.forum-category-info {
    flex: 1;
}

.forum-category-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

.forum-category-desc {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: 2px;
}

.forum-category-stats {
    text-align: right;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Forum Topic */
.topic-item {
    padding: 14px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.topic-item:last-child {
    border-bottom: none;
}

.topic-info {
    flex: 1;
}

.topic-title {
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.topic-title:hover {
    color: var(--primary-color);
}

.topic-meta {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.topic-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 6px;
    text-transform: uppercase;
}

.topic-badge.sticky {
    background: var(--warning-color);
    color: #000;
}

.topic-badge.locked {
    background: var(--text-muted);
    color: #fff;
}

/* Groups */
.group-item {
    display: flex;
    align-items: center;
    padding: 14px 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 14px;
}

.group-item:last-child {
    border-bottom: none;
}

.group-cover {
    width: 55px;
    height: 55px;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 22px;
    flex-shrink: 0;
}

.group-info {
    flex: 1;
}

.group-name {
    font-weight: 600;
    color: var(--text-primary);
}

.group-members {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.group-type-badge {
    font-size: var(--font-size-xs);
    padding: 4px 10px;
    border-radius: var(--border-radius-pill);
    background: var(--bg-color);
    color: var(--text-secondary);
}

/* Chat */
.chat-list-item {
    display: flex;
    align-items: center;
    padding: 14px 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.chat-list-item:last-child {
    border-bottom: none;
}

.chat-user-info {
    flex: 1;
}

.chat-username {
    font-weight: 600;
}

.chat-preview {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.chat-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.chat-unread {
    background: var(--primary-color);
    color: var(--text-light);
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Messages */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height) - 20px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.chat-message {
    display: flex;
    margin-bottom: 15px;
}

.chat-message.sent {
    flex-direction: row-reverse;
}

.chat-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: var(--border-radius-lg);
    background: var(--bg-color);
}

.chat-message.sent .chat-message-content {
    background: var(--primary-color);
    color: var(--text-light);
}

.chat-message-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

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

.chat-input {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.chat-input input {
    flex: 1;
}

/* User Profile */
.profile-header {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    margin-bottom: 12px;
    box-shadow: var(--shadow-md);
}

.profile-name {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-username {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 18px;
}

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

.profile-stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.profile-stat-label {
    font-size: var(--font-size-xs);
    opacity: 0.8;
}

/* Friend List */
.friend-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: 500;
}

.friend-status {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.friend-status.online {
    color: var(--accent-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 25px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 18px;
    opacity: 0.4;
    color: var(--primary-light);
}

.empty-state h3 {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 18px;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: var(--border-radius);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

/* Menu Page */
.menu-list {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background 0.2s ease;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: var(--bg-color);
}

.menu-item i {
    width: 26px;
    text-align: center;
    color: var(--primary-color);
    font-size: var(--font-size-lg);
}

.menu-item-text {
    flex: 1;
}

.menu-item-badge {
    background: var(--danger-color);
    color: white;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab {
    flex: 1;
    padding: 14px 18px;
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

.tab:hover {
    color: var(--primary-color);
}

/* Auth Pages */
.auth-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 12px;
}

.auth-links a {
    color: var(--primary-color);
    font-size: var(--font-size-sm);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff;
    color: #333;
    border: 2px solid var(--border-color);
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: var(--border-radius);
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: var(--shadow-sm);
    border-color: #dadce0;
}

.btn-google svg {
    flex-shrink: 0;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 22px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 18px;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* Footer */
#footer {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 25px;
    text-align: center;
    margin-bottom: var(--bottom-nav-height);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255,255,255,0.85);
    font-size: var(--font-size-sm);
}

.footer-links a:hover {
    color: var(--text-light);
}

.copyright {
    font-size: var(--font-size-xs);
    opacity: 0.7;
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 15px);
    left: 15px;
    right: 15px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 18px;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: slideUp 0.4s ease;
    border: 2px solid var(--primary-light);
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-install-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.pwa-install-content {
    flex: 1;
}

.pwa-install-title {
    font-weight: 600;
    font-size: var(--font-size-base);
    margin-bottom: 2px;
}

.pwa-install-desc {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.pwa-install-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pwa-install-btn:hover {
    background: var(--primary-dark);
}

.pwa-install-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--accent-color); }
.text-danger { color: var(--danger-color); }
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 5px; }
.gap-2 { gap: 10px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive - Tablet and Desktop */
@media (min-width: 768px) {
    #brand_bar {
        padding: 0 25px;
    }

    #main-nav {
        display: flex;
        justify-content: center;
    }

    #bottom-nav {
        display: none;
    }

    #main-content {
        max-width: 850px;
        margin: 0 auto;
        padding: 25px;
        padding-bottom: 25px;
    }

    #footer {
        margin-bottom: 0;
    }

    .search-bar {
        padding: 15px 25px;
    }

    .pwa-install-banner {
        left: auto;
        right: 25px;
        bottom: 25px;
        width: 350px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --bg-card: #252525;
        --bg-nav: #252525;
        --text-primary: #e8e8e8;
        --text-secondary: #b0b0b0;
        --text-muted: #707070;
        --border-color: #3a3a3a;
    }

    .form-control {
        background: #2a2a2a;
        color: var(--text-primary);
    }

    .btn-google {
        background: #2a2a2a;
        color: var(--text-primary);
        border-color: #3a3a3a;
    }

    .pwa-install-banner {
        background: var(--bg-card);
    }
}
/* Additional Styles for Role Badges and Online Status */

/* Role Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.owner {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.role-badge.admin {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.role-badge.moderator {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: #fff;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.role-badge.member {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: #fff;
}

.role-badge i {
    font-size: 9px;
}

/* Online/Offline Status Indicators */
.status-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.status-indicator.online {
    background: #28a745;
    animation: pulse-online 2s infinite;
}

.status-indicator.offline {
    background: #dc3545;
}

.status-indicator i {
    font-size: 8px;
    color: white;
}

@keyframes pulse-online {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Profile Avatar Wrapper with Status */
.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
}

/* Online/Offline Text Status */
.profile-status-text {
    margin: 8px 0;
    font-size: 14px;
}

.online-text {
    color: #28a745;
    font-weight: 600;
}

.online-text i {
    font-size: 10px;
    margin-right: 5px;
    animation: blink 1s infinite;
}

.offline-text {
    color: #dc3545;
    font-weight: 600;
}

.offline-text i {
    font-size: 10px;
    margin-right: 5px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Member Card Status */
.member-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-status.online {
    background: #28a745;
    animation: pulse-online 2s infinite;
}

.member-status.online i {
    color: #28a745;
    font-size: 6px;
}

.member-status.offline {
    background: #dc3545;
}

.member-status.offline i {
    color: #dc3545;
    font-size: 6px;
}

/* Member Card */
.member-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.member-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    color: var(--text-primary);
}

.member-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.member-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

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

.member-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.member-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.member-bio {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.member-meta i {
    margin-right: 4px;
    color: var(--primary-color);
}

.member-actions {
    flex-shrink: 0;
}

/* Online Stats Banner */
.online-stats {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 10px;
}

.online-count {
    color: #28a745;
    font-weight: 500;
    font-size: 14px;
}

.online-count i {
    font-size: 10px;
    margin-right: 5px;
    animation: blink 1s infinite;
}

/* Admin Panel Styles */
.admin-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.admin-header h1 {
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.admin-stat-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
}

.admin-stat-value {
    font-size: 24px;
    font-weight: 700;
}

.admin-stat-label {
    font-size: 12px;
    opacity: 0.9;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.admin-nav-item {
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: var(--primary-color);
    color: white;
}

/* Toast Notifications */
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
}

.toast-success { border-color: #28a745; }
.toast-error { border-color: #dc3545; }
.toast-info { border-color: #17a2b8; }

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive adjustments for member cards */
@media (max-width: 480px) {
    .member-avatar {
        width: 45px;
        height: 45px;
    }

    .member-name {
        font-size: 14px;
    }

    .role-badge {
        font-size: 9px;
        padding: 2px 8px;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   AUDIT FIXES - Added after security review
   ============================================ */

/* Status badges with better contrast for offline */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.status-badge.status-online {
    background: #28a745;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.status-badge.status-offline {
    background: #dc3545;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.status-badge i {
    font-size: 10px;
}

/* Focus styles for accessibility - WCAG compliance */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
.btn:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(161, 188, 152, 0.25);
}

/* Improved color contrast for text */
:root {
    /* Darker text colors for WCAG AA compliance */
    --text-primary: #2d3329;
    --text-secondary: #4a5548;
    --text-muted: #6b7280;
}

/* Welcome card and home page specific styles */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    margin-bottom: 15px;
}

.welcome-card h2 {
    margin-bottom: 10px;
}

.welcome-card .text-muted {
    color: rgba(255,255,255,0.8) !important;
}

.welcome-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.welcome-stats .stat {
    text-align: center;
}

.welcome-stats .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

.welcome-stats .stat-label {
    font-size: 12px;
    opacity: 0.9;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.welcome-actions .btn-outline {
    border-color: white;
    color: white;
}

.welcome-actions .btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

/* Quick actions */
.quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.quick-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-action-btn i {
    font-size: 20px;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.quick-action-btn span {
    font-size: var(--font-size-xs);
}

/* Topic title link */
.topic-title-link {
    font-weight: 600;
    font-size: var(--font-size-lg);
    display: block;
    color: var(--text-primary);
}

.topic-title-link:hover {
    color: var(--primary-color);
}

.topic-stats {
    font-size: var(--font-size-xs);
}

.topic-stats span {
    margin-right: 15px;
}

/* Online users */
.online-users {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.online-user {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--bg-color);
    border-radius: 20px;
    font-size: var(--font-size-sm);
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Admin container */
.admin-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Admin role badge */
.admin-role-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-role-badge.owner { background: #ffd700; color: #000; }
.admin-role-badge.admin { background: #ff6b6b; color: white; }
.admin-role-badge.moderator { background: #4ecdc4; color: white; }

/* Stat card */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Admin navigation grid */
.admin-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.admin-nav-item {
    background: var(--bg-card);
    padding: 15px 10px;
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--text-primary);
    position: relative;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.admin-nav-item i {
    display: block;
    font-size: 24px;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.admin-nav-item span {
    font-size: 12px;
}

.admin-nav-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.admin-nav-item:hover i {
    color: white;
}

.admin-nav-item .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

/* Danger zone */
.danger-zone {
    border: 2px solid var(--danger-color);
}

.danger-zone h2 {
    color: var(--danger-color);
}

.danger-actions {
    display: flex;
    gap: 10px;
}

/* Settings form */
.settings-form {
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
}

.settings-section h2 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.checkbox-group {
    margin-bottom: 15px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    position: relative;
    transition: background 0.3s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-label input:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-label input:checked + .toggle-slider::after {
    left: 24px;
}

.form-text {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

.code-textarea {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.btn-lg {
    padding: 15px 40px;
    font-size: 16px;
}

.btn-success {
    background: #28a745;
    color: white;
    border: none;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-warning {
    background: #ffc107;
    color: #000;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

/* Additional buttons */
.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 10px 16px;
    font-size: var(--font-size-sm);
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-content form {
    padding: 15px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

/* Info list */
.profile-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-sm);
}

.info-item i {
    width: 20px;
    color: var(--primary-color);
}

/* Activity item */
.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.activity-content {
    flex: 1;
}

.activity-content p {
    margin: 0;
}

/* Responsive */
@media (max-width: 600px) {
    .admin-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .admin-nav {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .danger-actions {
        flex-direction: column;
    }
    
    .status-badge {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}

/* Print styles */
@media print {
    .status-indicator,
    .admin-nav,
    .btn,
    form,
    .nav-icon,
    #bottom-nav {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
