/* ========== AI DETECTION PAGE STYLES ========== */

.ai-detection-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 25px 30px;
  min-height: calc(100vh - 100px);
  background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 100%);
  width: 100%;
  margin: 0;
}

/* PAGE HEADER */
.ai-detection-header h2 {
  color: #e0e0e0;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
}

.ai-subtitle {
  color: #a0a0a0;
  font-size: 13px;
  margin: 0;
}

/* SECTION TITLE */
.ai-section-title {
  border-bottom: 2px solid rgba(0, 229, 255, 0.3);
  padding: 15px 0;
  margin: 15px 0;
}

.ai-section-title h3 {
  color: #00e5ff;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* MAIN GRID - 3 COLUMNS */
.ai-main-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.5fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

/* AI CARD */
.ai-card {
  background: rgba(15, 25, 45, 0.8);
  border: 1px solid #00e5ff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25), 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  overflow: hidden;
}

.ai-card:hover {
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.4), 0 8px 30px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.ai-card h3 {
  color: #00e5ff;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  padding-bottom: 8px;
}

/* PREDICTION PANEL */
.prediction-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 229, 255, 0.1);
  font-size: 12px;
}

.summary-item:last-of-type {
  border-bottom: none;
}

.summary-label {
  color: #a0a0a0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.summary-value {
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 600;
}

.summary-value.status-attack {
  color: #ff3b3b;
  text-shadow: 0 0 10px rgba(255, 59, 59, 0.5);
  font-size: 14px;
}

/* PROBABILITY BARS */
.probability-container {
  margin-top: 6px;
  width: 100%;
}

.probability-bar {
  height: 22px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  overflow: hidden;
  position: relative;
  font-size: 11px;
  transition: all 0.3s ease;
}

.probability-bar.attack {
  background: linear-gradient(90deg, rgba(255, 59, 59, 0.3), rgba(255, 59, 59, 0.6));
  border: 1px solid #ff3b3b;
  box-shadow: 0 0 10px rgba(255, 59, 59, 0.3);
}

.probability-bar.normal {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.3), rgba(0, 229, 255, 0.6));
  border: 1px solid #00e5ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.probability-value {
  color: #e0e0e0;
  font-weight: 700;
  font-size: 10px;
  white-space: nowrap;
}

/* ACTION BUTTONS */
.action-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-action {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid #00e5ff;
  border-radius: 4px;
  background: transparent;
  color: #00e5ff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.btn-action.acknowledge {
  border-color: #00e5ff;
  color: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.btn-action.acknowledge:hover {
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
  transform: translateY(-1px);
}

.btn-action.investigate {
  border-color: #ff3b3b;
  color: #ff3b3b;
  box-shadow: 0 0 8px rgba(255, 59, 59, 0.3);
}

.btn-action.investigate:hover {
  background: rgba(255, 59, 59, 0.1);
  box-shadow: 0 0 15px rgba(255, 59, 59, 0.5);
  transform: translateY(-1px);
}

/* ANOMALY PANEL - CHART */
.anomaly-panel {
  display: flex;
  flex-direction: column;
}

.anomaly-panel canvas {
  width: 100% !important;
  height: 280px !important;
  margin-bottom: 8px;
}

.chart-labels {
  display: flex;
  gap: 15px;
  justify-content: center;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 229, 255, 0.2);
}

.chart-label {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chart-label.suspicious {
  color: #ffcc00;
}

.chart-label.anomaly {
  color: #ff3b3b;
}

/* EXPLAINABLE PANEL */
.explainable-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 320px;
}

.explainable-panel::-webkit-scrollbar {
  width: 6px;
}

.explainable-panel::-webkit-scrollbar-track {
  background: rgba(0, 229, 255, 0.05);
  border-radius: 3px;
}

.explainable-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 3px;
}

.explainable-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.5);
}

.factor-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(0, 229, 255, 0.05);
  border-radius: 5px;
  border-left: 2px solid rgba(0, 229, 255, 0.3);
  transition: all 0.3s ease;
}

.factor-item:hover {
  background: rgba(0, 229, 255, 0.1);
}

.factor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.factor-name {
  color: #e0e0e0;
  font-size: 11px;
  font-weight: 600;
}

.factor-badge {
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.factor-badge.high {
  background: rgba(255, 59, 59, 0.2);
  color: #ff3b3b;
  border: 1px solid rgba(255, 59, 59, 0.4);
}

.factor-badge.moderate {
  background: rgba(255, 204, 0, 0.2);
  color: #ffcc00;
  border: 1px solid rgba(255, 204, 0, 0.4);
}

.factor-badge.low {
  background: rgba(0, 229, 255, 0.2);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.4);
}

.factor-bar-wrapper {
  width: 100%;
  height: 6px;
  background: rgba(0, 229, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.factor-bar {
  height: 100%;
  border-radius: 3px;
  box-shadow: 0 0 8px currentColor;
}

/* TABS SECTION */
.ai-tabs-section {
  background: rgba(15, 25, 45, 0.8);
  border: 1px solid #00e5ff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25), 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tabs-header {
  display: flex;
  border-bottom: 2px solid #00e5ff;
  background: rgba(0, 229, 255, 0.05);
}

.tab-button {
  flex: 1;
  padding: 12px 15px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #a0a0a0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.tab-button:hover {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.05);
}

.tab-button.active {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.1);
  border-bottom-color: #00e5ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.tab-content {
  padding: 15px;
  display: none;
  color: #e0e0e0;
  font-size: 12px;
  line-height: 1.6;
  min-height: 60px;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ================== RESPONSIVE DESIGN ================== */

/* Large screens */
@media (max-width: 1400px) {
  .ai-main-grid {
    grid-template-columns: 0.85fr 1.5fr 1fr;
  }

  .anomaly-panel canvas {
    height: 260px !important;
  }

  .explainable-panel {
    max-height: 300px;
  }
}

/* Tablets */
@media (max-width: 1024px) {
  .ai-detection-container {
    padding: 15px 20px;
  }

  .ai-main-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ai-card {
    padding: 15px;
  }

  .anomaly-panel canvas {
    height: 220px !important;
  }

  .explainable-panel {
    max-height: 250px;
    gap: 8px;
  }

  .factor-item {
    padding: 8px;
  }

  .tabs-header {
    flex-wrap: wrap;
  }

  .tab-button {
    flex: 1;
    min-width: 120px;
    padding: 10px 12px;
    font-size: 11px;
  }
}

/* Mobile - Landscape */
@media (max-width: 768px) {
  .ai-detection-container {
    padding: 12px 15px;
    gap: 10px;
  }

  .ai-detection-header h2 {
    font-size: 18px;
  }

  .ai-main-grid {
    gap: 10px;
  }

  .ai-card {
    padding: 12px;
  }

  .ai-card h3 {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .summary-item {
    padding: 6px 0;
  }

  .probability-bar {
    height: 20px;
  }

  .action-buttons {
    margin-top: 8px;
    gap: 6px;
  }

  .btn-action {
    padding: 8px 10px;
    font-size: 10px;
  }

  .anomaly-panel canvas {
    height: 180px !important;
  }

  .explainable-panel {
    max-height: 200px;
  }

  .factor-item {
    padding: 7px;
    gap: 5px;
  }

  .tab-button {
    padding: 8px 10px;
    font-size: 10px;
  }

  .tab-content {
    padding: 10px;
    font-size: 11px;
  }
}

/* Mobile - Portrait */
@media (max-width: 480px) {
  .ai-detection-container {
    padding: 10px 12px;
    gap: 8px;
  }

  .ai-detection-header h2 {
    font-size: 16px;
  }

  .ai-main-grid {
    gap: 8px;
  }

  .ai-card {
    padding: 10px;
  }

  .ai-card h3 {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .summary-item {
    padding: 5px 0;
    font-size: 10px;
  }

  .summary-label {
    font-size: 9px;
  }

  .summary-value {
    font-size: 11px;
  }

  .probability-bar {
    height: 18px;
    padding-right: 6px;
    font-size: 10px;
  }

  .action-buttons {
    margin-top: 6px;
  }

  .btn-action {
    padding: 6px 8px;
    font-size: 9px;
  }

  .anomaly-panel canvas {
    height: 140px !important;
  }

  .explainable-panel {
    max-height: 150px;
  }

  .factor-item {
    padding: 6px;
    gap: 4px;
  }

  .factor-name {
    font-size: 9px;
  }

  .factor-badge {
    padding: 2px 5px;
    font-size: 7px;
  }

  .tab-button {
    padding: 7px 8px;
    font-size: 9px;
    min-width: 70px;
  }

  .tab-content {
    padding: 8px;
    font-size: 10px;
  }
}