/* Tadawul Sim - Modern Dark Trading Theme */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 30, 0.6);
    --bg-hover: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent-green: #00d97e;
    --accent-red: #ff4757;
    --accent-blue: #4f8cff;
    --accent-purple: #a855f7;
    --glass-bg: rgba(20, 20, 35, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glass effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

/* Layout */
#app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    margin-bottom: 32px;
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.brand span {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.nav { flex: 1; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overflow-x: hidden; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(79, 140, 255, 0.2));
    color: var(--text-primary);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.nav-item svg { opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

.market-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-red);
}

.status-dot.open { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 71, 87, 0.1);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Main */
.main {
    flex: 1;
    margin-left: 240px;
    padding: 24px 32px;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-actions { display: flex; align-items: center; gap: 16px; }

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    min-width: 280px;
}

.search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
}

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

/* Pages */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

.stat-change {
    display: flex;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
}

.stat-change.positive { color: var(--accent-green); }
.stat-change.negative { color: var(--accent-red); }
.stat-change.neutral { color: var(--text-secondary); }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* Cards */
.card { padding: 24px; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 { font-size: 16px; font-weight: 600; }

.link {
    font-size: 13px;
    color: var(--accent-blue);
    text-decoration: none;
}

.link:hover { text-decoration: underline; }

/* Chart */
.chart-container {
    height: 280px;
    position: relative;
    padding: 16px 0;
}

.chart-container canvas {
    width: 100% !important;
    height: 240px !important;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding: 8px 0 0;
    font-size: 11px;
    color: var(--text-muted);
}

/* Positions List */
.positions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Position Cards */
.position-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}

.position-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.pos-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.pos-ticker {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.pos-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.pos-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pos-stat .label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pos-stat .value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.pos-pnl {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.pos-pnl.positive { color: var(--accent-green); }
.pos-pnl.negative { color: var(--accent-red); }

.pnl-amount {
    font-size: 16px;
    font-weight: 600;
}

.pnl-pct {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.pos-pnl.positive .pnl-pct {
    background: rgba(0, 217, 126, 0.15);
}

.pos-pnl.negative .pnl-pct {
    background: rgba(255, 71, 87, 0.15);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

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

/* Summary Bar */
.summary-bar {
    display: flex;
    gap: 32px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.summary-item { display: flex; flex-direction: column; gap: 4px; }
.summary-item .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; }
.summary-item .value { font-size: 18px; font-weight: 600; }

/* Tables */
.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.data-table tr:hover td { background: var(--bg-hover); }

.data-table .empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

.positive { color: var(--accent-green); }
.negative { color: var(--accent-red); }

/* Trade Layout */
.trade-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.trade-panel form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input, .form-group select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent-purple);
}

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

/* Side Toggle */
.side-toggle { display: flex; gap: 8px; }

.side-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.side-btn:hover { background: var(--bg-hover); }

.side-btn.buy.active {
    background: rgba(0, 217, 126, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.side-btn.sell.active {
    background: rgba(255, 71, 87, 0.15);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Order Summary */
.order-summary {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-summary .row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.order-summary .row span:first-child { color: var(--text-secondary); }

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

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

.btn-sm {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.btn-sm:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

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

.btn-outline:hover { background: var(--bg-hover); }

/* Quote Panel */
.quote-info { padding: 20px; }

.quote-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 0;
}

.quote-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.quote-row:last-child { border-bottom: none; }

.quote-row .label { color: var(--text-secondary); }
.quote-row .quote-name { 
    color: var(--text-muted); 
    font-size: 0.85em;
    max-width: 150px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.filled {
    background: rgba(0, 217, 126, 0.15);
    color: var(--accent-green);
}

.status-badge.pending {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.status-badge.rejected {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-red);
}

/* Hamburger - hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
}
.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .trade-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }
    .sidebar-overlay.active {
        display: block;
    }
    .main { margin-left: 0; padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .summary-bar { flex-wrap: wrap; gap: 16px; }
    .hamburger {
        display: flex;
    }
    .header { padding-top: 8px; }
    .page-title { font-size: 20px; }
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0f0f1a 50%, var(--bg-primary) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(79, 140, 255, 0.1) 0%, transparent 50%);
    animation: loginGlow 20s ease-in-out infinite;
}

@keyframes loginGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-5%, -5%); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin: 0 auto 16px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group input {
    padding: 14px 16px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
}

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

.forgot-link {
    color: var(--accent-blue);
    text-decoration: none;
}

.forgot-link:hover { text-decoration: underline; }

.btn-block {
    width: 100%;
    margin-top: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-footer a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover { text-decoration: underline; }

/* Error/Success messages */
.auth-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.auth-message.error {
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.auth-message.success {
    background: rgba(0, 217, 126, 0.15);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.auth-message.show { display: block; }

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
}

.toast.success {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, rgba(0, 217, 126, 0.1) 0%, var(--bg-secondary) 100%);
}

.toast.error {
    border-color: var(--accent-red);
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.1) 0%, var(--bg-secondary) 100%);
}

.toast.warning {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-secondary) 100%);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: var(--accent-green);
    color: var(--bg-primary);
}

.toast.error .toast-icon {
    background: var(--accent-red);
    color: white;
}

.toast.warning .toast-icon {
    background: #f59e0b;
    color: var(--bg-primary);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

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

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

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

/* Community / Message Board */
.community-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.community-main { min-width: 0; }

.community-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.post-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.post-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.post-balance {
    color: var(--accent-green);
    font-weight: 500;
}

.post-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    display: flex;
    align-items: center;
    gap: 16px;
}

.reactions {
    display: flex;
    gap: 8px;
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-hover);
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-btn:hover {
    background: var(--accent-purple);
    color: white;
}

.reaction-btn.active {
    background: var(--accent-purple);
    color: white;
}

.reaction-btn .emoji {
    font-size: 14px;
}

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

/* Mentions Card */
.mentions-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mention-badge {
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.mentions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.mention-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

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

.mention-item.unread {
    border-left: 3px solid var(--accent-purple);
}

.mention-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.mention-by {
    font-weight: 500;
    font-size: 13px;
}

.mention-time {
    font-size: 11px;
    color: var(--text-muted);
}

.mention-preview {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

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

.form-group textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-group textarea:focus {
    border-color: var(--accent-purple);
}

/* Post Detail */
.post-detail {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.post-detail-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.post-detail-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.post-detail-reactions {
    display: flex;
    gap: 8px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.comments-section h4 {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.comment-content {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.comment-reactions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.comment-form {
    margin-top: 16px;
}

.comment-form textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 14px;
    color: var(--text-primary);
    resize: none;
    min-height: 80px;
}

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

/* Mobile Community */
@media (max-width: 900px) {
    .community-layout {
        grid-template-columns: 1fr;
    }
    
    .community-sidebar {
        position: static;
        order: -1;
    }
    
    .mentions-list {
        max-height: 200px;
    }
}

/* Reaction Picker */
.reaction-picker {
    display: flex;
    gap: 4px;
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.reaction-picker-btn {
    background: none;
    border: none;
    font-size: 20px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 16px;
    transition: all 0.2s;
}

.reaction-picker-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.2);
}

/* Mention highlight in content */
.mention {
    color: var(--accent-purple);
    font-weight: 500;
    text-decoration: none;
}

.mention:hover {
    text-decoration: underline;
}
