/* ===== SLIDEWAY FORUM - DESIGN SYSTEM ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: rgba(59,130,246,0.1);
    --danger: #ef4444;
    --danger-light: rgba(239,68,68,0.1);
    --success: #10b981;
    --success-light: rgba(16,185,129,0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245,158,11,0.1);
    --purple: #8b5cf6;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    --header-h: 64px;
}

body.dark {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1c2128;
    --bg-card: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border-color: #30363d;
    --primary-light: rgba(59,130,246,0.15);
    --danger-light: rgba(239,68,68,0.15);
    --success-light: rgba(16,185,129,0.15);
    --warning-light: rgba(245,158,11,0.15);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }

/* ===== LAYOUT ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ===== */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--header-h);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    gap: 16px;
}
.logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}
.logo i { font-size: 1.2rem; }
.logo:hover { color: var(--primary-dark); transform: none; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}
.header-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}
.header-nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(59,130,246,0.45); color: #fff; transform: translateY(-1px); }
.btn-outline {
    border: 1.5px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1.5px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
.btn-success:hover { background: #059669; color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: var(--radius-md); }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    word-break: break-word;
    transition: var(--transition);
}
.card-hover:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-light), rgba(139,92,246,0.08));
    border-radius: var(--radius-xl);
    padding: 48px 24px;
    text-align: center;
    margin-top: 28px;
    border: 1px solid rgba(59,130,246,0.15);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(59,130,246,0.05) 0%, transparent 60%),
                radial-gradient(circle at 70% 50%, rgba(139,92,246,0.05) 0%, transparent 60%);
    pointer-events: none;
}
.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p { color: var(--text-secondary); font-size: 1.05rem; }

/* ===== MAIN LAYOUT ===== */
.main-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px 0;
}
@media (min-width: 992px) {
    .main-layout { display: grid; grid-template-columns: 1fr 320px; align-items: start; }
}

/* ===== AVATARS ===== */
.avatar-wrapper { position: relative; display: inline-flex; flex-shrink: 0; }
.avatar {
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--bg-tertiary);
    display: block;
}
.status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2.5px solid var(--bg-secondary);
    background: var(--text-muted);
}
.status-dot.online { background: var(--success); box-shadow: 0 0 0 2px rgba(16,185,129,0.3); }

/* ===== BADGES ===== */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.status-pending { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.status-working { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(59,130,246,0.3); }
.status-approved { background: var(--success-light); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.status-rejected { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 7px;
    color: var(--text-primary);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    line-height: 1.5;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
    background: var(--bg-secondary);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.checkbox-wrapper { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; }
.checkbox-wrapper input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* ===== CHAT ===== */
.chat-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 480px;
    overflow: hidden;
}
.chat-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
}
.chat-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.chat-input-area {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    background: var(--bg-tertiary);
}
.chat-input-area input {
    flex: 1;
    min-width: 0;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.875rem;
    border: 1.5px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}
.chat-input-area input:focus { border-color: var(--primary); }

/* ===== POST LAYOUT ===== */
.post-layout {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.post-sidebar {
    padding: 20px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
}
.post-sidebar-info { display: flex; flex-direction: column; gap: 5px; }
.post-content { padding: 20px; flex: 1; overflow-x: auto; }
.post-content-body { line-height: 1.75; word-break: break-word; white-space: pre-wrap; font-size: 0.95rem; }
.post-signature {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
}
@media (min-width: 768px) {
    .post-layout { flex-direction: row; }
    .post-sidebar {
        width: 180px;
        flex-direction: column;
        text-align: center;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
        align-items: center;
        flex-shrink: 0;
    }
    .post-sidebar-info { align-items: center; }
}

/* ===== ADMIN ===== */
.admin-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}
@media (min-width: 768px) {
    .admin-layout-grid { grid-template-columns: 220px 1fr; }
}
.admin-menu { display: flex; flex-direction: column; gap: 4px; }
.admin-menu a {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
}
.admin-menu a:hover { background: var(--primary-light); color: var(--primary); }
.admin-menu a.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,0.3); }

/* ===== TABLES ===== */
.table-responsive { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border-color); }
.table-responsive table { border-collapse: collapse; width: 100%; min-width: 600px; }
.table-responsive th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}
.table-responsive td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.table-responsive tr:last-child td { border-bottom: none; }
.table-responsive tr:hover td { background: var(--bg-tertiary); }

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    animation: fadeIn 0.15s ease;
}
.modal.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
    background: var(--bg-secondary);
    padding: 28px;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 460px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-lg { max-width: 680px; }
.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.close-btn:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin: 12px 0;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-error { background: var(--danger-light); border: 1px solid rgba(239,68,68,0.3); color: var(--danger); }
.alert-success { background: var(--success-light); border: 1px solid rgba(16,185,129,0.3); color: var(--success); }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px; align-items: center; }
.pagination a, .pagination span {
    padding: 7px 13px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    color: var(--text-secondary);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(59,130,246,0.3); }

/* ===== TOPIC TAG ===== */
.topic-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid rgba(245,158,11,0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}
.stat-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.stat-card .stat-value { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; font-weight: 500; }

/* ===== ONLINE BADGE ===== */
.online-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--success-light);
    color: var(--success);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid rgba(16,185,129,0.3);
}
.online-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-nav a span:not(.online-badge) { display: none; }
    .header-nav a { padding: 6px 8px; }
    .hero h1 { font-size: 1.6rem; }
    .container { padding: 0 14px; }
    .card { padding: 16px; }
    .btn { padding: 8px 14px; }
}
@media (max-width: 480px) {
    .header-nav { gap: 2px; }
    .header-actions { gap: 5px; }
    .btn-sm { padding: 5px 9px; font-size: 0.75rem; }
}

/* ===== UTILITIES ===== */
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
