/* ============================================
   assets/css/main.css  –  CraftHost
   Dark, pixelated-meets-modern aesthetic
   RED ACCENT THEME
   ============================================ */

:root {
  --bg:          #0d0f14;
  --bg2:         #13161e;
  --bg3:         #1a1d28;
  --border:      #252836;
  --text:        #e8ecf5;
  --muted:       #8892a4;
  --accent:      #ef4444;   /* Bright red - Minecraft redstone */
  --accent2:     #dc2626;   /* Darker red for hover */
  --accent-dark: #991b1b;   /* Deep red for active states */
  --gold:        #fbbf24;
  --blue:        #60a5fa;
  --red:         #f87171;
  --radius:      10px;
  --font:        'Outfit', sans-serif;
  --mono:        'JetBrains Mono', monospace;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ── Navbar ─────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,15,20,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 32px; height: 64px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.2rem; }
.logo-icon { font-size: 1.4rem; }
.logo-text strong { color: var(--accent); }
.nav-links { display: flex; list-style: none; gap: 4px; margin-right: auto; }
.nav-links a { color: var(--muted); padding: 6px 12px; border-radius: 6px; font-weight: 500; transition: .2s; }
.nav-links a:hover { color: var(--text); background: var(--bg3); }
.nav-auth { display: flex; gap: 8px; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; border-radius: var(--radius);
  font-family: var(--font); font-weight: 600; font-size: .9rem;
  cursor: pointer; border: none; transition: .2s;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); color: #fff; transform: translateY(-1px); }
.btn-outline  { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost    { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg3); }
.btn-lg       { padding: 12px 28px; font-size: 1rem; }
.btn-block    { width: 100%; justify-content: center; }
.btn-danger   { background: var(--red); color: #fff; }

/* ── Hero ────────────────────────────────── */
.hero {
  text-align: center; padding: 100px 24px 80px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(239,68,68,.12), transparent);
  border-bottom: 1px solid var(--border);
}
.hero-badge {
  display: inline-block; padding: 4px 14px; border-radius: 99px;
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3);
  color: var(--accent); font-size: .8rem; font-weight: 600; margin-bottom: 20px;
  text-transform: uppercase; letter-spacing: .06em;
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 900; line-height: 1.15; }
.hero h1 span { color: var(--accent); }
.hero p { max-width: 560px; margin: 16px auto 32px; color: var(--muted); font-size: 1.1rem; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; justify-content: center; gap: 48px; margin-top: 64px; }
.hero-stat strong { display: block; font-size: 2rem; font-weight: 800; color: var(--accent); }
.hero-stat span   { color: var(--muted); font-size: .875rem; }

/* ── Plans Grid ──────────────────────────── */
.plans-section { padding: 80px 24px; max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { font-size: 2.2rem; font-weight: 800; }
.section-title p  { color: var(--muted); margin-top: 8px; }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.plan-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px; position: relative;
  transition: .25s; display: flex; flex-direction: column;
}
.plan-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.plan-card.featured { border-color: var(--accent); background: linear-gradient(135deg, var(--bg2), #1a1111); }
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700;
  padding: 3px 12px; border-radius: 99px; white-space: nowrap; text-transform: uppercase;
}
.plan-icon { font-size: 2rem; margin-bottom: 10px; }
.plan-name  { font-size: 1.3rem; font-weight: 700; }
.plan-price { margin: 16px 0; }
.plan-price .amount { font-size: 2.4rem; font-weight: 900; color: var(--accent); }
.plan-price .period { color: var(--muted); font-size: .9rem; }
.plan-specs { margin: 16px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-spec  { background: var(--bg3); border-radius: 8px; padding: 8px 10px; font-size: .82rem; }
.plan-spec strong { display: block; color: var(--text); font-weight: 700; }
.plan-spec span   { color: var(--muted); }
.plan-features { list-style: none; margin: 16px 0; flex: 1; }
.plan-features li { padding: 5px 0; color: var(--muted); font-size: .88rem; }
.plan-features li::before { content: '✓  '; color: var(--accent); font-weight: 700; }

/* ── Auth Forms ──────────────────────────── */
.auth-page {
  min-height: calc(100vh - 64px); display: flex;
  align-items: center; justify-content: center; padding: 40px 24px;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(239,68,68,.08), transparent);
}
.auth-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 28px; font-size: 1.5rem; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-card .subtitle { text-align: center; color: var(--muted); margin-bottom: 28px; font-size: .9rem; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 11px 14px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font); font-size: .95rem;
  transition: .2s;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.form-error { color: var(--red); font-size: .8rem; margin-top: 4px; }

/* ── Alerts ──────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius); font-size: .9rem;
  margin-bottom: 20px; border-left: 3px solid;
}
.alert--success { background: rgba(239,68,68,.1); border-color: var(--accent); color: var(--accent); }
.alert--error   { background: rgba(248,113,113,.1); border-color: var(--red); color: var(--red); }
.alert--info    { background: rgba(96,165,250,.1); border-color: var(--blue); color: var(--blue); }

/* ── Dashboard ───────────────────────────── */
.dashboard-layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar {
  width: 260px; background: var(--bg2); border-right: 1px solid var(--border);
  padding: 24px 0; flex-shrink: 0;
}
.sidebar-nav { list-style: none; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; color: var(--muted); font-weight: 500;
  transition: .2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active { 
  color: var(--text); background: var(--bg3); 
  border-right: 3px solid var(--accent); 
}
.sidebar-nav a span { font-size: 1.2rem; }
.dashboard-content { flex: 1; padding: 32px; overflow-y: auto; }
.dashboard-header { margin-bottom: 28px; }
.dashboard-header h1 { font-size: 1.6rem; font-weight: 800; }
.dashboard-header p  { color: var(--muted); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card  { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: .2s; }
.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.stat-card .stat-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-val   { font-size: 2rem; font-weight: 800; margin-top: 4px; color: var(--accent); }
.stat-card .stat-icon  { font-size: 1.4rem; margin-bottom: 8px; }

.table-wrap { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { background: var(--bg3); color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 14px 16px; text-align: left; }
td { padding: 12px 16px; border-top: 1px solid var(--border); font-size: .9rem; }
tr:hover td { background: rgba(239,68,68,.03); }

/* ── Status badges ───────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 4px 12px;
  border-radius: 99px; font-size: .75rem; font-weight: 600; text-transform: uppercase;
}
.badge-active    { background: rgba(239,68,68,.15); color: var(--accent); }
.badge-pending   { background: rgba(251,191,36,.15); color: var(--gold); }
.badge-suspended { background: rgba(248,113,113,.15); color: var(--red); }
.badge-cancelled { background: rgba(100,100,120,.15); color: var(--muted); }

/* ── Server Cards ────────────────────────── */
.server-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 16px;
  transition: .2s;
}
.server-card:hover { border-color: var(--accent); }
.server-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.server-name { font-size: 1.2rem; font-weight: 700; }
.server-status { display: flex; align-items: center; gap: 8px; }
.server-ip { font-family: var(--mono); color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.server-controls { display: flex; gap: 8px; margin-top: 12px; }

/* ── Ticket System ───────────────────────── */
.ticket-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 16px;
  cursor: pointer; transition: .2s;
}
.ticket-card:hover { border-color: var(--accent); transform: translateX(4px); }
.ticket-priority-high { border-left: 4px solid var(--accent); }
.ticket-priority-medium { border-left: 4px solid var(--gold); }
.ticket-priority-low { border-left: 4px solid var(--blue); }
.ticket-meta { display: flex; gap: 16px; margin-top: 8px; font-size: .8rem; color: var(--muted); }

/* ── Mobile Sidebar (for dashboard) ──────── */
.mobile-menu-btn {
  display: none; position: fixed; bottom: 20px; right: 20px;
  background: var(--accent); color: #fff; border: none;
  width: 56px; height: 56px; border-radius: 50%;
  font-size: 1.5rem; cursor: pointer; z-index: 200;
  box-shadow: var(--shadow);
}
.sidebar-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.7); z-index: 150;
}

/* ── Utilities ───────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-muted { color: var(--muted); }
.text-accent{ color: var(--accent); }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } 
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Footer ──────────────────────────────── */
.footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 56px 24px 0; margin-top: 80px; }
.footer-container { max-width: 1200px; margin: 0 auto; display: flex; gap: 48px; flex-wrap: wrap; }
.footer-brand { max-width: 260px; }
.footer-brand p { color: var(--muted); font-size: .875rem; margin-top: 10px; line-height: 1.7; }
.footer-links { display: flex; gap: 48px; flex: 1; flex-wrap: wrap; }
.footer-links h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.footer-links a  { display: block; color: var(--muted); font-size: .875rem; padding: 3px 0; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { max-width: 1200px; margin: 32px auto 0; padding: 20px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; text-align: center; }

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .nav-links, .nav-auth { display: none; }
  .nav-toggle { display: block; margin-left: auto; }
  .hero-stats { flex-wrap: wrap; gap: 28px; }
  
  /* Mobile sidebar */
  .sidebar { 
    position: fixed; left: -280px; top: 0; bottom: 0; 
    width: 280px; z-index: 160; transition: left .3s ease;
    overflow-y: auto;
  }
  .sidebar.open { left: 0; }
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
  .sidebar-overlay.open { display: block; }
  .dashboard-content { padding: 20px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Print Styles ────────────────────────── */
@media print {
  .navbar, .sidebar, .footer, .btn, .mobile-menu-btn { display: none; }
  body { background: white; color: black; }
}
/* ============================================
   MOBILE NAVBAR STYLES
   ============================================ */

/* Mobile Menu - Hidden by default */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg2);
    border-left: 1px solid var(--border);
    z-index: 1000;
    padding: 80px 24px 24px;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

.mobile-menu.open {
    right: 0;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    display: none;
    backdrop-filter: blur(4px);
}

.mobile-overlay.open {
    display: block;
}

.mobile-nav-links {
    list-style: none;
    margin-bottom: 24px;
}

.mobile-nav-links li {
    margin-bottom: 8px;
}

.mobile-nav-links a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.mobile-nav-links a:hover {
    background: var(--bg3);
    color: var(--accent);
}

.mobile-nav-auth {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Hide desktop nav on mobile */
@media (max-width: 768px) {
    .nav-links, .nav-auth {
        display: none !important;
    }
    
    .nav-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg3);
        border-radius: 8px;
        font-size: 1.5rem;
    }
    
    .nav-toggle:hover {
        background: var(--accent);
        color: white;
    }
}

/* Show desktop nav on larger screens */
@media (min-width: 769px) {
    .mobile-menu, .mobile-overlay, .nav-toggle {
        display: none !important;
    }
    
    .nav-links, .nav-auth {
        display: flex !important;
    }
}

/* Animation for menu items */
.mobile-menu.open .mobile-nav-links li {
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateX(20px);
}

.mobile-menu.open .mobile-nav-links li:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu.open .mobile-nav-links li:nth-child(2) { animation-delay: 0.1s; }
.mobile-menu.open .mobile-nav-links li:nth-child(3) { animation-delay: 0.15s; }
.mobile-menu.open .mobile-nav-links li:nth-child(4) { animation-delay: 0.2s; }

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
/* Additional styles for enhanced JS features */

/* Password strength meter */
.strength-meter {
    height: 4px;
    background: var(--bg3);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-bar {
    width: 0%;
    height: 100%;
    transition: width 0.3s ease;
    background: var(--accent);
}

/* Form validation error state */
.form-control.error {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1) !important;
}

/* Sortable table headers */
.sortable-table th {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px !important;
}

.sortable-table th.asc::after,
.sortable-table th.desc::after {
    content: '▼';
    position: absolute;
    right: 8px;
    opacity: 0.6;
    font-size: 0.7rem;
}

.sortable-table th.asc::after {
    content: '▲';
}

.sortable-table th:hover::after {
    opacity: 1;
}

/* Alert close button */
.alert button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 12px;
    opacity: 0.7;
    float: right;
}

.alert button:hover {
    opacity: 1;
}

/* Copy button feedback */
[data-copy] {
    cursor: pointer;
    transition: all 0.2s;
}

[data-copy]:active {
    transform: scale(0.95);
}

/* Mobile menu improvements */
@media (max-width: 768px) {
    body.menu-open {
        overflow: hidden;
    }
    
    .mobile-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg2);
        border-left: 1px solid var(--border);
        z-index: 1000;
        padding: 80px 24px 24px;
        transition: right 0.3s ease;
        overflow-y: auto;
    }
    
    .mobile-menu.open {
        right: 0;
    }
    
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 999;
        display: none;
    }
    
    .mobile-overlay.open {
        display: block;
    }
    
    .mobile-nav-links {
        list-style: none;
        margin-bottom: 24px;
    }
    
    .mobile-nav-links li {
        margin-bottom: 8px;
    }
    
    .mobile-nav-links a {
        display: block;
        padding: 12px 16px;
        color: var(--text);
        border-radius: 8px;
        transition: all 0.2s;
    }
    
    .mobile-nav-links a:hover {
        background: var(--bg3);
        color: var(--accent);
    }
    
    .mobile-nav-auth {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding-top: 24px;
        border-top: 1px solid var(--border);
    }
    
    .nav-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg3);
        border-radius: 8px;
        font-size: 1.5rem;
        cursor: pointer;
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}