@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-color: #f4f6fa;
  --panel-bg: #ffffff;
  --panel-border: #e2e8f0;
  --text-color: #0f172a;
  --text-muted: #64748b;
  --primary: #0f2b5c;
  --primary-hover: #0a1c3d;
  --primary-glow: rgba(15, 43, 92, 0.12);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.1);
  --info: #0ea5e9;
  --font-family: 'Outfit', sans-serif;
  --border-radius: 12px;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Premium Card Panel styles */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(15, 43, 92, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 43, 92, 0.3);
}

/* Login styling */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f2b5c 0%, #1e40af 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.login-card h3 {
  color: #0f2b5c !important;
}

.btn-primary-custom {
  background-color: var(--primary);
  border: none;
  color: #fff;
  font-weight: 500;
  border-radius: 8px;
  padding: 10px 20px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary-custom:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1px);
}

.form-control-custom {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  border-radius: 8px;
  padding: 12px;
}

.form-control-custom:focus {
  background: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
  color: #0f172a !important;
}

.form-control-custom::placeholder {
  color: #94a3b8 !important;
}

/* Sidebar structure */
.sidebar {
  width: 260px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 1.5rem;
  z-index: 100;
  background-color: #0f2b5c !important;
  border-right: 1px solid #0a1c3d;
  color: #ffffff;
}

.sidebar .nav-link-custom {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #cbd5e1;
  border-radius: 8px;
  margin-bottom: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar .nav-link-custom:hover, .sidebar .nav-link-custom.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 500;
}

.sidebar .nav-link-custom i {
  margin-right: 12px;
  font-size: 1.1rem;
}

.sidebar .text-white {
  color: #ffffff !important;
}

.sidebar .text-muted {
  color: #94a3b8 !important;
}

.main-content {
  margin-left: 260px;
  padding: 2rem;
  min-height: 100vh;
  background: #f4f6fa;
}

/* Card status badges */
.status-badge {
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.status-badge.connected {
  background-color: var(--success-glow);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.connecting {
  background-color: var(--warning-glow);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-badge.qr-ready {
  background-color: rgba(14, 165, 233, 0.1);
  color: var(--info);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.status-badge.disconnected {
  background-color: var(--danger-glow);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Live Terminal Log Viewer */
.log-terminal {
  background-color: #090d16;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 1.2rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  height: 350px;
  overflow-y: auto;
  color: #38bdf8;
}

.log-line {
  margin-bottom: 6px;
  line-height: 1.4;
  word-break: break-all;
}

.log-time {
  color: #64748b;
  margin-right: 8px;
}

.log-level-SUCCESS { color: #4ade80; }
.log-level-INFO { color: #38bdf8; }
.log-level-WARN { color: #fbbf24; }
.log-level-ERROR { color: #f87171; }

/* QR Code Modal Display */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #fff;
  border-radius: var(--border-radius);
  width: 250px;
  height: 250px;
  margin: 0 auto;
}

/* Analytics Metric count display */
.metric-value {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(to right, #0f2b5c, #1e40af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Override Modals for Light Mode */
.modal-content {
  color: #0f172a !important;
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.modal-content .text-white {
  color: #0f172a !important;
}

.modal-content .text-muted {
  color: #64748b !important;
}

.modal-content .form-label {
  color: #334155 !important;
}

.modal-content .modal-header {
  border-bottom-color: #f1f5f9 !important;
}

.modal-header .btn-close-white {
  filter: invert(1) !important; /* Converts close button from white to dark! */
}

/* Retheme Bootstrap table-dark to premium light style */
.table-dark {
  --bs-table-bg: #ffffff !important;
  --bs-table-color: #0f172a !important;
  --bs-table-hover-bg: #f8fafc !important;
  --bs-table-hover-color: #0f172a !important;
  border-color: #e2e8f0 !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
}

.table-dark th {
  color: #64748b !important;
  font-weight: 600;
}

/* Responsive Mobile Rules */
@media (max-width: 991.98px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }
  
  .main-content {
    margin-left: 0;
    padding: 1.5rem;
  }
}

/* Accessibility & Color Visibility Overrides for Light Mode main-content */
.main-content h4, 
.main-content h5, 
.main-content h6, 
.main-content .text-white,
.main-content .text-light,
.main-content h4.text-white,
.main-content h5.text-white,
.main-content h6.text-white {
  color: #0f2b5c !important;
}

.main-content .text-white-50 {
  color: #334155 !important;
}

.main-content .text-muted {
  color: #475569 !important;
}

.sidebar .nav-link-custom.active {
  background: #ffffff !important;
  color: #0f2b5c !important;
  font-weight: 600;
}
