/* --- 1. VARIABLES & RESET --- */
:root {
  /* Colors */
  --bg-body: #0f0f13;
  --bg-panel: #1a1a20;
  --bg-input: #0a0a0c;
  --border: #333;
  
  --primary: #f1c40f; /* Gold */
  --accent: #2ecc71;  /* Green */
  --danger: #e74c3c;  /* Red */
  --info: #3498db;    /* Blue */
  
  --text-main: #ecf0f1;
  --text-muted: #95a5a6;
  
  /* Layout */
  --font-main: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 12px;
  --shadow: 0 4px 6px rgba(0,0,0,0.3);
  --container-width: 1200px;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-main);
  margin: 0;
  padding-bottom: 80px; /* Space for mobile nav */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: 0.2s; }
a:hover { color: #fff; text-shadow: 0 0 5px var(--primary); }

h1, h2, h3, h4 { color: #fff; margin-top: 0; font-weight: 700; letter-spacing: -0.5px; }
h1 { font-size: 1.8rem; border-bottom: 1px solid var(--border); padding-bottom: 15px; margin-bottom: 25px; }
h2 { font-size: 1.4rem; margin-bottom: 15px; color: #fff; border-left: 4px solid var(--primary); padding-left: 10px; }
h3 { font-size: 1.1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* --- 2. LAYOUT --- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.split-view {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
}

/* --- 3. COMPONENTS --- */

/* Panels / Cards */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}
/* Optional hover effect for interactive panels */
.panel.interactive:hover { transform: translateY(-2px); box-shadow: 0 8px 15px rgba(0,0,0,0.4); border-color: #555; }

/* Buttons */
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #444, #222);
  border: 1px solid #555;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s;
  gap: 8px;
  user-select: none;
}
button:hover, .button:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.5); filter: brightness(1.2); border-color: #777; }
button:active { transform: translateY(0); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: grayscale(1); }

.btn-primary, button[type="submit"] {
  background: linear-gradient(180deg, var(--primary), #d4ac0d);
  border: none; color: #000;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  box-shadow: 0 2px 5px rgba(241, 196, 15, 0.3);
}
.btn-success { background: linear-gradient(180deg, var(--accent), #27ae60); border: none; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.btn-danger { background: linear-gradient(180deg, var(--danger), #c0392b); border: none; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

/* Forms */
input, select, textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: #fff;
  padding: 12px;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(241, 196, 15, 0.1); }
label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; color: var(--text-muted); padding: 12px; border-bottom: 1px solid var(--border); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; }
td { padding: 12px; border-bottom: 1px solid #222; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.03); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #2a2a2a;
  border: 1px solid #444;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--primary); }
.text-center { text-align: center; }

/* --- 4. NAVIGATION --- */
.navbar {
  background: rgba(20, 20, 25, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1000;
  padding: 0 20px;
  height: 60px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.navbar-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  height: 100%;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-brand { 
  font-weight: 900; font-size: 1.4rem; color: var(--primary); 
  letter-spacing: 1px; display: flex; align-items: center; gap: 10px;
  text-transform: uppercase; 
}
.nav-links { display: flex; align-items: center; gap: 25px; }
.nav-links a { 
  color: var(--text-muted); font-weight: 500; font-size: 0.9rem; position: relative; 
  padding: 5px 0;
}
.nav-links a:hover, .nav-links a.active { color: #fff; text-shadow: none; }
.nav-links a.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--primary);
  box-shadow: 0 -2px 5px rgba(241, 196, 15, 0.5);
}

/* Nav Badge (Red Dot) */
.nav-badge {
  position: absolute; top: -8px; right: -12px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: bold;
  padding: 2px 5px; border-radius: 10px;
  min-width: 15px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg-body);
  animation: pulseBadge 2s infinite;
}
@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* --- 5. MOBILE --- */
.mobile-nav { display: none; }

@media (max-width: 768px) {
  .split-view { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  
  /* Hide Desktop Nav */
  .navbar { display: none; }
  
  /* Show Mobile Bottom Bar */
  .mobile-nav {
    display: flex; justify-content: space-around;
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: #15151a; border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 2000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
  }
  .mobile-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 12px 0; color: #666; font-size: 0.7rem; position: relative;
  }
  .mobile-nav a.active { color: var(--primary); background: rgba(255,255,255,0.03); }
  .mobile-nav i { font-size: 1.2rem; margin-bottom: 4px; }
  
  .nav-badge { top: 5px; right: 25%; box-shadow: none; }
  
  /* Adjustments */
  h1 { font-size: 1.5rem; }
  #chat-widget { width: 100% !important; right: 0; bottom: 60px; border-radius: 0; }
  
  /* Make tables scrollable on mobile */
  table { display: block; overflow-x: auto; white-space: nowrap; }
}