/**
 * LIMOR AI COMPREHENSIVE DEBUG PANEL STYLES
 * SPRINT-53 Phase 2.1 - Professional Debug Interface
 * Version: 3.0.0 - September 5, 2025
 */

/* ===========================================
   DEBUG PANEL CONTAINER
   =========================================== */

.debug-panel-container {
  font-family: 'Courier New', Consolas, Monaco, 'Lucida Console', monospace;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 2px solid #444;
  border-radius: 8px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  user-select: none;
}

.debug-panel-container * {
  box-sizing: border-box;
}

/* ===========================================
   PANEL HEADER
   =========================================== */

.debug-panel-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #333;
  cursor: move;
}

.debug-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.debug-panel-title h3 {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.debug-panel-icon {
  font-size: 16px;
}

.debug-panel-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.debug-panel-status.status-active {
  background: rgba(46, 204, 113, 0.2);
  border: 1px solid #2ecc71;
  color: #2ecc71;
}

.debug-panel-status.status-warning {
  background: rgba(241, 196, 15, 0.2);
  border: 1px solid #f1c40f;
  color: #f1c40f;
}

.debug-panel-status.status-error {
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid #e74c3c;
  color: #e74c3c;
}

.debug-panel-controls {
  display: flex;
  gap: 4px;
}

/* ===========================================
   PANEL CONTENT
   =========================================== */

.debug-panel-content {
  padding: 16px;
  background: #1a1a1a;
  color: #e0e0e0;
  max-height: calc(80vh - 60px);
  overflow-y: auto;
}

/* ===========================================
   STATISTICS BAR
   =========================================== */

.debug-stats-bar {
  display: flex;
  gap: 20px;
  padding: 12px;
  background: #2d2d2d;
  border: 1px solid #444;
  border-radius: 6px;
  margin-bottom: 16px;
}

.debug-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-label {
  font-size: 10px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
}

.debug-stat.error-stat .stat-value {
  color: #e74c3c;
}

.debug-stat.warning-stat .stat-value {
  color: #f39c12;
}

.debug-stat.api-stat .stat-value {
  color: #3498db;
}

/* ===========================================
   FILTER CONTROLS
   =========================================== */

.debug-filter-controls {
  background: #2d2d2d;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.filter-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.filter-group label {
  font-size: 11px;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-input,
.filter-select {
  background: #1a1a1a;
  border: 1px solid #555;
  color: #e0e0e0;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.filter-date {
  width: 140px;
}

.date-separator {
  color: #aaa;
  font-size: 11px;
  align-self: flex-end;
  padding: 6px 4px;
}

.checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* ===========================================
   ACTION BUTTONS
   =========================================== */

.debug-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.debug-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.debug-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.debug-btn:active {
  transform: translateY(0);
}

.debug-btn-primary {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.debug-btn-secondary {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.debug-btn-warning {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.debug-btn-danger {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.debug-btn-sm {
  padding: 4px 8px;
  font-size: 10px;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.debug-btn-xs {
  padding: 3px 6px;
  font-size: 9px;
}

/* ===========================================
   LOG CONTAINER
   =========================================== */

.debug-log-container {
  background: #0f0f0f;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
}

.debug-log-header {
  background: #2d2d2d;
  padding: 8px 12px;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-info {
  font-size: 11px;
  color: #aaa;
}

.log-controls {
  display: flex;
  gap: 4px;
}

.debug-log-display {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

/* Custom scrollbar for log display */
.debug-log-display::-webkit-scrollbar {
  width: 8px;
}

.debug-log-display::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.debug-log-display::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.debug-log-display::-webkit-scrollbar-thumb:hover {
  background: #667eea;
}

/* ===========================================
   LOG ENTRIES
   =========================================== */

.log-entry {
  border: 1px solid #333;
  border-radius: 4px;
  margin-bottom: 4px;
  background: #1a1a1a;
  transition: all 0.2s ease;
  cursor: pointer;
}

.log-entry:hover {
  border-color: #667eea;
  background: #222;
}

.log-entry.expanded {
  border-color: #667eea;
  background: #222;
}

.log-header {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.log-timestamp {
  color: #888;
  font-size: 10px;
  font-family: monospace;
  min-width: 80px;
}

.log-type {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 60px;
  text-align: center;
}

.log-type-error,
.log-type-critical {
  background: #e74c3c;
  color: white;
}

.log-type-warning {
  background: #f39c12;
  color: white;
}

.log-type-info,
.log-type-success {
  background: #3498db;
  color: white;
}

.log-type-debug {
  background: #9b59b6;
  color: white;
}

.log-message {
  flex: 1;
  color: #e0e0e0;
  font-size: 12px;
}

.log-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.log-entry:hover .log-actions {
  opacity: 1;
}

.log-action-btn {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.log-action-btn:hover {
  background: #667eea;
  border-color: #667eea;
  color: white;
}

.log-context {
  border-top: 1px solid #333;
  background: #0f0f0f;
}

.log-context-content {
  padding: 12px;
  font-size: 11px;
  line-height: 1.4;
  color: #ccc;
}

.context-item {
  margin-bottom: 6px;
  padding: 4px 8px;
  background: #1a1a1a;
  border-radius: 3px;
  border-left: 3px solid #667eea;
}

.context-item strong {
  color: #fff;
}

/* ===========================================
   LOG DETAIL PANEL
   =========================================== */

.debug-log-detail {
  position: absolute;
  top: 50px;
  right: 20px;
  width: 400px;
  max-height: 500px;
  background: #1a1a1a;
  border: 2px solid #667eea;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 10001;
}

.log-detail-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
}

.log-detail-header h4 {
  margin: 0;
  font-size: 13px;
}

.log-detail-content {
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
  color: #e0e0e0;
}

.log-detail-section {
  margin-bottom: 16px;
}

.log-detail-section h5 {
  margin: 0 0 8px 0;
  color: #667eea;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.log-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.log-detail-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #333;
  vertical-align: top;
}

.log-detail-table td:first-child {
  color: #aaa;
  font-weight: bold;
  width: 30%;
}

.log-detail-json {
  background: #0f0f0f;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 12px;
  font-size: 10px;
  color: #e0e0e0;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

.log-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #333;
}

/* ===========================================
   SEVERITY INDICATORS
   =========================================== */

.log-entry-critical {
  border-left: 4px solid #e74c3c;
  animation: pulse-critical 2s infinite;
}

.log-entry-error {
  border-left: 4px solid #e74c3c;
}

.log-entry-warning {
  border-left: 4px solid #f39c12;
}

.log-entry-info {
  border-left: 4px solid #3498db;
}

.log-entry-success {
  border-left: 4px solid #2ecc71;
}

.log-entry-debug {
  border-left: 4px solid #9b59b6;
}

@keyframes pulse-critical {
  0%, 100% { 
    border-left-color: #e74c3c;
    box-shadow: none;
  }
  50% { 
    border-left-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3);
  }
}

/* ===========================================
   TOAST NOTIFICATIONS
   =========================================== */

.debug-toast {
  animation: toast-slide-in 0.3s ease-out;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

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

@media (max-width: 1024px) {
  .debug-panel-container {
    width: 90vw !important;
    right: 5vw !important;
  }
  
  .filter-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .debug-actions {
    justify-content: center;
  }
  
  .debug-log-detail {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .debug-panel-container {
    width: 95vw !important;
    right: 2.5vw !important;
    height: 70vh !important;
  }
  
  .debug-stats-bar {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .log-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .log-timestamp {
    min-width: auto;
  }
}

/* ===========================================
   DARK MODE ENHANCEMENTS
   =========================================== */

.debug-panel-container {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --error-color: #e74c3c;
  --info-color: #3498db;
  --debug-color: #9b59b6;
  
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #0f0f0f;
  
  --text-primary: #e0e0e0;
  --text-secondary: #aaa;
  --text-muted: #888;
  
  --border-color: #333;
  --border-hover: #667eea;
}

/* ===========================================
   ACCESSIBILITY IMPROVEMENTS
   =========================================== */

.debug-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.filter-input:focus,
.filter-select:focus {
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.log-entry:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 1px;
}

/* ===========================================
   PERFORMANCE OPTIMIZATIONS
   =========================================== */

.debug-log-display {
  contain: layout style;
  will-change: scroll-position;
}

.log-entry {
  contain: layout style;
}

.log-context-content {
  contain: layout;
}