/* =========================================================================
   Host Portal — Master CSS (2026 Premium Edition)
   ========================================================================= */

:root {
  color-scheme: light;
  --bg-gradient: linear-gradient(145deg, #f0f4ff 0%, #dce5ff 60%, #b8c7ff 100%);
  --panel: rgba(255, 255, 255, 0.85);
  --panel-border: rgba(0, 0, 0, 0.1);
  --input-bg: rgba(255, 255, 255, 0.5);
  --text: #0e1116;
  --accent: #1e258a; 
  --accent-soft: rgba(30, 37, 138, 0.1);
  --danger: #b91c1c;
  --success: #10b981;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  
  /* SOLID COLORS FOR DROPDOWNS (Light Mode) */
  --option-bg: #ffffff;
  --option-text: #0e1116;
}

[data-theme="dark"] {
  /* This tells the OS to use dark UI elements */
  color-scheme: dark !important; 
  --bg-gradient: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  --panel: rgba(30, 41, 59, 0.7);
  --panel-border: rgba(255, 255, 255, 0.1);
  --input-bg: rgba(0, 0, 0, 0.25);
  --text: #f1f5f9;
  --accent: #4f46e5; 
  
  /* SOLID COLORS FOR DROPDOWNS (Dark Mode) */
  /* We use a solid hex here because browsers often ignore transparency on options */
  --option-bg: #1e293b; 
  --option-text: #ffffff;
}

* { box-sizing: border-box; }
body { 
  margin: 0; font-family: 'Inter', system-ui, sans-serif; 
  background: var(--bg-gradient); background-attachment: fixed; 
  color: var(--text); min-height: 100vh; 
}
.wrap { max-width: 1400px; margin: 0 auto; padding: 20px 20px 80px; }

/* ==== MASTER HEADER ==== */
.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 30px;
  width: 100%;
}
.header-left { justify-self: start; }
.header-right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.header-title {
  margin: 0 !important; font-size: 1.8rem; font-weight: 900; text-transform: uppercase;
  text-align: center; background: linear-gradient(to bottom, #fff 20%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ==== BUTTONS ==== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; background: var(--accent); color: #fff !important;
  border-radius: 10px; padding: 10px 16px; border: none;
  cursor: pointer; text-decoration: none; font-weight: 700; transition: 0.15s;
  font-size: 13px; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn.small { padding: 6px 12px; font-size: 11px; border-radius: 8px; }
.btn.ghost { background: var(--panel); border: 1px solid var(--panel-border); color: var(--text) !important; }
.btn.danger { background: var(--danger) !important; }
.btn.success { background: var(--success) !important; }
.btn.warning { background: #f59e0b !important; color: #fff !important; }

/* ==== FORM CONTROLS & DROPDOWNS ==== */
.control-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  width: 100%;
}

.search-input {
  flex: 1;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }

/* Custom Dropdown Styling */
select.search-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='grey' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 1rem center !important;
  background-size: 1em !important;
  cursor: pointer;
}

/* THE FIX: Explicitly forcing the background and text color on every option */
select.search-input option {
  background-color: var(--option-bg) !important;
  color: var(--option-text) !important;
  /* Some browsers need a solid background set directly on the option tag */
}

/* Fix for Dark Mode specific options to ensure no system grey leaks in */
[data-theme="dark"] select.search-input option {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

/* ==== TABLE LAYOUT ==== */
.panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 24px; padding: 25px; }
.table-container { width: 100%; overflow-x: auto; }
.req-table { width: 100%; border-collapse: collapse; }
.req-table th { text-align: left; padding: 15px; font-size: 12px; text-transform: uppercase; opacity: 0.5; }
.req-table td { padding: 15px; border-top: 1px solid var(--panel-border); vertical-align: middle; }

/* Song Cell Styling */
.req-art { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; margin-right: 15px; }
.song-info { display: flex; align-items: center; }
.song-details .title { font-weight: 800; display: block; }
.song-details .artist { font-size: 0.85rem; opacity: 0.6; }

/* THE ACTION FIX: Force one line and prevent squashing */
.action-group { 
  display: flex; 
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px; 
}
.col-actions { min-width: 450px; }

/* ==== MOBILE UTILITIES ==== */
@media (max-width: 768px) {
  .row, .grid-add, [style*="display: grid"] { 
    grid-template-columns: 1fr !important; 
    gap: 15px !important;
  }
  .table-container { margin: 0 -15px; padding: 0 15px; border-radius: 0; }
  .btn { min-height: 44px; width: 100%; justify-content: center; }
  .action-group .btn, .row-actions .btn { width: auto; flex: 1; }
  .header { grid-template-columns: 1fr auto !important; row-gap: 10px; }
  .header-title { grid-column: 1 / -1; order: -1; font-size: 1.3rem; }
  .col-ip, .col-dt, .who { display: none !important; }
  .card { padding: 20px !important; }
}