/* ═══════════════════════════════════════════════════
   HAURUS DASHBOARD — Main Stylesheet
   ═══════════════════════════════════════════════════ */

:root {
    --bg-primary: #0F0F1A;
    --bg-secondary: #1A1A2E;
    --bg-card: #16213E;
    --bg-card-hover: #1a2745;
    --bg-input: #0d1526;
    --accent: #E94560;
    --accent-hover: #d63d56;
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0B0;
    --text-muted: #6c6c7e;
    --success: #27AE60;
    --warning: #E67E22;
    --danger: #E74C3C;
    --info: #3498DB;
    --border: #2a2a4a;
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --transition: all 0.2s ease;
}

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

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

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

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── LANDING PAGE ── */
.landing { min-height: 100vh; display: flex; flex-direction: column; }

.landing-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 40px; background: rgba(15,15,26,0.9);
    backdrop-filter: blur(10px); position: fixed; width: 100%; z-index: 100;
    border-bottom: 1px solid var(--border);
}

.landing-logo { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.landing-logo span { color: var(--accent); }

.landing-hero {
    flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 140px 20px 80px;
    background: radial-gradient(ellipse at top, rgba(233,69,96,0.08) 0%, transparent 60%);
}

.landing-hero h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 20px; }
.landing-hero h1 span { color: var(--accent); }
.landing-hero p { font-size: 1.2rem; color: var(--text-secondary); max-width: 600px; margin-bottom: 40px; }

.btn-group { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: var(--radius); font-size: 0.95rem;
    font-weight: 600; border: none; cursor: pointer; transition: var(--transition);
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); color: white; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(233,69,96,0.3); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); color: white; transform: translateY(-2px); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

.landing-stats {
    display: flex; gap: 60px; justify-content: center; padding: 60px 20px;
    background: var(--bg-secondary);
}
.stat { text-align: center; }
.stat-value { font-size: 2.5rem; font-weight: 800; color: var(--accent); }
.stat-label { color: var(--text-secondary); font-size: 0.9rem; }

.landing-features {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px; padding: 80px 40px; max-width: 1200px; margin: 0 auto;
}
.feature-card {
    background: var(--bg-card); border-radius: var(--radius-lg); padding: 32px;
    border: 1px solid var(--border); transition: var(--transition);
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.feature-icon { font-size: 2rem; margin-bottom: 16px; }
.feature-card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; }

/* ── SERVERS PAGE ── */
.servers-page {
    padding: 40px; max-width: 1000px; margin: 0 auto; min-height: 100vh;
}
.servers-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;
}
.user-info { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; }

.servers-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
}
.server-card {
    background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px;
    border: 1px solid var(--border); display: flex; align-items: center; gap: 16px;
    transition: var(--transition); cursor: pointer;
}
.server-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.server-card.disabled { opacity: 0.5; cursor: default; }
.server-card.disabled:hover { border-color: var(--border); transform: none; }
.server-icon {
    width: 52px; height: 52px; border-radius: var(--radius); flex-shrink: 0;
    background: var(--bg-secondary); display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 700; color: var(--text-secondary); overflow: hidden;
}
.server-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-info h3 { font-size: 1rem; margin-bottom: 2px; }
.server-info p { font-size: 0.8rem; color: var(--text-secondary); }

/* ── DASHBOARD LAYOUT ── */
.dashboard { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width); background: var(--bg-secondary);
    border-right: 1px solid var(--border); position: fixed; top: 0; left: 0;
    height: 100vh; overflow-y: auto; z-index: 50; display: flex; flex-direction: column;
}
.sidebar-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.sidebar-header img { width: 36px; height: 36px; border-radius: var(--radius); }
.sidebar-header .guild-name { font-size: 0.9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-header .guild-members { font-size: 0.75rem; color: var(--text-secondary); }

.sidebar-nav { flex: 1; padding: 12px 10px; }
.nav-section { margin-bottom: 20px; }
.nav-section-title {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); padding: 0 10px; margin-bottom: 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-radius: var(--radius); color: var(--text-secondary); font-size: 0.88rem;
    transition: var(--transition); cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.nav-item.active { background: rgba(233,69,96,0.15); color: var(--accent); font-weight: 600; }
.nav-item .nav-icon { width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .module-status {
    margin-left: auto; width: 8px; height: 8px; border-radius: 50; flex-shrink: 0;
}
.module-status.on { background: var(--success); border-radius: 50%; }
.module-status.off { background: var(--danger); border-radius: 50%; }

.sidebar-footer {
    padding: 12px 20px; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-footer img { width: 28px; height: 28px; border-radius: 50%; }
.sidebar-footer .username { font-size: 0.85rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-content { flex: 1; margin-left: var(--sidebar-width); }

.topbar {
    height: var(--header-height); background: var(--bg-secondary);
    border-bottom: 1px solid var(--border); display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 30px; position: sticky; top: 0; z-index: 40;
    backdrop-filter: blur(10px);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb span { color: var(--text-muted); }

.content { padding: 30px; max-width: 1200px; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.page-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 30px; }

/* ── CARDS ── */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-title { font-size: 1.05rem; font-weight: 700; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 24px; }
.status-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; transition: var(--transition);
}
.status-card:hover { border-color: var(--accent); }
.status-card .status-icon { font-size: 1.5rem; margin-bottom: 8px; }
.status-card h4 { font-size: 0.9rem; margin-bottom: 4px; }
.status-card .status-value { font-size: 1.6rem; font-weight: 800; }
.status-card.success { border-left: 3px solid var(--success); }
.status-card.warning { border-left: 3px solid var(--warning); }
.status-card.danger { border-left: 3px solid var(--danger); }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.form-input, .form-select {
    width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary); font-size: 0.9rem;
    transition: var(--transition); outline: none;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); }
.form-select { cursor: pointer; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* ── TOGGLE ── */
.toggle-wrapper { display: flex; align-items: center; gap: 12px; }
.toggle {
    position: relative; width: 48px; height: 26px; cursor: pointer;
}
.toggle input { display: none; }
.toggle-slider {
    position: absolute; inset: 0; background: var(--border); border-radius: 26px;
    transition: var(--transition);
}
.toggle-slider::after {
    content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px;
    background: white; border-radius: 50%; transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::after { transform: translateX(22px); }
.toggle-label { font-size: 0.9rem; }

/* ── SLIDER ── */
.range-wrapper { display: flex; align-items: center; gap: 12px; }
.range-wrapper input[type="range"] {
    flex: 1; -webkit-appearance: none; height: 6px; background: var(--border);
    border-radius: 3px; outline: none;
}
.range-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px; background: var(--accent);
    border-radius: 50%; cursor: pointer;
}
.range-value { min-width: 40px; text-align: center; font-weight: 600; font-size: 0.9rem; }

/* ── TABLE ── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 12px 16px; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; font-size: 0.88rem; border-bottom: 1px solid rgba(42,42,74,0.5); }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── BADGES ── */
.badge {
    display: inline-flex; padding: 3px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: rgba(39,174,96,0.15); color: var(--success); }
.badge-danger { background: rgba(231,76,60,0.15); color: var(--danger); }
.badge-warning { background: rgba(230,126,34,0.15); color: var(--warning); }
.badge-info { background: rgba(52,152,219,0.15); color: var(--info); }

/* ── TOAST ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 14px 20px; border-radius: var(--radius); font-size: 0.88rem;
    color: white; animation: slideIn 0.3s ease; box-shadow: var(--shadow); min-width: 280px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── MODAL ── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 28px; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto;
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── SCORE ── */
.score-ring {
    width: 120px; height: 120px; position: relative; margin: 0 auto 16px;
}
.score-ring svg { transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 8; }
.score-ring .bg { stroke: var(--border); }
.score-ring .fg { stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.score-value {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 800;
}

/* ── PAGINATION ── */
.pagination { display: flex; gap: 6px; margin-top: 20px; justify-content: center; }
.pagination button {
    padding: 6px 12px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-secondary); cursor: pointer;
    font-size: 0.85rem; transition: var(--transition);
}
.pagination button:hover, .pagination button.active { border-color: var(--accent); color: var(--accent); }

/* ── UNSAVED CHANGES BAR ── */
.unsaved-bar {
    position: fixed; bottom: 0; left: var(--sidebar-width); right: 0;
    background: var(--bg-secondary); border-top: 1px solid var(--accent);
    padding: 12px 30px; display: none; align-items: center; justify-content: space-between;
    z-index: 45; animation: slideUp 0.2s ease;
}
.unsaved-bar.active { display: flex; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── LOADING ── */
.loading {
    display: flex; align-items: center; justify-content: center; padding: 60px;
}
.spinner {
    width: 36px; height: 36px; border: 3px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: var(--transition); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .unsaved-bar { left: 0; }
    .landing-hero h1 { font-size: 2rem; }
    .landing-stats { flex-direction: column; gap: 30px; align-items: center; }
    .topbar { padding: 0 16px; }
    .content { padding: 16px; }
}
