/* ============================================
   DEV-MS.RO - Master Server Monitoring
   Dark Theme CSS
   ============================================ */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2236;
    --bg-card-hover: #1f2943;
    --bg-input: #0f1629;
    --border: #2a3550;
    --border-hover: #3a4a6a;
    --text-primary: #e8edf5;
    --text-secondary: #8896b0;
    --text-muted: #5a6880;
    --accent: #de9b35;
    --accent-hover: #f0b04a;
    --accent-glow: rgba(222, 155, 53, 0.15);
    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.1);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --blue: #3b82f6;
    --blue-bg: rgba(59, 130, 246, 0.1);
    --yellow: #eab308;
    --yellow-bg: rgba(234, 179, 8, 0.1);
    --purple: #a855f7;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ===== NAVBAR ===== */
.navbar {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 0;
}
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.navbar-brand { display: flex; align-items: center; }
.navbar-brand svg { height: 32px; width: auto; }
.navbar-menu { display: flex; gap: 4px; align-items: center; }
.nav-link {
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-link.active { color: var(--accent); background: var(--accent-glow); }
.nav-admin { color: var(--accent); }
.navbar-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== HERO / STATS ===== */
.hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border);
    padding: 40px 0;
}
.hero-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}
.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 18px;
}
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.blue { background: var(--blue-bg); color: var(--blue); }
.stat-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }
.stat-icon.red { background: var(--red-bg); color: var(--red); }
.stat-icon.accent { background: var(--accent-glow); color: var(--accent); }
.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ===== MAIN CONTENT ===== */
main { flex: 1; padding: 30px 0; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}
.section-title {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title i { color: var(--accent); }

/* ===== SEARCH & FILTERS ===== */
.search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.search-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    min-width: 260px;
    transition: var(--transition);
    font-family: inherit;
}
.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-input::placeholder { color: var(--text-muted); }

/* ===== TABLE ===== */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
thead { background: var(--bg-secondary); }
th {
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
th a { color: var(--text-muted); }
th a:hover { color: var(--accent); }
td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(42, 53, 80, 0.5);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }

.master-address {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
}
.server-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    color: var(--accent);
    padding: 4px 14px;
    border-radius: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    min-width: 50px;
    transition: var(--transition);
    cursor: pointer;
}
.server-count:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-online { background: var(--green-bg); color: var(--green); }
.badge-offline { background: var(--red-bg); color: var(--red); }
.badge-pending { background: var(--yellow-bg); color: var(--yellow); }
.badge-disabled { background: rgba(100, 116, 139, 0.1); color: #64748b; }
.badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.badge-online .dot { animation: pulse 2s infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Flag + country */
.country-cell { display: flex; align-items: center; gap: 8px; }
.flag { width: 22px; height: 16px; border-radius: 2px; object-fit: cover; }
.flag-sm { width: 18px; height: 13px; }

/* Vote button */
.vote-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 4px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.vote-btn.voted { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.vote-btn i { font-size: 12px; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-header h3 i { color: var(--accent); }
.card-body { padding: 24px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #000;
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #16a34a; color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea.form-control { min-height: 100px; resize: vertical; }
.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid;
}
.alert-success { background: var(--green-bg); color: var(--green); border-color: rgba(34, 197, 94, 0.2); }
.alert-error { background: var(--red-bg); color: var(--red); border-color: rgba(239, 68, 68, 0.2); }
.alert-info { background: var(--blue-bg); color: var(--blue); border-color: rgba(59, 130, 246, 0.2); }
.alert-warning { background: var(--yellow-bg); color: var(--yellow); border-color: rgba(234, 179, 8, 0.2); }

/* ===== DOWNLOAD PAGE ===== */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    transition: var(--transition);
}
.download-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.download-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}
.download-card h3 { font-size: 18px; margin-bottom: 8px; }
.download-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }

/* ===== SERVER LIST PAGE ===== */
.server-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.server-ip-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}
.server-ip-card:hover { border-color: var(--accent); }
.copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: var(--transition);
}
.copy-btn:hover { color: var(--accent); }
.copy-btn.copied { color: var(--green); }

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}
.modal-close:hover { color: var(--red); }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== ADMIN ===== */
.admin-layout { display: flex; min-height: calc(100vh - 64px); }
.admin-sidebar {
    width: 250px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
}
.admin-sidebar .sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.admin-sidebar .sidebar-link:hover { color: var(--text-primary); background: var(--bg-card); }
.admin-sidebar .sidebar-link.active { color: var(--accent); background: var(--accent-glow); border-right: 3px solid var(--accent); }
.admin-sidebar .sidebar-link i { width: 20px; text-align: center; }
.admin-sidebar .sidebar-divider { height: 1px; background: var(--border); margin: 12px 0; }
.admin-content { flex: 1; padding: 24px; overflow-x: auto; }

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}
.login-card h2 { text-align: center; margin-bottom: 8px; }
.login-card .login-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 30px; font-size: 14px; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 20px 0;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active { background: var(--accent); color: #000; border-color: var(--accent); }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 16px; }

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 40px 0 20px;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}
.footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.footer-col a {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 4px 0;
}
.footer-col a:hover { color: var(--accent); }
.footer-desc { color: var(--text-muted); font-size: 14px; margin-top: 12px; line-height: 1.7; }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== UTILITIES ===== */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-mono { font-family: 'JetBrains Mono', monospace; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.w-full { width: 100%; }

/* Count badge in admin sidebar */
.count-badge {
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar-toggle { display: block; }
    .navbar-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: 10px;
        flex-direction: column;
    }
    .navbar-menu.active { display: flex; }
    
    .hero { padding: 24px 0; }
    .hero-title { font-size: 24px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    
    .section-header { flex-direction: column; align-items: flex-start; }
    .search-input { min-width: 100%; }
    
    .form-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .download-grid { grid-template-columns: 1fr; }
    .server-list-grid { grid-template-columns: 1fr; }
    
    /* Admin responsive */
    .admin-layout { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 10px;
        gap: 4px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .admin-sidebar .sidebar-link { padding: 8px 14px; white-space: nowrap; border-radius: var(--radius-xs); }
    .admin-sidebar .sidebar-link.active { border-right: none; }
    .admin-sidebar .sidebar-divider { display: none; }
    .admin-content { padding: 16px; }
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
    
    .table-scroll { font-size: 13px; }
    td, th { padding: 10px 12px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 22px; }
    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; justify-content: center; }
}
