/* forum/assets/css/forum.css */

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --bg-card: #1e1e1e;
    --border-color: rgba(192, 192, 192, 0.1);
    --border-hover: rgba(192, 192, 192, 0.25);
    --accent: #a6491b;
    --accent-light: #c4653a;
    --accent-dark: #7d3815;
    --text-primary: #c9c9c9;
    --text-secondary: #8b8b8b;
    --text-muted: #5c5c5c;
    --text-bright: #e8e8e8;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

a:hover {
    color: var(--accent);
}

/* ==================== HEADER ==================== */
.forum-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 60px;
    gap: 2rem;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
    white-space: nowrap;
    flex-shrink: 0;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.nav-link {
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.9rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-bright);
    background: var(--bg-tertiary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
}

.user-link {
    color: var(--accent-light);
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.9rem;
}

/* ==================== LANGUAGE SWITCHER ==================== */
.lang-switcher {
    display: flex;
    gap: 2px;
    border-right: 1px solid var(--border-color);
    padding-right: 0.75rem;
}

.lang-link {
    padding: 4px 8px;
    font-size: 11px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.lang-link:hover {
    color: var(--text-bright);
    background: var(--bg-tertiary);
}

.lang-link.active {
    color: var(--accent-light);
    background: rgba(166, 73, 27, 0.15);
}

/* ==================== SEARCH ==================== */
.search-container {
    position: relative;
    width: 220px;
    flex-shrink: 0;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.search-form:focus-within {
    border-color: var(--accent);
}

.search-input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    min-width: 0;
}

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

.search-btn {
    padding: 0.4rem 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 1rem;
}

.search-btn:hover {
    color: var(--accent-light);
}

/* ==================== NOTIFICATION BELL ==================== */
.notification-wrapper {
    position: relative;
    display: inline-block;
}

.notification-bell {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    position: relative;
    transition: color 0.2s ease, transform 0.2s ease;
}

.notification-bell:hover {
    color: var(--accent-light);
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
}

.notification-dropdown.active {
    display: block;
    animation: notifSlideIn 0.2s ease;
}

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

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.notif-header span {
    font-weight: 600;
    color: var(--text-bright);
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--accent-light);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.notif-mark-all:hover {
    background: var(--bg-card);
}

.notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.notif-item.unread {
    background: rgba(166, 73, 27, 0.08);
    border-left: 3px solid var(--accent);
}

.notif-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.notif-icon.type-reply { background: rgba(76, 175, 80, 0.15); color: var(--success); }
.notif-icon.type-quote { background: rgba(33, 150, 243, 0.15); color: #2196f3; }
.notif-icon.type-mention { background: rgba(255, 152, 0, 0.15); color: var(--warning); }
.notif-icon.type-pm { background: rgba(156, 39, 176, 0.15); color: #9c27b0; }

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.notif-text strong {
    color: var(--text-bright);
}

.notif-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.notif-delete {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.notif-item:hover .notif-delete {
    opacity: 1;
}

.notif-delete:hover {
    color: var(--danger);
}

.notif-footer {
    padding: 0.6rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.notif-footer a {
    font-size: 0.85rem;
    color: var(--accent-light);
}

.notif-loading, .notif-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-light);
}

.btn-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.btn-small:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

/* ==================== LAYOUT ==================== */
.forum-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 160px);
}

.layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.main-area {
    flex: 1;
    min-width: 0;
    width: calc(100% - 300px);
}

/* ==================== BREADCRUMB ==================== */
.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

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

.breadcrumb-current {
    color: var(--text-primary);
}

.separator {
    margin: 0 0.3rem;
    color: var(--text-muted);
}

/* ==================== PAGE TITLE ==================== */
.page-title {
    font-size: 1.8rem;
    color: var(--text-bright);
    margin-bottom: 1.5rem;
}

.section-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.section-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==================== SIDEBAR ==================== */
.forum-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.sidebar-widget h3 {
    font-size: 0.95rem;
    color: var(--accent-light);
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-widget p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.sidebar-widget ul {
    list-style: none;
}

.sidebar-widget li {
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

.sidebar-widget a:hover {
    color: var(--accent-light);
}

.online-users-list {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    line-height: 1.6;
}

/* ==================== AUTH / LOGIN ==================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-bright);
}

.auth-form .form-group {
    margin-bottom: 1.2rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-form .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.7rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1.2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.error-messages {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 5px;
    padding: 0.8rem;
    margin-bottom: 1rem;
}

.error-messages p {
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.error-messages p:last-child {
    margin-bottom: 0;
}

/* ==================== FORUM CATEGORIES ==================== */
.forum-category {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.category-header {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    padding: 0.8rem 1.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.category-icon {
    font-size: 1.2rem;
}

.forums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0;
    background: var(--bg-card);
}

.forum-card {
    display: flex;
    gap: 1rem;
    padding: 1.2rem;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: background 0.2s ease;
    color: inherit;
    text-decoration: none;
}

.forum-card:hover {
    background: var(--bg-tertiary);
}

.forum-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.forum-card-body {
    flex: 1;
    min-width: 0;
}

.forum-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    gap: 0.5rem;
}

.forum-card h3 {
    font-size: 1rem;
    color: var(--text-bright);
}

.thread-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.forum-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.last-post {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.by-author {
    color: var(--accent-light);
}

/* ==================== THREAD LISTING ==================== */
.new-thread-btn {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.login-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.thread-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.thread-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

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

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

.thread-main {
    flex: 1;
    min-width: 0;
}

.thread-title {
    font-size: 1rem;
    color: var(--text-bright);
    font-weight: 600;
    display: inline;
}

.thread-title:hover {
    color: var(--accent-light);
}

.thread-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.3rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.thread-author a {
    color: var(--accent-light);
}

.thread-stats {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
    margin-left: 1.5rem;
}

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

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

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

/* Thread Badges */
.thread-badge {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-right: 0.4rem;
    font-weight: 600;
}

.badge-pinned {
    background: rgba(166, 73, 27, 0.2);
    color: var(--accent-light);
}

.badge-closed {
    background: rgba(244, 67, 54, 0.2);
    color: var(--danger);
}

/* Thread Tags */
.thread-tag {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.tag-urgent {
    background: rgba(244, 67, 54, 0.15);
    color: var(--danger);
}

.tag-solved {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.tag-guide {
    background: rgba(255, 152, 0, 0.15);
    color: var(--warning);
}

/* ==================== THREAD VIEW ==================== */
.thread-meta-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.thread-stats-bar {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* ==================== POSTS ==================== */
.posts-list {
    margin-bottom: 1.5rem;
}

.post-card {
    display: flex;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.8rem;
    overflow: hidden;
}

.post-sidebar {
    width: 160px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.post-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-light);
}

.author-info {
    text-align: center;
    width: 100%;
}

.author-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-bright);
}

.author-name.role-admin {
    color: var(--danger);
}

.author-name.role-moderator {
    color: var(--warning);
}

.rank-badge {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    color: #fff;
    margin-top: 0.3rem;
}

.author-posts {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.post-body {
    flex: 1;
    min-width: 0;
    padding: 1rem;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.edited-indicator {
    font-style: italic;
    color: var(--text-muted);
}

.post-content {
    line-height: 1.7;
    color: var(--text-primary);
    word-wrap: break-word;
}

.post-content blockquote {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    padding: 0.8rem 1rem;
    margin: 0.5rem 0;
    border-radius: 0 5px 5px 0;
}

.post-content blockquote cite {
    display: block;
    font-style: normal;
    color: var(--accent-light);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.post-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.8rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.post-content code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
}

.post-content details {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.5rem;
    margin: 0.5rem 0;
}

.post-content details summary {
    cursor: pointer;
    color: var(--accent-light);
}

.post-signature {
    border-top: 1px solid var(--border-color);
    padding-top: 0.6rem;
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-color);
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    background: var(--bg-tertiary);
    transition: all 0.2s ease;
}

.action-btn:hover {
    color: var(--accent-light);
    background: var(--bg-secondary);
}

/* Reactions */
.post-reactions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.reaction-btn {
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 5px;
    background: var(--bg-tertiary);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.reaction-btn:hover {
    background: var(--accent-dark);
}

.reaction-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 6px rgba(166, 73, 27, 0.5);
}

.reaction-btn.active:hover {
    background: var(--accent-dark);
}

.reaction-score {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 1.5rem;
    text-align: center;
}

/* Quote/Edit/Mod buttons */
.quote-btn:hover {
    color: var(--accent-light) !important;
}

.edit-btn:hover {
    color: var(--success) !important;
}

.mod-action {
    color: var(--danger) !important;
}

.mod-action:hover {
    background: rgba(244, 67, 54, 0.15) !important;
}

/* ==================== QUICK REPLY ==================== */
.quick-reply {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.quick-reply h3 {
    color: var(--text-bright);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.reply-form textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    padding: 0.8rem;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.reply-actions {
    margin-top: 0.8rem;
    text-align: right;
}

/* ==================== NEW THREAD FORM ==================== */
.new-thread-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
}

.new-thread-form .form-group {
    margin-bottom: 1.5rem;
}

.new-thread-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ==================== UNIVERSAL INPUT STYLES ==================== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(166, 73, 27, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

.new-thread-form input[type="text"] {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.new-thread-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(166, 73, 27, 0.15);
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* Tags Selector */
.tags-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
}

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

.tag-label {
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* BBCode Toolbar */
.bbcode-toolbar {
    display: flex;
    gap: 2px;
    padding: 0.4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    flex-wrap: wrap;
}

.bbcode-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bbcode-btn:hover {
    background: var(--accent-dark);
    color: #fff;
    border-color: var(--accent);
}

.bbcode-btn:active {
    transform: scale(0.95);
}

.new-thread-form textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 5px 5px;
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 200px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.new-thread-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(166, 73, 27, 0.15);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-cancel:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.btn-submit {
    min-width: 160px;
}

/* Validation States */
.form-group.error input,
.form-group.error textarea {
    border-color: var(--danger);
}

.form-group .field-error {
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 0.3rem;
}

/* ==================== SEARCH RESULTS DROPDOWN ==================== */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    max-height: 420px;
    overflow-y: auto;
    z-index: 200;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.search-results-dropdown.active {
    display: block;
}

.search-results-header {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-results-loading {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-result-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s ease;
}

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

.search-result-item:hover,
.search-result-item.highlighted {
    background: var(--bg-tertiary);
}

.search-result-title {
    font-size: 0.92rem;
    color: var(--text-bright);
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.search-result-snippet {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    display: flex;
    gap: 1rem;
}

.search-result-mark {
    background: rgba(166, 73, 27, 0.3);
    color: var(--accent-light);
    padding: 0 2px;
    border-radius: 2px;
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-filters {
    display: flex;
    gap: 0.8rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.search-filter-btn {
    font-size: 0.78rem;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-filter-btn:hover,
.search-filter-btn.active {
    border-color: var(--accent);
    color: var(--accent-light);
    background: rgba(166, 73, 27, 0.15);
}

.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--border-color);
}

.search-page-btn {
    font-size: 0.82rem;
    padding: 0.3rem 0.7rem;
    border-radius: 5px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-page-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent-light);
}

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

.search-page-info {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Autocomplete */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    max-height: 240px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}

.autocomplete-suggestions.active {
    display: block;
}

.autocomplete-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: var(--bg-tertiary);
    color: var(--accent-light);
}

/* AJAX Pagination */
.ajax-pagination {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.ajax-page-btn {
    padding: 0.4rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ajax-page-btn:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.ajax-page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.thread-list-container {
    min-height: 200px;
}

.thread-list-container.loading::after {
    content: 'Učitavanje...';
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.4rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.page-link:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.page-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ==================== PROFILE PAGE ==================== */
.profile-container {
    max-width: 900px;
}

.profile-header {
    display: flex;
    gap: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.profile-avatar-section {
    flex-shrink: 0;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
}

.profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-light);
    border: 3px solid var(--accent);
}

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

.profile-username {
    font-size: 1.8rem;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
}

.profile-username.role-admin {
    color: var(--danger);
}

.profile-username.role-moderator {
    color: var(--warning);
}

.online-indicator {
    display: inline-block;
    font-size: 0.78rem;
    padding: 0.15rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 0.5rem;
}

.online-indicator.online {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
}

.online-indicator.offline {
    background: rgba(92, 92, 92, 0.3);
    color: var(--text-muted);
}

.profile-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

.role-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
}

.profile-bio {
    margin-top: 0.8rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.profile-details {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detail-item a {
    color: var(--accent-light);
}

.profile-dates {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Profile Stats */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.2rem;
    text-align: center;
}

.stat-box .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
}

.stat-box .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    display: block;
}

/* Rank Progress */
.profile-rank-progress {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.profile-rank-progress p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Edit Sections */
.profile-edit-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.edit-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.edit-card h3 {
    color: var(--text-bright);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.avatar-form {
    margin-bottom: 0;
}

.avatar-upload-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-input {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-input::file-selector-button {
    padding: 0.4rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-input::file-selector-button:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

/* Profile Edit Form */
.profile-edit-form .form-group {
    margin-bottom: 1.2rem;
}

.profile-edit-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.profile-edit-form input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-edit-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(166, 73, 27, 0.15);
}

.profile-edit-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-edit-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(166, 73, 27, 0.15);
}

.signature-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Recent Posts */
.profile-recent-posts {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.profile-recent-posts h3 {
    color: var(--text-bright);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.recent-post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: color 0.2s ease;
}

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

.recent-post-item:hover {
    color: var(--accent-light);
}

.recent-post-title {
    font-size: 0.95rem;
}

.recent-post-date {
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Alerts */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: var(--danger);
}

/* ==================== EDIT MODAL ==================== */
.edit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.edit-modal.active {
    display: flex;
}

.edit-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.edit-modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.edit-modal-content h3 {
    color: var(--text-bright);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

#editForm .bbcode-toolbar {
    margin-bottom: 0;
}

#edit-content {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 5px 5px;
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#edit-content:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(166, 73, 27, 0.15);
}

.edit-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ==================== PRIVATE MESSAGES ==================== */
.pm-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    height: calc(100vh - 160px);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.pm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.pm-header h2 {
    font-size: 1.3rem;
    color: var(--text-bright);
}

.pm-new-btn {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.pm-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.pm-sidebar {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

.pm-search-box {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.pm-search-input {
    width: 100%;
    padding: 0.5rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.pm-search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.pm-conversations-list {
    flex: 1;
    overflow-y: auto;
}

.pm-conv-item {
    display: flex;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.pm-conv-item.active {
    background: rgba(166, 73, 27, 0.15);
    border-left: 3px solid var(--accent);
}

.pm-conv-item.unread {
    background: rgba(166, 73, 27, 0.08);
}

.pm-conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-light);
    flex-shrink: 0;
}

.pm-conv-body {
    flex: 1;
    min-width: 0;
}

.pm-conv-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.pm-conv-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-conv-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.pm-conv-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-conv-item.unread .pm-conv-name,
.pm-conv-item.unread .pm-conv-preview {
    color: var(--text-bright);
}

.pm-conv-delete {
    opacity: 0;
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem;
    transition: opacity 0.2s ease;
}

.pm-conv-item:hover .pm-conv-delete {
    opacity: 1;
}

.pm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pm-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 0.8rem;
}

.pm-empty-state p:first-child {
    font-size: 3rem;
}

.pm-empty-state h3 {
    color: var(--text-secondary);
}

.pm-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.pm-view-header {
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.pm-view-header-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
}

.pm-view-header-info {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.pm-messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.pm-message {
    display: flex;
    gap: 0.8rem;
    max-width: 80%;
}

.pm-message.self {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.pm-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-light);
    flex-shrink: 0;
}

.pm-msg-body {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    min-width: 150px;
    max-width: 100%;
}

.pm-message.self .pm-msg-body {
    background: rgba(166, 73, 27, 0.2);
    border-bottom-left-radius: 4px;
}

.pm-message:not(.self) .pm-msg-body {
    border-bottom-right-radius: 4px;
}

.pm-msg-sender {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 0.2rem;
}

.pm-message.self .pm-msg-sender {
    display: none;
}

.pm-msg-content {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    word-wrap: break-word;
}

.pm-msg-attachment {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-secondary);
    border-radius: 5px;
    font-size: 0.82rem;
}

.pm-msg-attachment a {
    color: var(--accent-light);
}

.pm-msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    text-align: right;
}

.pm-pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.pm-page-btn {
    padding: 0.3rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
}

.pm-page-btn:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.pm-page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pm-compose {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.pm-compose-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.pm-compose-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.pm-compose-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.pm-attach-btn {
    padding: 0.4rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.pm-attach-btn:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.pm-attach-name {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.pm-compose-actions {
    margin-top: 0.5rem;
    text-align: right;
}

.pm-send-btn {
    padding: 0.4rem 1.2rem;
    font-size: 0.85rem;
}

/* PM Modal */
.pm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.pm-modal.active {
    display: flex;
}

.pm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.pm-modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 480px;
}

.pm-modal-content h3 {
    color: var(--text-bright);
    margin-bottom: 1.2rem;
}

.pm-new-conv-form .form-group {
    margin-bottom: 1rem;
    position: relative;
}

.pm-new-conv-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pm-new-conv-form input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.pm-new-conv-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.pm-new-conv-form textarea {
    width: 100%;
    padding: 0.5rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.pm-new-conv-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.pm-user-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.pm-user-suggestions.active {
    display: block;
}

.pm-user-suggestion-item {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.pm-user-suggestion-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-light);
}

.pm-selected-recipients {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.pm-recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: rgba(166, 73, 27, 0.2);
    border: 1px solid var(--accent-dark);
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--accent-light);
}

.pm-recipient-remove {
    cursor: pointer;
    font-weight: 700;
    opacity: 0.7;
}

.pm-recipient-remove:hover {
    opacity: 1;
}

.pm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pm-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
}

/* ==================== NOTIFICATIONS PAGE ==================== */
.notifications-page {
    max-width: 800px;
}

.notif-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.notif-page-header h2 {
    color: var(--text-bright);
}

.notif-mark-all-btn {
    font-size: 0.85rem;
}

.notif-tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 1rem;
    padding: 0.3rem;
    background: var(--bg-secondary);
    border-radius: 5px;
    overflow-x: auto;
}

.notif-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 3px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.notif-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.notif-tab.active {
    background: var(--accent);
    color: #fff;
}

.notif-page-list {
    min-height: 200px;
}

.notif-pagination {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.notif-page-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.notif-page-btn:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
}

.notif-page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ==================== ONLINE PAGE ==================== */
.online-page {
    max-width: 900px;
}

.online-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.online-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.online-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.online-stat-icon {
    font-size: 2rem;
}

.online-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
}

.online-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.online-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.online-section h2 {
    color: var(--text-bright);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    font-size: 1.1rem;
}

.online-table {
    width: 100%;
    border-collapse: collapse;
}

.online-table thead th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
}

.online-table tbody td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.online-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.online-username {
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.online-username:hover {
    color: var(--accent-light);
}

.online-username.role-admin {
    color: var(--danger) !important;
}

.online-username.role-moderator {
    color: var(--warning) !important;
}

.time-ago-cell {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.recent-list, .active-list {
    list-style: none;
}

.recent-list li, .active-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* ==================== FOOTER ==================== */
.forum-footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.post-time {
    margin-left: 0.4rem;
    color: var(--text-muted);
}

/* ==================== UI POLISH ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

main.forum-content {
    animation: fadeIn 0.3s ease;
}

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

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

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

.btn, .btn-primary, .btn-small {
    position: relative;
    overflow: hidden;
}

.forum-category:hover,
.stat-card:hover,
.online-stat-card:hover {
    box-shadow: 0 4px 20px rgba(166, 73, 27, 0.1);
}

*:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
}

::selection {
    background: rgba(166, 73, 27, 0.4);
    color: #fff;
}

/* ==================== HAMBURGER MENU ==================== */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.4rem;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.hamburger-menu:hover {
    color: var(--accent-light);
}

.hamburger-menu.active {
    transform: rotate(90deg);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    z-index: 100;
    transform: translateY(-10px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

.mobile-menu.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav-link {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: var(--bg-tertiary);
    color: var(--accent-light);
    border-left-color: var(--accent);
}

/* ==================== RESPONSIVE — TABLET (1024px) ==================== */
@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
    }

    .main-area {
        width: 100%;
    }

    .forum-sidebar {
        width: 100%;
    }

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

    .pm-container {
        height: calc(100vh - 120px);
    }
}

/* ==================== RESPONSIVE — MOBILE (768px) ==================== */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 1rem;
        gap: 1rem;
    }

    .hamburger-menu {
        display: block;
        margin-left: auto;
    }

    .main-nav {
        display: none;
    }

    .search-container {
        width: 140px;
    }

    .notification-wrapper {
        display: none;
    }

    .header-right .user-link,
    .header-right .btn-small {
        display: none;
    }

    .lang-switcher {
        border-right: none;
        padding-right: 0;
    }

    .search-results-dropdown {
        position: fixed;
        top: 60px;
        left: 1rem;
        right: 1rem;
        max-height: 70vh;
    }

    .forum-content {
        padding: 0 1rem;
    }

    .auth-box {
        padding: 1.5rem;
    }

    .forums-grid {
        grid-template-columns: 1fr;
    }

    .thread-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .thread-stats {
        margin-left: 0;
        gap: 1rem;
    }

    .forum-card {
        padding: 1rem;
    }

    .post-card {
        flex-direction: column;
    }

    .post-sidebar {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.8rem;
        padding: 0.8rem;
    }

    .post-avatar-placeholder {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .author-info {
        text-align: left;
    }

    .thread-stats-bar {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .quick-reply {
        padding: 1rem;
    }

    .new-thread-form {
        padding: 1.2rem;
    }

    .bbcode-toolbar {
        gap: 1px;
    }

    .bbcode-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
        text-align: center;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .avatar-upload-row {
        flex-direction: column;
    }

    .notification-dropdown {
        width: calc(100vw - 2rem);
        right: -1rem;
    }

    .notif-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .online-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .online-table thead th:nth-child(3),
    .online-table tbody td:nth-child(3) {
        display: none;
    }

    .action-btn,
    .btn-small,
    .page-link,
    .ajax-page-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .pm-layout {
        flex-direction: column;
    }

    .pm-sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .pm-main {
        min-height: 50vh;
    }

    .pm-message {
        max-width: 90%;
    }

    .pm-container {
        height: calc(100vh - 100px);
    }

    .pm-modal-content {
        width: 95%;
        padding: 1.2rem;
    }

    .edit-modal-content {
        width: 95%;
        padding: 1.2rem;
        max-height: 90vh;
    }

    .edit-form-actions {
        flex-direction: column;
    }

    .edit-form-actions .btn {
        width: 100%;
        text-align: center;
    }

    .lang-switcher {
        justify-content: center;
        margin: 8px 0;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border-color);
    }
}

/* ==================== RESPONSIVE — SMALL MOBILE (480px) ==================== */
@media (max-width: 480px) {
    .header-inner {
        height: 52px;
        padding: 0 0.7rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .search-container {
        width: 100px;
    }

    .search-input::placeholder {
        font-size: 0.8rem;
    }

    .forum-content {
        padding: 0 0.7rem;
        margin-top: 1rem;
    }

    .page-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .forum-card {
        flex-direction: column;
        gap: 0.6rem;
        padding: 0.9rem;
    }

    .forum-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .thread-item {
        padding: 0.8rem;
    }

    .thread-title {
        font-size: 0.92rem;
    }

    .thread-meta {
        flex-direction: column;
        gap: 0.3rem;
    }

    .post-card {
        margin-bottom: 0.5rem;
        border-radius: 6px;
    }

    .post-body {
        padding: 0.8rem;
    }

    .post-content {
        font-size: 0.9rem;
    }

    .profile-header {
        padding: 1.2rem;
    }

    .profile-avatar,
    .profile-avatar-placeholder {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .profile-username {
        font-size: 1.4rem;
    }

    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .stat-box {
        padding: 0.8rem;
    }

    .stat-box .stat-value {
        font-size: 1.2rem;
    }

    .online-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .online-stat-card {
        padding: 0.8rem;
    }

    .online-stat-icon {
        font-size: 1.5rem;
    }

    .online-stat-value {
        font-size: 1.2rem;
    }

    .auth-box {
        padding: 1.2rem;
        margin: 0 0.5rem;
    }

    .pagination,
    .ajax-pagination {
        gap: 0.3rem;
    }

    .page-link,
    .ajax-page-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.82rem;
    }

    .breadcrumb {
        font-size: 0.82rem;
        margin-bottom: 1rem;
    }

    .section-header {
        padding: 1rem;
    }

    .edit-modal-content {
        width: 95%;
        padding: 1rem;
        max-height: 90vh;
    }

    .edit-form-actions {
        flex-direction: column;
    }

    .edit-form-actions .btn {
        width: 100%;
        text-align: center;
    }

    .pm-header h2 {
        font-size: 1.1rem;
    }

    .pm-msg-body {
        min-width: 100px;
        padding: 0.5rem 0.8rem;
    }

    .pm-message {
        max-width: 92%;
    }

    .notification-dropdown {
        width: calc(100vw - 1.4rem);
        right: -0.7rem;
    }

    .forum-footer {
        padding: 1.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* ==================== RESPONSIVE — VERY SMALL (360px) ==================== */
@media (max-width: 360px) {
    .header-inner {
        padding: 0 0.5rem;
    }

    .logo {
        font-size: 1rem;
        letter-spacing: 0;
    }

    .search-container {
        width: 80px;
    }

    .forum-content {
        padding: 0 0.5rem;
    }

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

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

    .tags-selector {
        gap: 0.5rem;
    }

    .bbcode-btn {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }
}

/* ==================== LANDSCAPE PHONE ==================== */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-menu {
        max-height: calc(100vh - 52px);
    }

    .pm-container {
        height: calc(100vh - 60px);
    }

    .auth-container {
        min-height: auto;
        padding: 2rem 0;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .forum-header,
    .forum-sidebar,
    .forum-footer,
    .post-actions,
    .quick-reply,
    .search-container,
    .notification-wrapper,
    .hamburger-menu,
    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .post-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    main.forum-content {
        animation: none;
    }
}

/* ==================== HIGH CONTRAST ==================== */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(192, 192, 192, 0.3);
        --text-secondary: #aaa;
        --text-muted: #888;
    }

    .btn-primary {
        border: 2px solid var(--accent-light);
    }
}
