/* ============================================
   Analytics CSS - Visitor Tracking Dashboard
   ============================================ */

.analytics-module {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Analytics KPI row */
.analytics-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

/* Analytics Charts */
.analytics-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

/* Visitor Table */
.visitor-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.visitor-table-wrapper .data-table {
  min-width: 700px;
}

/* Live dot */
.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  margin-right: var(--space-2);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* Device icon */
.device-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
}

.device-icon svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
}

/* Country flag placeholder */
.country-flag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
}

.country-code {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
}

/* Map placeholder */
.analytics-map {
  width: 100%;
  min-height: 200px;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
}

.map-country-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.map-country-name {
  width: 120px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  flex-shrink: 0;
}

.map-country-bar-fill {
  flex: 1;
  height: 24px;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.map-country-bar-inner {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width var(--transition-slow);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: white;
  min-width: 32px;
}

/* Browser/OS stats */
.browser-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.browser-stat-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.browser-stat-name {
  width: 100px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  flex-shrink: 0;
}

.browser-stat-bar {
  flex: 1;
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.browser-stat-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.browser-stat-value {
  width: 40px;
  text-align: right;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1400px) {
  .analytics-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .analytics-kpi-row { grid-template-columns: 1fr; }
  .analytics-charts { grid-template-columns: 1fr; }
}
