/**
 * SPINHUB PRO - DESIGN SYSTEM V1.0
 * Dark Cyberpunk / Neo-Futuristic Glassmorphic Theme
 */

/* ==========================================
   1. DESIGN TOKENS & CSS VARIABLES
   ========================================== */
:root {
  color-scheme: dark;
  /* Color Palette - Brand Cyan */
  --theme-primary: #00e5ff;
  --theme-primary-light: #80f2ff;
  --theme-primary-dark: #008b99;

  /* Color Palette - Surface & Backgrounds */
  --dark-bg: #030a10;
  --panel-bg: rgba(3, 14, 26, 0.85);
  --panel-bg-solid: #030e1a;
  --input-bg: rgba(0, 0, 0, 0.5);

  /* Functional Status Colors */
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.15);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-info: #3b82f6;

  /* Typography */
  --font-family-base: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text-main: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #cbd5e1;
  --text-subtle: #64748b;

  /* Glassmorphism & Effects */
  --glass-border: 1px solid rgba(0, 229, 255, 0.15);
  --glass-border-hover: 1px solid rgba(0, 229, 255, 0.4);
  --glass-blur: blur(10px);
  --glow-primary: 0 0 15px rgba(0, 229, 255, 0.25);
  --glow-focus: 0 0 8px rgba(0, 229, 255, 0.4);
  --shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.3);

  /* Radius & Spacing */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

/* ==========================================
   2. BASE RESET & SCROLLBAR
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-base);
  background-color: var(--dark-bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* Custom Cyan Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.2);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--theme-primary);
}

/* ==========================================
   3. BACKGROUND ATMOSPHERE & EFFECTS
   ========================================== */
.bg-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.theme-aura {
  position: absolute;
  width: 150vw;
  height: 150vh;
  background: radial-gradient(circle at 50% 50%, rgba(0, 229, 255, 0.05) 0%, rgba(0,0,0,0) 60%);
  top: -25%;
  left: -25%;
  animation: auraMove 20s infinite alternate ease-in-out;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 90%);
}

@keyframes auraMove {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5%, 10%) scale(1.1); }
}

/* ==========================================
   4. GLASS CARDS & CONTAINERS
   ========================================== */
.glass-panel {
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-panel);
  padding: 20px;
  margin-bottom: 20px;
}

.panel-header {
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(0,229,255,0.1);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-size: 12px;
  font-weight: 900;
  color: var(--theme-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================
   5. BUTTONS & INTERACTIVES
   ========================================== */
/* Primary Gradient Button */
.btn-primary, .btn-login {
  background: linear-gradient(90deg, var(--theme-primary-dark), var(--theme-primary));
  color: #000000;
  font-weight: 900;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.3s, transform 0.2s, box-shadow 0.2s;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover, .btn-login:hover {
  opacity: 0.95;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.btn-primary:disabled, .btn-login:disabled {
  background: #333333;
  color: #666666;
  cursor: not-allowed;
  opacity: 1;
  border: 1px solid #444444;
  box-shadow: none;
}

/* Outline Button */
.btn-outline {
  background: rgba(0,0,0,0.5);
  color: var(--theme-primary-light);
  font-weight: bold;
  border: 1px solid var(--theme-primary-dark);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  transition: all 0.3s;
  font-size: 12px;
  text-transform: uppercase;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-outline:hover {
  background: rgba(0,229,255,0.1);
  border-color: var(--theme-primary);
  color: #ffffff;
  box-shadow: var(--glow-primary);
}

/* Action Compact Button */
.action-btn {
  background: rgba(0, 229, 255, 0.1);
  color: var(--theme-primary-light);
  border: 1px solid var(--theme-primary-dark);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-weight: bold;
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-btn:hover {
  background: var(--theme-primary);
  color: #000000;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

/* Toggle Group Buttons */
.toggle-group {
  display: flex;
  background: rgba(0,0,0,0.4);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.toggle-btn {
  flex: 1;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: bold;
  color: var(--text-subtle);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}

.toggle-btn:hover {
  color: var(--theme-primary-light);
  background: rgba(0, 229, 255, 0.1);
}

.toggle-btn.active {
  background: rgba(0, 229, 255, 0.2);
  color: var(--theme-primary-light);
  box-shadow: inset 0 0 8px rgba(0, 229, 255, 0.2);
}

/* ==========================================
   6. INPUTS, SELECTS & FORM ELEMENTS
   ========================================== */
.neo-input, .gestao-input {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(0,229,255,0.3);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-main);
  outline: none;
  font-weight: bold;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.neo-input:focus, .gestao-input:focus {
  border-color: var(--theme-primary);
  box-shadow: var(--glow-focus);
}

.neo-select, select.neo-select, select {
  width: 100%;
  background-color: #060e17;
  background: rgba(3, 14, 26, 0.95);
  color: var(--theme-primary-light);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: bold;
  outline: none;
  transition: all 0.2s;
  color-scheme: dark;
  cursor: pointer;
}

.neo-select:hover, .neo-select:focus, select:hover, select:focus {
  border-color: var(--theme-primary);
  box-shadow: var(--glow-focus);
  background-color: #0c1827;
}

.neo-select option, select option {
  background-color: #060e17 !important;
  color: #f1f5f9 !important;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
}

.neo-select option:checked, select option:checked {
  background-color: #003747 !important;
  color: var(--theme-primary) !important;
  font-weight: bold;
}

.neo-select option:hover, select option:hover {
  background-color: #0d2238 !important;
  color: #ffffff !important;
}

.neo-label, .gestao-label {
  font-size: 11px;
  color: var(--theme-primary-light);
  margin-bottom: 5px;
  font-weight: 900;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(0,229,255,0.3);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  width: 100%;
}

.search-input {
  background: transparent;
  border: none;
  color: var(--text-main);
  width: 100%;
  outline: none;
  font-size: 13px;
  font-weight: bold;
}

/* Checkbox Styling */
.chk-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.chk-group input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--theme-primary);
  cursor: pointer;
}

.chk-group label {
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.3;
  font-weight: bold;
}

/* ==========================================
   7. BADGES & STATUS INDICATORS
   ========================================== */
.badge-active {
  background: var(--color-success-bg);
  color: var(--color-success);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-size: 10px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  text-transform: uppercase;
}

.badge-expired {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-size: 10px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  text-transform: uppercase;
}

.badge-suspended {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-size: 10px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  text-transform: uppercase;
}

.count-badge {
  background: var(--color-warning);
  color: #000000;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 900;
  margin-left: 5px;
}

/* Strategy Badge */
.strategy-badge {
  background: rgba(0,0,0,0.6);
  color: var(--theme-primary-light);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: bold;
  border: 1px solid rgba(0,229,255,0.25);
  transition: all 0.2s;
}

/* Pulse Animation for Online Pill */
.pulse-green {
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* ==========================================
   8. DATA TABLES & LISTS
   ========================================== */
.admin-table, .catalog-table, .occ-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.admin-table th, .catalog-table th, .occ-table th {
  background: rgba(0,0,0,0.6);
  color: var(--theme-primary-dark);
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,229,255,0.2);
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.admin-table th:hover, .catalog-table th:hover {
  color: var(--theme-primary);
}

.admin-table td, .catalog-table td, .occ-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text-muted);
}

.admin-table tbody tr:hover td, .occ-table tbody tr:hover td {
  background: rgba(0, 229, 255, 0.08);
  color: var(--text-main);
}

/* ==========================================
   9. TABS & NAVIGATION
   ========================================== */
.tab-btn {
  padding: 10px 20px;
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  color: var(--text-subtle);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--theme-primary-light);
  border-bottom-color: var(--theme-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ==========================================
   10. MODALS, SPINNER & OVERLAYS
   ========================================== */
#loadingOverlay {
  position: fixed;
  inset: 0;
  background-color: var(--dark-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20000;
}

.spinner {
  border: 4px solid rgba(0, 229, 255, 0.1);
  border-left-color: var(--theme-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.custom-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 300000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.custom-modal-box {
  background-color: var(--panel-bg);
  border: 1px solid var(--theme-primary);
  border-radius: var(--radius-lg);
  padding: 25px;
  text-align: center;
  color: var(--text-main);
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0,229,255,0.2);
}

.custom-modal-box h3 {
  color: var(--theme-primary-light);
  font-weight: 900;
  margin-bottom: 10px;
  text-transform: uppercase;
  font-size: 16px;
}

/* ==========================================
   11. TOAST NOTIFICATIONS
   ========================================== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-notification {
  background: rgba(3, 14, 26, 0.95);
  color: var(--text-main);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  border-left: 4px solid var(--theme-primary);
  border-top: 1px solid rgba(0,229,255,0.2);
  border-right: 1px solid rgba(0,229,255,0.2);
  border-bottom: 1px solid rgba(0,229,255,0.2);
  min-width: 280px;
  animation: slideInRight 0.4s ease-out;
}

.toast-notification.hit {
  border-left-color: var(--color-success);
  border-color: var(--color-success);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.toast-notification.miss {
  border-left-color: var(--color-danger);
  border-color: var(--color-danger);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================
   12. MOBILE UX — TOUCH TARGETS & ACTIVE STATES
   Escopo exclusivo: max-width 768px (mobile/tablet).
   Desktop (> 768px) não é afetado por nenhuma regra abaixo.
   ========================================== */
@media (max-width: 768px) {

  /* Scale-on-press — feedback tátil em todos os botões primários */
  .btn-primary:active,
  .btn-login:active,
  .btn-outline:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
  }

  /* Action buttons — garantir hit area mínima de 44px */
  .action-btn {
    min-height: 44px;
    padding: 8px 14px;
  }

  .action-btn:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
  }

  /* Toggle buttons — área de toque expandida com padding vertical */
  .toggle-btn {
    min-height: 44px;
    padding: 8px 12px;
  }

  .toggle-btn:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
  }

  /* Tab buttons — hit area mínima */
  .tab-btn {
    min-height: 44px;
    padding: 10px 16px;
  }

  .tab-btn:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
  }

  /* Checkbox hit area — expandir área clicável pelo label */
  .chk-group label {
    padding: 6px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .chk-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    flex-shrink: 0;
  }
}
