/* =========================================
   Local Vazirmatn Font
   Uses the variable WOFF2 file from assets/fonts
   ========================================= */
@font-face {
    font-family: "Vazirmatn";
    src: url("../assets/fonts/Vazirmatn%5Bwght%5D.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

/* =========================================
   1. Variables & Reset
   ========================================= */
:root {
    --bg-main: #13151f;
    --bg-sidebar: #0e1117;
    --bg-card: #181b28;
    --border-color: #222637;
    --text-main: #ffffff;
    --text-muted: #8b92a5;
    --accent-blue: #3273f6;
    --accent-red: #ff4757;
    --accent-green: #2ed573;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif; 
}

/* استایل عمومی بدنه سایت (مناسب برای صفحات عادی و سایت اصلی) */
body { 
    font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
    background-color: var(--bg-main); 
    color: var(--text-main); 
    min-height: 100vh;
}

/* کانتینر اختصاصی پنل مدیریت (جهت جلوگیری از تداخل با سایت اصلی) */
.admin-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    width: 100%;
}

/* =========================================
   2. Sidebar Styling
   ========================================= */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 22px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    letter-spacing: 0.5px;
}

.sidebar-menu {
    padding: 15px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex-grow: 1;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.sidebar-item.active {
    background-color: var(--accent-blue);
    color: var(--text-main);
    font-weight: 600;
}

.sidebar-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* =========================================
   3. Main Layout & Top Navbar
   ========================================= */
.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    height: 100vh;
    overflow: hidden; 
}

.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: rgba(14, 17, 23, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.top-nav-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-switcher {
    display: flex;
    align-items: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: 0.2s;
}

.lang-btn img {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
}

.lang-btn:hover {
    color: var(--text-main);
}

.lang-btn.active {
    background-color: var(--accent-blue);
    color: var(--text-main);
    font-weight: 600;
}

/* =========================================
   4. General Components & Content
   ========================================= */
.main-content {
    padding: 25px;
    flex-grow: 1;
    overflow-y: auto;
}

.page-header { 
    margin-bottom: 30px; 
}

.page-title { 
    font-size: 1.8rem; 
    font-weight: bold; 
    margin-bottom: 5px; 
}

.page-desc { 
    color: var(--text-muted); 
    font-size: 0.95rem; 
}

.dashboard-btn {
    background-color: var(--accent-blue);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(50, 115, 246, 0.3);
    transition: 0.2s;
    cursor: pointer;
    border: none;
}

.dashboard-btn:hover {
    opacity: 0.9;
}

.btn-secondary {
    flex: 1;
    background-color: #1f2333;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-secondary:hover {
    background-color: #282d42;
}

/* =========================================
   5. Toolbar & Tables
   ========================================= */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.search-filter-wrapper { display: flex; gap: 15px; align-items: center; }

.search-box { position: relative; width: 320px; }
.search-box input { width: 100%; background-color: var(--bg-card); border: 1px solid var(--border-color); padding: 10px 15px 10px 40px; border-radius: 8px; color: white; outline: none; font-size: 0.9rem; }
.search-box input::placeholder { color: #5a627a; }
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.filter-btn { background-color: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-muted); padding: 10px 15px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }

.view-options { display: flex; gap: 5px; }
.view-btn { background-color: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-muted); width: 38px; height: 38px; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.view-btn.active { color: white; border-color: var(--accent-blue); }

.servers-card { background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; min-height: 400px; display: flex; flex-direction: column; }

.table-header { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; padding: 15px 25px; border-bottom: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.8rem; font-weight: bold; letter-spacing: 0.5px; }
.table-header div { display: flex; align-items: center; gap: 5px; cursor: pointer; }

.table-row {
    display: grid;
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    font-size: 0.9rem;
}
.table-row:hover { background-color: rgba(255, 255, 255, 0.02); }

.table-footer-counter { margin-top: 15px; color: var(--text-muted); font-size: 0.85rem; }

/* =========================================
   6. Dashboard Grid & Cards
   ========================================= */
.overview-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr;
    gap: 25px;
}

.overview-col-left, .overview-col-right { display: flex; flex-direction: column; gap: 25px; }

.panel-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.card-section-title { font-size: 1rem; font-weight: 600; margin-bottom: 18px; color: var(--text-main); }
.card-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

.link-blue { color: var(--accent-blue); text-decoration: none; font-size: 0.85rem; font-weight: 500; }
.link-blue:hover { text-decoration: underline; }

/* =========================================
   7. Server Specific Styles (Overview)
   ========================================= */
.server-overview-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.server-overview-title-area .page-title { margin-bottom: 10px; }

.server-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.server-tags .tag { background-color: var(--bg-card); border: 1px solid var(--border-color); padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

.server-overview-actions { display: flex; align-items: center; gap: 10px; }
.action-icon-btn { background-color: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-muted); width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
.action-icon-btn:hover { color: white; background-color: #222637; }

.shutdown-btn { background-color: #e53935; color: white; border: none; padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; cursor: pointer; box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3); transition: 0.2s; }
.shutdown-btn:hover { opacity: 0.9; }

.server-status-box { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.server-icon-title { display: flex; align-items: center; gap: 15px; }

.game-icon-badge { width: 44px; height: 44px; background-color: #ff9800; color: white; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.game-icon-badge.sm { width: 36px; height: 36px; font-size: 1rem; border-radius: 8px; }

.game-name { font-weight: 600; font-size: 1rem; margin-bottom: 4px; }
.status-badge { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: bold; letter-spacing: 0.5px; }
.status-badge.online { color: var(--accent-green); }
.status-badge .dot { width: 6px; height: 6px; background-color: var(--accent-green); border-radius: 50%; box-shadow: 0 0 8px var(--accent-green); }

.server-detail-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-size: 0.9rem; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.server-detail-row:last-of-type { border-bottom: none; margin-bottom: 15px; }

.detail-label { color: var(--text-muted); }
.detail-value { color: var(--text-main); display: flex; align-items: center; gap: 8px; }

.edit-icon { font-size: 0.75rem; color: var(--text-muted); cursor: pointer; transition: 0.2s; }
.edit-icon:hover { color: white; }

.ip-box { background-color: #13151f; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border-color); }
.ip-box code { color: #ff5252; font-family: monospace; font-size: 0.85rem; }
.copy-icon { color: var(--text-muted); cursor: pointer; font-size: 0.85rem; transition: 0.2s; }
.copy-icon:hover { color: white; }

.server-card-buttons { display: flex; gap: 12px; margin-top: 15px; }

.instance-item { display: flex; align-items: center; gap: 12px; background-color: #13151f; padding: 12px 15px; border-radius: 8px; border: 1px solid var(--border-color); }
.instance-name { font-weight: 600; font-size: 0.9rem; }
.instance-desc { font-size: 0.8rem; color: var(--text-muted); }

/* =========================================
   8. Console & Logs
   ========================================= */
.console-card { display: flex; flex-direction: column; }
.console-header-actions { display: flex; align-items: center; gap: 15px; color: var(--text-muted); font-size: 0.9rem; }

.console-screen { background-color: #0e1017; border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; height: 220px; overflow-y: auto; font-family: monospace; font-size: 0.8rem; color: #a0a6b8; display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.log-line { line-height: 1.4; word-break: break-all; }

.console-input-wrapper input { width: 100%; background-color: #13151f; border: 1px solid var(--border-color); padding: 12px 15px; border-radius: 8px; color: white; outline: none; font-size: 0.85rem; }
.console-input-wrapper input::placeholder { color: var(--text-muted); }

/* =========================================
   9. Server Usage Metrics
   ========================================= */
.usage-metric-item { margin-bottom: 16px; }
.usage-metric-item:last-child { margin-bottom: 0; }

.metric-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.85rem; }
.metric-name { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-weight: 500; }
.metric-val { color: var(--text-main); font-family: monospace; }

.dot-indicator { width: 8px; height: 8px; border-radius: 50%; }
.dot-indicator.cpu { background-color: #ab47bc; }
.dot-indicator.ram { background-color: var(--accent-blue); }
.dot-indicator.storage { background-color: var(--accent-red); }

.progress-bar-bg { width: 100%; height: 6px; background-color: #13151f; border-radius: 3px; overflow: hidden; border: 1px solid var(--border-color); }
.progress-fill { height: 100%; border-radius: 3px; }
.cpu-fill { background-color: #ab47bc; }
.ram-fill { background-color: var(--accent-blue); }
.storage-fill { background-color: var(--accent-red); }

/* =========================================
   10. Tabs & Sub-navigation
   ========================================= */
.tabs-nav { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 12px; }
.tab-btn { background: transparent; border: none; color: var(--text-muted); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 0.9rem; font-weight: 500; transition: 0.2s; }
.tab-btn:hover { color: var(--text-main); background-color: #1c202e; }
.tab-btn.active { color: var(--text-main); background-color: #222637; }
.server-sub-tabs { margin-bottom: 25px; }

/* =========================================
   11. Empty States & Notifications
   ========================================= */
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; }
.empty-graphic { position: relative; width: 120px; height: 70px; margin-bottom: 25px; }
.stack-box { position: absolute; width: 100px; height: 40px; background-color: #222738; border: 1px solid #2f354a; border-radius: 6px; left: 10px; }
.stack-box:nth-child(1) { top: 0px; opacity: 0.4; transform: scale(0.85); }
.stack-box:nth-child(2) { top: 10px; opacity: 0.7; transform: scale(0.92); }
.stack-box:nth-child(3) { top: 20px; background-color: #1c2130; border-color: var(--accent-blue); opacity: 1; display: flex; align-items: center; padding: 0 10px; gap: 8px; }
.mini-dot { width: 8px; height: 8px; background-color: var(--accent-blue); border-radius: 50%; }
.mini-line { width: 45px; height: 6px; background-color: #2f354a; border-radius: 3px; }

.empty-title { font-size: 1.15rem; font-weight: bold; margin-bottom: 8px; color: white; }
.empty-desc { color: var(--text-muted); font-size: 0.85rem; }

#notification { position: fixed; bottom: 20px; right: 20px; background: var(--bg-card); border-left: 4px solid var(--accent-blue); padding: 15px 25px; border-radius: 6px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); transform: translateX(150%); transition: transform 0.3s ease; z-index: 1000; }
#notification.show { transform: translateX(0); }

/* =========================================
   12. FragCity Site Shell & Page Transitions
   ========================================= */

html {
    scroll-behavior: smooth;
}

body.site-body {
    min-height: 100vh;
    overflow-x: hidden;
}


.app-container {
    width: 100%;
    min-width: 0;
    min-height: calc(100vh - 66px);
    display: flex;
    flex-direction: column;
}

.site-body .main-content {
    width: 100%;
    min-width: 0;
}

.content-fader {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.content-fader.fade-out {
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
}

@media (max-width: 700px) {
    .site-body .main-content {
        padding: 18px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .content-fader {
        transition: none;
    }
}
