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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
  color: #e2e8f0;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* Header */
.header {
  margin-bottom: 30px;
  background: rgba(26, 32, 44, 0.95);
  backdrop-filter: blur(10px);
  padding: 20px 30px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
  max-width: 100%;
}

.logo:hover {
  transform: scale(1.05);
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4a5568;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.status-dot.connected {
  background: #48bb78;
  box-shadow: 0 0 10px rgba(72, 187, 120, 0.5);
}

.status-dot.error {
  background: #f56565;
  box-shadow: 0 0 10px rgba(245, 101, 101, 0.5);
}

#status-text {
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.card {
  background: rgba(26, 32, 44, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 0;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  word-wrap: break-word;
}

.card.full-width {
  grid-column: 1 / -1;
}

/* Overview Card */
.overview-card {
  grid-column: 1 / -1;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.stat-label {
  font-size: 0.875rem;
  color: #a0aec0;
  font-weight: 500;
  word-wrap: break-word;
}

.stat-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: #e2e8f0;
  word-wrap: break-word;
}

/* Chart Containers */
.chart-container {
  position: relative;
  height: 200px;
  margin-bottom: 16px;
  width: 100%;
  overflow: hidden;
}

/* Details Sections */
.memory-details,
.cpu-details,
.disk-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Database Status */
.database-status {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.db-item {
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  word-wrap: break-word;
}

.db-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.db-name {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 1rem;
  word-wrap: break-word;
}

.db-status {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.db-status.connected {
  background: rgba(72, 187, 120, 0.2);
  color: #48bb78;
  border: 1px solid rgba(72, 187, 120, 0.3);
}

.db-status.error {
  background: rgba(245, 101, 101, 0.2);
  color: #f56565;
  border: 1px solid rgba(245, 101, 101, 0.3);
}

.db-status.connecting,
.db-status.disconnecting {
  background: rgba(237, 137, 54, 0.2);
  color: #ed8936;
  border: 1px solid rgba(237, 137, 54, 0.3);
}

.db-status.disconnected {
  background: rgba(160, 174, 192, 0.2);
  color: #a0aec0;
  border: 1px solid rgba(160, 174, 192, 0.3);
}

.db-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.db-message {
  font-size: 0.875rem;
  color: #e2e8f0;
  word-wrap: break-word;
}

.db-details-text {
  font-size: 0.75rem;
  color: #a0aec0;
  word-wrap: break-word;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 10px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row span:first-child {
  font-weight: 500;
  color: #a0aec0;
  word-wrap: break-word;
}

.detail-row span:last-child {
  font-weight: 600;
  color: #e2e8f0;
  text-align: right;
  word-wrap: break-word;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.metric-circle {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #667eea 0deg,
    #667eea var(--percentage, 0deg),
    rgba(255, 255, 255, 0.1) var(--percentage, 0deg)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.metric-circle::before {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(26, 32, 44, 0.95);
  backdrop-filter: blur(10px);
}

.metric-value {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
}

.metric-label {
  font-size: 0.875rem;
  color: #a0aec0;
  font-weight: 500;
  text-align: center;
  word-wrap: break-word;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-height: 44px;
  touch-action: manipulation;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.last-updated {
  font-size: 0.875rem;
  color: #a0aec0;
  text-align: center;
  word-wrap: break-word;
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
  }
  
  .overview-stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
  }

  .overview-stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
  }
  
  .container {
    padding: 15px;
  }
  
  .header {
    padding: 15px 20px;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .header {
    padding: 15px;
    margin-bottom: 15px;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .logo {
    height: 35px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .overview-stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
  }

  .card {
    padding: 18px;
  }

  .card h3 {
    font-size: 1.125rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
  }

  .metric-circle {
    width: 70px;
    height: 70px;
  }

  .metric-circle::before {
    width: 50px;
    height: 50px;
  }

  .metric-value {
    font-size: 0.875rem;
  }

  .metric-label {
    font-size: 0.75rem;
  }

  .controls {
    flex-direction: column;
    gap: 12px;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 1rem;
  }

  .chart-container {
    height: 180px;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .detail-row span:last-child {
    text-align: left;
  }

  .database-status {
    gap: 12px;
  }

  .db-item {
    padding: 12px;
  }

  .db-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .db-name {
    font-size: 0.875rem;
  }

  .db-status {
    font-size: 0.625rem;
  }

  .db-message {
    font-size: 0.75rem;
  }

  .db-details-text {
    font-size: 0.625rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 8px;
  }

  .header {
    padding: 12px;
    margin-bottom: 12px;
  }

  .header-content {
    gap: 12px;
  }

  .logo {
    height: 30px;
  }

  .header h1 {
    font-size: 1.25rem;
  }

  .card {
    padding: 15px;
    border-radius: 12px;
  }

  .card h3 {
    font-size: 1rem;
    margin-bottom: 15px;
  }

  .overview-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .stat-value {
    font-size: 1rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
  }

  .metric-circle {
    width: 60px;
    height: 60px;
  }

  .metric-circle::before {
    width: 42px;
    height: 42px;
  }

  .metric-value {
    font-size: 0.75rem;
  }

  .metric-label {
    font-size: 0.625rem;
  }

  .chart-container {
    height: 160px;
  }

  .controls {
    gap: 10px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 0.875rem;
    min-height: 40px;
  }

  .last-updated {
    font-size: 0.75rem;
  }

  .detail-row {
    padding: 6px 0;
  }

  .detail-row span:first-child {
    font-size: 0.75rem;
  }

  .detail-row span:last-child {
    font-size: 0.75rem;
  }
}

@media (max-width: 360px) {
  .container {
    padding: 6px;
  }

  .header {
    padding: 10px;
  }

  .header-content {
    gap: 10px;
  }

  .card {
    padding: 12px;
    border-radius: 10px;
  }

  .metric-circle {
    width: 50px;
    height: 50px;
  }

  .metric-circle::before {
    width: 35px;
    height: 35px;
  }

  .metric-value {
    font-size: 0.625rem;
  }

  .chart-container {
    height: 140px;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 48px;
    padding: 14px 20px;
  }
  
  .card {
    cursor: default;
  }
  
  .card:hover {
    transform: none;
  }
  
  .metric-circle {
    cursor: default;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid #ffffff;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .card:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .card {
    background: rgba(15, 23, 42, 0.95);
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .header-content {
    flex-direction: row;
    align-items: center;
  }
  
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .controls {
    flex-direction: row;
  }
  
  .btn {
    width: auto;
  }
}

/* Loading Animation */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Status Colors */
.status-healthy {
  color: #48bb78;
}

.status-warning {
  color: #ed8936;
}

.status-critical {
  color: #f56565;
}

/* Error Logs Styles */
.error-logs-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.error-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  word-wrap: break-word;
}

.error-stat-label {
  font-size: 0.75rem;
  color: #a0aec0;
  font-weight: 500;
  text-align: center;
  margin-bottom: 4px;
  word-wrap: break-word;
}

.error-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e2e8f0;
  text-align: center;
  word-wrap: break-word;
}

/* Collections Overview Styles */
.collections-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.collection-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(102, 126, 234, 0.2);
  transition: all 0.3s ease;
}

.collection-stat:hover {
  background: rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.collection-stat-label {
  font-size: 0.8rem;
  color: #a0aec0;
  margin-bottom: 6px;
  font-weight: 500;
}

.collection-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #667eea;
}

/* Analytics Styles */
.analytics-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.analytics-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px;
  background: rgba(72, 187, 120, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(72, 187, 120, 0.2);
  transition: all 0.3s ease;
}

.analytics-stat:hover {
  background: rgba(72, 187, 120, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(72, 187, 120, 0.2);
}

.analytics-stat-label {
  font-size: 0.8rem;
  color: #a0aec0;
  margin-bottom: 6px;
  font-weight: 500;
}

.analytics-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #48bb78;
}

.analytics-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.error-logs-table-container {
  max-height: 400px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  overflow-x: auto;
}

.error-logs-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.error-logs-table th {
  background: rgb(38, 38, 38);
  color: #e2e8f0;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
  min-width: 80px;
}
.error-logs-tbody td{
  font-size: 13px;
}
.error-logs-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  vertical-align: top;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  font-size: 13px;
}

.error-logs-table tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.error-logs-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.error-logs-table tr:nth-child(even):hover {
  background: rgba(255, 255, 255, 0.08);
}

.error-code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: rgba(245, 101, 101, 0.2);
  color: #f56565;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.error-level {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 400;
  text-transform: uppercase;
}

.error-level.level-1 {
  background: rgba(245, 101, 101, 0.2);
  color: #f56565;
  border: 1px solid rgba(245, 101, 101, 0.3);
}

.error-level.level-2 {
  background: rgba(237, 137, 54, 0.2);
  color: #ed8936;
  border: 1px solid rgba(237, 137, 54, 0.3);
}

.error-level.level-3 {
  background: rgba(72, 187, 120, 0.2);
  color: #48bb78;
  border: 1px solid rgba(72, 187, 120, 0.3);
}

.error-message {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error-message:hover {
  white-space: normal;
  word-break: break-word;
}

.error-logs-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  gap: 16px;
}

.filter-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  min-width: 120px;
}

.filter-select:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

.no-data {
  text-align: center;
  color: #a0aec0;
  font-style: italic;
  padding: 40px 16px;
}

/* Responsive adjustments for error logs */
@media (max-width: 768px) {
  .error-logs-overview {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }
  
  .collections-overview {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
  }
  
  .analytics-overview {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
  }
  
  .error-logs-table th,
  .error-logs-table td {
    padding: 8px 12px;
    font-size: 0.75rem;
  }
  
  .error-message {
    max-width: 200px;
  }
  
  .error-logs-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .filter-select {
    min-width: auto;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .error-logs-overview {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .collections-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .analytics-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .error-logs-table-container {
    max-height: 300px;
  }
  
  .error-logs-table th,
  .error-logs-table td {
    padding: 6px 8px;
    font-size: 0.7rem;
  }
  
  .error-message {
    max-width: 150px;
  }
  
  .error-logs-controls {
    gap: 10px;
  }
}

/* Drawer Styles */
.drawer {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}

.drawer-content {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  max-width: 600px;
  height: 100%;
  background: rgba(26, 32, 44, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
}

.drawer.open .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  position: sticky;
  top: 0;
  background: #1e2330;
  z-index: 10;
}

.drawer-header h3 {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.5rem;
  font-weight: 600;
}

.drawer-close {
  background: none;
  border: none;
  color: #a0aec0;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.drawer-body {
  padding: 24px;
}

.error-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-section.full-width {
  grid-column: 1 / -1;
}

.detail-section h4 {
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item.full-width {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 0.875rem;
  color: #a0aec0;
  font-weight: 500;
}

.detail-value {
  font-size: 1rem;
  color: #e2e8f0;
  font-weight: 500;
  word-break: break-word;
}

.message-text {
  font-size: 1.1rem;
  line-height: 1.5;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-json {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.4;
}

.details-btn {
  background: rgba(66, 153, 225, 0.2);
  color: #4299e1;
  border: 1px solid rgba(66, 153, 225, 0.3);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.details-btn:hover {
  background: rgba(66, 153, 225, 0.3);
  border-color: rgba(66, 153, 225, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.2);
}

/* Responsive drawer */
@media (max-width: 768px) {
  .drawer-content {
    max-width: 100%;
  }
  
  .drawer-header {
    padding: 16px 16px 12px 16px;
  }
  
  .drawer-body {
    padding: 16px;
  }
  
  .error-details-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .detail-section h4 {
    font-size: 1rem;
  }
  
  .info-json {
    font-size: 0.8rem;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .drawer-content {
    max-width: 100%;
  }
  
  .drawer-header h3 {
    font-size: 1.25rem;
  }
  
  .detail-value {
    font-size: 0.9rem;
  }
  
  .message-text {
    font-size: 1rem;
    padding: 8px;
  }
}

/* AI Analysis Styles */
.ai-analysis-card {
  grid-column: 1 / -1;
}

.ai-analysis-content {
  text-align: center;
}

.ai-description {
  color: #a0aec0;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.btn-magic {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-magic:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-magic::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-magic:hover::before {
  left: 100%;
}

.btn-magic.analyzing {
  opacity: 0.8;
  transform: scale(0.98);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.btn-magic.analyzing:hover {
  transform: scale(0.98);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.btn-magic.analyzing::before {
  animation: none;
}

.btn-magic:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: scale(0.98);
}

.btn-magic:disabled:hover {
  transform: scale(0.98);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ai-result {
  margin-top: 24px;
  text-align: left;
}

.ai-loading {
  text-align: center;
  padding: 20px;
}

.loading-steps {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.step {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  color: #a0aec0;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.step.active {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.3);
  color: #667eea;
  opacity: 1;
  animation: pulse 2s infinite;
}

.step.completed {
  background: rgba(72, 187, 120, 0.2);
  border-color: rgba(72, 187, 120, 0.3);
  color: #48bb78;
  opacity: 1;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-content {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.ai-processing-time {
  font-size: 0.8rem;
  color: #a0aec0;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-priority {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-priority.low {
  background: rgba(72, 187, 120, 0.2);
  color: #48bb78;
  border: 1px solid rgba(72, 187, 120, 0.3);
}

.ai-priority.medium {
  background: rgba(237, 137, 54, 0.2);
  color: #ed8936;
  border: 1px solid rgba(237, 137, 54, 0.3);
}

.ai-priority.high {
  background: rgba(245, 101, 101, 0.2);
  color: #f56565;
  border: 1px solid rgba(245, 101, 101, 0.3);
}

.ai-priority.critical {
  background: rgba(220, 38, 127, 0.2);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 127, 0.3);
  animation: pulse 2s infinite;
}

.ai-analysis-text {
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  line-height: 1.6;
  border-left: 4px solid #667eea;
}

.ai-recommendations h4 {
  color: #e2e8f0;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.ai-recommendations ul {
  list-style: none;
  padding: 0;
}

.ai-recommendations li {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 8px;
  border-left: 4px solid #48bb78;
  position: relative;
  padding-left: 24px;
}

.ai-recommendations li::before {
  content: '💡';
  position: absolute;
  left: 8px;
  top: 12px;
}

.ai-timestamp {
  text-align: right;
  font-size: 0.8rem;
  color: #a0aec0;
  margin-top: 16px;
  font-style: italic;
}

/* Enhanced AI Analysis Components */
.ai-metrics {
  margin: 20px 0;
}

.ai-metrics h4 {
  color: #e2e8f0;
  margin-bottom: 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.8rem;
  color: #a0aec0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value.excellent { color: #48bb78; }
.metric-value.good { color: #ed8936; }
.metric-value.poor { color: #f56565; }

/* Issues Section */
.ai-issues {
  margin: 20px 0;
}

.ai-issues h4 {
  color: #e2e8f0;
  margin-bottom: 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

.issues-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.issue-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid;
  transition: transform 0.2s ease;
}

.issue-card:hover {
  transform: translateX(4px);
}

.issue-card.severity-low { border-left-color: #48bb78; }
.issue-card.severity-medium { border-left-color: #ed8936; }
.issue-card.severity-high { border-left-color: #f56565; }
.issue-card.severity-critical { border-left-color: #dc2626; }

.issue-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.issue-title {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 1rem;
}

.issue-category {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.issue-category.performance { background: rgba(102, 126, 234, 0.2); color: #667eea; }
.issue-category.security { background: rgba(245, 101, 101, 0.2); color: #f56565; }
.issue-category.stability { background: rgba(72, 187, 120, 0.2); color: #48bb78; }
.issue-category.resource { background: rgba(237, 137, 54, 0.2); color: #ed8936; }
.issue-category.database { background: rgba(159, 122, 234, 0.2); color: #9f7aea; }
.issue-category.error { background: rgba(220, 38, 127, 0.2); color: #dc2626; }

.issue-description {
  color: #a0aec0;
  font-size: 0.9rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.issue-impact {
  font-size: 0.85rem;
  color: #e2e8f0;
  margin-bottom: 8px;
  font-style: italic;
}

.issue-action {
  font-size: 0.85rem;
  color: #48bb78;
  font-weight: 500;
}

/* Next Steps Section */
.ai-next-steps {
  margin: 20px 0;
}

.ai-next-steps h4 {
  color: #e2e8f0;
  margin-bottom: 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

.next-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.next-step-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  border-left: 4px solid #48bb78;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.next-step-info {
  flex: 1;
}

.next-step-action {
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.next-step-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: #a0aec0;
}

.next-step-priority {
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  font-size: 0.7rem;
}

.next-step-priority.low { background: rgba(72, 187, 120, 0.2); color: #48bb78; }
.next-step-priority.medium { background: rgba(237, 137, 54, 0.2); color: #ed8936; }
.next-step-priority.high { background: rgba(245, 101, 101, 0.2); color: #f56565; }
.next-step-priority.critical { background: rgba(220, 38, 127, 0.2); color: #dc2626; }

/* Responsive AI Analysis */
@media (max-width: 768px) {
  .ai-analysis-content {
    text-align: left;
  }
  
  .ai-description {
    font-size: 0.9rem;
    text-align: left !important;
  }
  
  .btn-magic {
    width: 100%;
    margin-bottom: 16px;
  }
  
  .ai-content {
    padding: 16px;
  }
  
  .ai-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .issue-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .next-step-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .ai-recommendations li {
    padding: 10px 12px;
    padding-left: 20px;
  }
  
  .loading-steps {
    max-width: 250px;
  }
  
  .step {
    font-size: 0.8rem;
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {
  .ai-priority {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
  
  .ai-analysis-text {
    padding: 12px;
    font-size: 0.9rem;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .metric-card {
    padding: 8px;
  }
  
  .metric-value {
    font-size: 1.2rem;
  }
  
  .issue-card {
    padding: 12px;
  }
  
  .issue-title {
    font-size: 0.9rem;
  }
  
  .issue-description {
    font-size: 0.8rem;
  }
  
  .ai-recommendations h4 {
    font-size: 1rem;
  }
  
  .ai-recommendations li {
    font-size: 0.9rem;
    padding: 8px 10px;
    padding-left: 18px;
  }
  
  .ai-recommendations li::before {
    font-size: 0.8rem;
    left: 6px;
    top: 10px;
  }
  
  .loading-steps {
    max-width: 200px;
  }
  
  .step {
    font-size: 0.75rem;
    padding: 4px 8px;
  }
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  gap: 24px;
  margin-bottom: 30px;
}

/* AI Sidebar */
.ai-sidebar {
  flex: 0 0 400px;
  position: sticky;
  top: 20px;
  height: fit-content;
}

/* AI Sidebar Hover Effect */
.ai-sidebar::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  z-index: 999;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

.ai-sidebar:hover::before {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  opacity: 1;
}

.ai-sidebar .ai-analysis-card {
  position: relative;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-sidebar:hover .ai-analysis-card {
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
  transform: scale(1.01);
}


/* Main Content */
.main-content {
  flex: 1;
  min-width: 0;
}

/* Mobile AI Drawer Toggle */
.mobile-only {
  display: none;
}

/* AI Drawer */
.ai-drawer {
  z-index: 1001;
}

/* AI Drawer Hover Effect */
.ai-drawer::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  z-index: 1000;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

.ai-drawer:hover::before {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  opacity: 1;
}

.ai-drawer .drawer-content {
  position: relative;
  z-index: 1002;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-drawer:hover .drawer-content {
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  transform: scale(1.02);
}

/* Blur all content when hovering over AI drawer */
.ai-drawer:hover ~ *,
.ai-drawer:hover ~ * * {
  filter: blur(6px);
  transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure AI drawer content stays sharp */
.ai-drawer:hover .drawer-content,
.ai-drawer:hover .drawer-content * {
  filter: blur(0px) !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .ai-sidebar {
    flex: 0 0 350px;
  }
}

@media (max-width: 1024px) {
  .dashboard-layout {
    flex-direction: column;
    gap: 20px;
  }
  
  .ai-sidebar {
    flex: none;
    position: static;
    order: -1;
  }
  
  .ai-sidebar .card {
    margin-bottom: 0;
  }
}

@media (max-width: 768px) {
  .dashboard-layout {
    gap: 16px;
  }
  
  .ai-sidebar {
    display: block;
    flex: none;
    position: static;
    order: -1;
  }
  
  .ai-sidebar .ai-analysis-card {
    margin-bottom: 16px;
  }
  
  .mobile-only {
    display: none;
  }
  
  .ai-drawer {
    display: none !important;
  }
  
  /* Disable hover effects on mobile for better performance */
  .ai-drawer:hover::before,
  .ai-sidebar:hover::before {
    display: none;
  }
  
  .ai-drawer:hover .drawer-content,
  .ai-sidebar:hover .ai-analysis-card {
    transform: none;
  }
  
  /* Disable blur effects on mobile */
  .ai-sidebar:hover ~ .main-content,
  .ai-sidebar:hover ~ .main-content .card,
  .ai-sidebar:hover ~ .main-content .controls,
  .ai-drawer:hover ~ *,
  .ai-drawer:hover ~ * * {
    filter: none !important;
  }
}
