/* -------------------------------------------------------------
 * id.avenix.cloud - Premium SaaS Control Center Stylesheet
 * Medical Dark Cloud & Cyber Neon Theme (Cyan/Teal/Purple)
 * ------------------------------------------------------------- */

:root {
  --bg-color: #030712;
  --surface-color: rgba(17, 24, 39, 0.7);
  --surface-border: rgba(255, 255, 255, 0.08);
  
  --primary: #06b6d4; /* Cyan */
  --primary-glow: rgba(6, 182, 212, 0.15);
  --primary-hover: #22d3ee;
  
  --purple: #a855f7; /* Purple */
  --purple-glow: rgba(168, 85, 247, 0.15);
  
  --success: #10b981; /* Emerald */
  --success-glow: rgba(16, 185, 129, 0.15);
  
  --warning: #f59e0b; /* Amber */
  --warning-glow: rgba(245, 158, 11, 0.15);
  
  --danger: #ef4444; /* Alert Rose */
  --danger-glow: rgba(239, 68, 68, 0.2);

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --font-content: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-header: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --premium-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------------------------------------------------------------
 * Global Defaults
 * ------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-content);
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-header);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Background grid glow */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
  background-image: 
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 40%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.06) 0px, transparent 40%);
}

/* -------------------------------------------------------------
 * Sidebar Navigation
 * ------------------------------------------------------------- */
.sidebar {
  width: 280px;
  background-color: #0b0f19;
  border-right: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  padding: 25px 15px;
  height: 100%;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  padding-left: 8px;
}

.brand-icon-svg {
  width: 42px;
  height: 42px;
  background-color: var(--primary-glow);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.logo-cloud-svg {
  filter: drop-shadow(0 0 3px var(--primary-hover));
}

.brand-text h2 {
  font-size: 18px;
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1;
}

.brand-text span {
  font-size: 9px;
  font-weight: 700;
  color: var(--primary-hover);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.menu-group-title {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-top: 15px;
  margin-bottom: 5px;
  padding-left: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition-smooth);
}

.menu-item i {
  font-size: 16px;
  width: 18px;
  text-align: center;
}

.menu-item:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.02);
}

.menu-item.active {
  color: var(--text-primary);
  background: var(--primary-glow);
  border: 1px solid rgba(6, 182, 212, 0.25);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

.sidebar-footer {
  border-top: 1px solid var(--surface-border);
  padding-top: 15px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 5px;
}

.user-profile .avatar {
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--primary);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 10px;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
 * Main Content Layout
 * ------------------------------------------------------------- */
.main-content {
  flex: 1;
  padding: 25px 30px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Alert Banner styling */
.system-overload-alert {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
  animation: alert-flash 1s ease-in-out infinite alternate;
}

@keyframes alert-flash {
  0% { border-color: rgba(239, 68, 68, 0.3); background-color: rgba(239, 68, 68, 0.1); }
  100% { border-color: var(--danger); background-color: rgba(239, 68, 68, 0.25); }
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.alert-content i {
  color: var(--danger);
  font-size: 18px;
}

/* Header style */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 15px;
}

.header-title h1 {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.header-title p {
  font-size: 13px;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.quick-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--surface-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.status-dot.green { background-color: var(--success); }
.status-dot.yellow { 
  background-color: var(--warning); 
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}
.status-dot.red { 
  background-color: var(--danger); 
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

/* -------------------------------------------------------------
 * Tab Sections
 * ------------------------------------------------------------- */
.tab-section {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-section.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------
 * Dashboard Core Stats Grid
 * ------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background-color: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--premium-shadow);
  backdrop-filter: blur(10px);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.stat-icon.purple { background-color: var(--purple-glow); color: var(--purple); }
.stat-icon.cyan { background-color: var(--primary-glow); color: var(--primary); }
.stat-icon.red { background-color: var(--danger-glow); color: var(--danger); }
.stat-icon.green { background-color: var(--success-glow); color: var(--success); }

.stat-value {
  font-family: var(--font-header);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.trend {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }

.stat-desc {
  color: var(--text-secondary);
}

/* -------------------------------------------------------------
 * Panels & Tables Layout
 * ------------------------------------------------------------- */
.content-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  flex: 1;
}

.grid-col.col-8 { grid-column: span 8; }
.grid-col.col-4 { grid-column: span 4; }

.panel {
  background-color: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--premium-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--surface-border);
}

.panel-header h3 {
  font-size: 15px;
  font-family: var(--font-header);
  color: var(--text-primary);
}

.panel-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.panel-tag {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.panel-tag.badge-green { background-color: var(--success-glow); color: var(--success); }
.panel-tag.badge-purple { background-color: var(--purple-glow); color: var(--purple); }

/* Premium Dark Tables */
.table-container {
  overflow-x: auto;
}

.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.premium-table th {
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--surface-border);
}

.premium-table td {
  padding: 14px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.premium-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.01);
  color: var(--text-primary);
}

/* Badge styles */
.badge-status {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.badge-status.active { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-status.trial { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.badge-status.overdue { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.badge-status.done { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }

/* -------------------------------------------------------------
 * Buttons & Forms
 * ------------------------------------------------------------- */
.btn {
  border: none;
  outline: none;
  font-family: var(--font-content);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--primary);
  color: #000;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background-color: #f87171;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-warning {
  background-color: var(--warning);
  color: #000;
}

.btn-warning:hover {
  background-color: #fbbf24;
}

.btn-teal-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-teal-outline:hover {
  background-color: var(--primary-glow);
  color: var(--text-primary);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

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

/* Forms styling */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.form-control {
  background-color: rgba(8, 12, 22, 0.8);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-content);
  font-size: 13px;
  padding: 8px 12px;
  width: 100%;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.2);
}

.form-row {
  display: flex;
  gap: 15px;
}

.col-6 {
  flex: 1;
}

.input-addon-group {
  display: flex;
}

.input-addon-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-addon {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  border-left: none;
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  font-family: monospace;
}

.search-box {
  position: relative;
  width: 260px;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.search-box input {
  padding-left: 32px;
}

/* -------------------------------------------------------------
 * Provisioning Console / Log Terminal
 * ------------------------------------------------------------- */
.provisioning-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  height: calc(100vh - 160px);
}

.console-body {
  background-color: #030712 !important;
  border: 1px solid #1f2937;
  font-family: 'Courier New', Courier, monospace;
  color: #10b981;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.console-idle-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.console-active-state {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.console-log-box {
  background-color: #000;
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-sm);
  padding: 15px;
  flex: 1;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #34d399;
}

.log-line {
  margin: 0;
  word-break: break-all;
}

.log-line.info { color: #38bdf8; }
.log-line.success { color: #4ade80; }
.log-line.warning { color: #fbbf24; }
.log-line.error { color: #f87171; }

/* -------------------------------------------------------------
 * Monitoring Metrics & Alerts
 * ------------------------------------------------------------- */
.monitoring-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  height: calc(100vh - 160px);
}

.metric-row {
  margin-bottom: 15px;
}

.metric-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.divider {
  background-color: var(--surface-border);
  height: 1px;
}

/* Telegram live alert console styling */
.alerts-console-body {
  background-color: #050811 !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.tg-alert-card {
  background: rgba(11, 15, 25, 0.9);
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 12px;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.tg-alert-card.critical {
  border-left: 4px solid var(--danger);
}

.tg-alert-card.warning {
  border-left: 4px solid var(--warning);
}

.tg-alert-card.info {
  border-left: 4px solid var(--primary);
}

.tg-alert-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 4px;
}

.tg-alert-body {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.tg-alert-body strong {
  color: var(--text-primary);
}

/* -------------------------------------------------------------
 * Modals & Overlay
 * ------------------------------------------------------------- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: #0b1120;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--premium-shadow);
  width: 90%;
  max-width: 600px;
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--surface-border);
}

.modal-header h3 {
  font-size: 16px;
  color: var(--text-primary);
}

.modal-close {
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
}

/* -------------------------------------------------------------
 * Timeline & Activities
 * ------------------------------------------------------------- */
.timeline-activity {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 20px;
}

.timeline-activity::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background-color: var(--surface-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 15px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -24px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 2px solid var(--bg-color);
  box-shadow: 0 0 5px var(--primary);
}

.timeline-marker.red { background-color: var(--danger); box-shadow: 0 0 5px var(--danger); }
.timeline-marker.yellow { background-color: var(--warning); box-shadow: 0 0 5px var(--warning); }
.timeline-marker.purple { background-color: var(--purple); box-shadow: 0 0 5px var(--purple); }

.timeline-details {
  display: flex;
  flex-direction: column;
}

.timeline-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Slider Customization */
.vas-input-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.vas-slider {
  flex: 1;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.05);
  height: 6px;
  border-radius: 3px;
  outline: none;
}

.vas-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--primary);
  transition: var(--transition-smooth);
}

.vas-slider::-webkit-slider-thumb:hover {
  background: var(--primary-hover);
  transform: scale(1.2);
}

.vas-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  min-width: 90px;
  text-align: center;
}

.pain-none { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.pain-mild { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.pain-moderate { background-color: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.pain-severe { background-color: rgba(239, 68, 68, 0.15); color: #fca5a5; }
