/* AlEyes.mx - Cyber-Indigo Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-dark: #070712;
  --bg-card: rgba(18, 17, 42, 0.75);
  --bg-card-hover: rgba(28, 26, 62, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.3);
  
  --primary: #00f2fe;
  --primary-purple: #7000ff;
  --success: #00e676;
  --warning: #ffab00;
  --danger: #ff1744;
  --text-main: #f0f4f8;
  --text-muted: #8a92b2;
  
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(112, 0, 255, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.12) 0%, transparent 40%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.glass-panel:hover {
  border-color: rgba(0, 242, 254, 0.2);
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(7, 7, 18, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-purple), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.brand-text span {
  color: var(--primary);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.domain-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(0, 230, 118, 0.15);
  color: var(--success);
  border: 1px solid rgba(0, 230, 118, 0.3);
  font-weight: 500;
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: calc(100vh - 71px);
}

/* Sidebar Navigation */
.sidebar {
  width: 240px;
  background: rgba(7, 7, 18, 0.5);
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.15), rgba(112, 0, 255, 0.05));
  border-left: 3px solid var(--primary);
  color: var(--primary);
}

.nav-item i {
  font-size: 1.2rem;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 32px;
  max-width: 1400px;
}

/* Tab Navigation */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* 5-Segment Network Topology Component */
.topology-container {
  padding: 28px;
  margin-bottom: 32px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topology-path {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 20px 0;
}

.topo-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  cursor: pointer;
  position: relative;
}

.topo-node::after {
  content: '🔍 Clic para Traceroute';
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  white-space: nowrap;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.topo-node:hover::after {
  opacity: 1;
}

.topo-node:hover .node-icon-wrapper {
  transform: scale(1.15);
  box-shadow: 0 0 20px var(--primary);
}

.node-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(18, 17, 42, 0.9);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.status-ok .node-icon-wrapper {
  border-color: var(--success);
  color: var(--success);
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.25);
}

.status-warn .node-icon-wrapper {
  border-color: var(--warning);
  color: var(--warning);
  box-shadow: 0 0 15px rgba(255, 171, 0, 0.25);
}

.status-fail .node-icon-wrapper {
  border-color: var(--danger);
  color: var(--danger);
  box-shadow: 0 0 20px rgba(255, 23, 68, 0.4);
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(255, 23, 68, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(255, 23, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 23, 68, 0); }
}

.node-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.node-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Connecting lines */
.connector-line {
  flex: 1;
  height: 3px;
  background: var(--border-color);
  margin: 0 -10px;
  position: relative;
  top: -20px;
  z-index: 1;
}

.connector-line.active {
  background: linear-gradient(90deg, var(--success), var(--primary));
}

.connector-line.broken {
  background: var(--danger);
}

/* Cloud Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.service-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
}

.service-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.service-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.service-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.service-host {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.service-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.badge-ok {
  background: rgba(0, 230, 118, 0.15);
  color: var(--success);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.status-badge.badge-error {
  background: rgba(255, 23, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 23, 68, 0.3);
}

.service-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Table for Admin Vault & Users */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.custom-table th, .custom-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.custom-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.password-masked {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 2px;
  color: var(--primary);
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #00b0ff);
  color: #070712;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(0, 242, 254, 0.5);
}

.btn-danger {
  background: rgba(255, 23, 68, 0.2);
  color: #ff80ab;
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: rgba(255, 23, 68, 0.3);
}

/* Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 18, 0.95);
  backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  max-width: 440px;
  width: 100%;
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  max-width: 500px;
  width: 90%;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-control {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

/* Resizable Side Drawer / Panel (Google Workspace style) */
.side-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  height: 100vh;
  width: 480px;
  max-width: 90vw;
  min-width: 320px;
  background: rgba(10, 11, 26, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(0, 242, 254, 0.2);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  z-index: 500;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-drawer.open {
  right: 0;
}

/* Left Splitter Resizer Handle */
.side-drawer-resizer {
  position: absolute;
  left: -4px;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  background: transparent;
  z-index: 510;
  transition: background 0.2s ease;
}

.side-drawer-resizer:hover,
.side-drawer-resizer.dragging {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

/* Side Drawer Header */
.side-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.side-drawer-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.side-drawer-close:hover {
  background: rgba(255, 23, 68, 0.3);
  color: #ff80ab;
}

/* Side Drawer Body */
.side-drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Terminal Traceroute Emulator */
.terminal-box {
  background: #04050d;
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 12px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #00f2fe;
  line-height: 1.6;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.terminal-box .term-line {
  display: block;
  margin-bottom: 4px;
}

.terminal-box .term-success { color: #00e676; }
.terminal-box .term-warning { color: #ffab00; }
.terminal-box .term-danger { color: #ff1744; }
.terminal-box .term-muted { color: #8a92b2; }
