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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.5;
}

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

/* Header styles */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.dashboard-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #333;
}

.refresh-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

#last-refreshed {
  font-size: 14px;
  color: #666;
}

.refresh-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #f8f9fa;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-button:hover {
  background-color: #f1f5f9;
  border-color: #c1c7d0;
}

.refresh-button:active {
  background-color: #e5e7eb;
}

.refresh-button.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.refresh-icon {
  width: 16px;
  height: 16px;
}

.refresh-button.loading .refresh-icon {
  animation: spin 1s linear infinite;
}

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

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

.loading-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: #666;
}

/* Card styles */
.jvb-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.jvb-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Status colors */
.jvb-card.green {
  background-color: rgba(76, 175, 80, 0.05);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.jvb-card.yellow {
  background-color: rgba(255, 193, 7, 0.05);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.jvb-card.red {
  background-color: rgba(244, 67, 54, 0.05);
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.jvb-card.unknown {
  background-color: rgba(158, 158, 158, 0.05);
  border: 1px solid rgba(158, 158, 158, 0.3);
}

.card-header {
  padding: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.jvb-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.green .jvb-title {
  color: #2E7D32;
}

.yellow .jvb-title {
  color: #F57F17;
}

.red .jvb-title {
  color: #C62828;
}

.unknown .jvb-title {
  color: #616161;
}

.external-link-icon {
  color: #9e9e9e;
}

.card-content {
  padding: 15px;
  flex-grow: 1;
}

.metrics-section {
  margin-bottom: 15px;
}

.metrics-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  margin-bottom: 8px;
}

.metrics-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.metric-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 14px;
}

.metric-name {
  font-weight: 500;
}

.metric-value {
  font-weight: 600;
}

.compare-value {
  font-weight: 400;
  opacity: 0.7;
}

/* Metric status colors */
.metric-display.green {
  background-color: rgba(76, 175, 80, 0.15);
  color: #2E7D32;
}

.metric-display.yellow {
  background-color: rgba(255, 193, 7, 0.15);
  color: #F57F17;
}

.metric-display.red {
  background-color: rgba(244, 67, 54, 0.15);
  color: #C62828;
}

.metric-display.unknown {
  background-color: rgba(158, 158, 158, 0.15);
  color: #616161;
}

.no-data {
  padding: 30px 15px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.card-footer {
  padding: 10px 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 12px;
  color: #777;
}

.last-updated.stale {
  color: #F57F17;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .refresh-info {
    width: 100%;
    justify-content: space-between;
  }
  
  .jvb-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 480px) {
  .jvb-grid {
    grid-template-columns: 1fr;
  }
}