/* Modern Minimalism - Warm Pastels & Navy Mode */
/* Primary Background: Deep Navy Blue (#0f1419 to #2a3441) */
/* Accent: Soft Coral (#f8b4b4) */
/* Secondary Accent: Soft Rose (#e8a8a8) */
/* Text: Light Navy (#e2e8f0, #cbd5e0) */
/* Borders: Navy Blue (#2d3748, #4a5568) */

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #2a3441 100%);
  min-height: 100vh;
  color: #e2e8f0;
  line-height: 1.4;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: linear-gradient(145deg, #1a2332 0%, #2a3441 100%);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(15, 20, 25, 0.5);
  overflow: hidden;
  border: 1px solid #2d3748;
}

/* Header Section */
.dashboard-header {
  background: linear-gradient(135deg, #1a2332 0%, #2a3441 100%);
  padding: 24px 32px;
  border-bottom: 1px solid #2d3748;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.header-content h1 {
  margin: 0;
  font-size: 2.2em;
  font-weight: 300;
  color: #f8b4b4;
  text-shadow: 0 0 20px rgba(248, 180, 180, 0.3);
  letter-spacing: 1px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.timestamp {
  font-size: 0.9em;
  color: #cbd5e1;
  font-weight: 400;
}

.control-panel {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.primary-btn {
  background: linear-gradient(135deg, #f8b4b4 0%, #e8a5a5 100%);
  color: #1a202c;
  box-shadow: 0 4px 15px rgba(248, 180, 180, 0.3);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #f0c9c9 0%, #f8b4b4 100%);
  box-shadow: 0 6px 20px rgba(248, 180, 180, 0.4);
  transform: translateY(-2px);
}

.secondary-btn {
  background: rgba(45, 55, 72, 0.8);
  color: #e2e8f0;
  border: 1px solid #2d3748;
}

.secondary-btn:hover {
  background: rgba(26, 32, 44, 0.9);
  border-color: #1a202c;
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Status Indicators */
.status {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid;
  transition: all 0.3s ease;
}

.status.updating {
  animation: statusPulse 0.8s ease-in-out;
}

.connected {
  background: linear-gradient(135deg, #f8b4b4 0%, #e8a5a5 100%);
  color: #1a202c;
  border-color: #f8b4b4;
  box-shadow: 0 0 15px rgba(248, 180, 180, 0.3);
}

.disconnected {
  background: linear-gradient(135deg, #e8a8a8 0%, #d89b9b 100%);
  color: #1a202c;
  border-color: #e8a8a8;
  box-shadow: 0 0 15px rgba(232, 168, 168, 0.3);
}

/* Main Monitoring Area */
.monitoring-area {
  padding: 32px;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.primary-metrics {
  grid-template-columns: 2fr 1fr;
}

.secondary-metrics {
  grid-template-columns: 1fr 1fr;
}

/* Metric Cards */
.metric-card {
  background: linear-gradient(145deg, #1a2332 0%, #2a3441 100%);
  border-radius: 12px;
  border: 1px solid #2d3748;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 20, 25, 0.3);
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(15, 20, 25, 0.4);
  border-color: #2d3748;
}

.metric-card.updating {
  animation: cardUpdate 0.6s ease-in-out;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #2d3748;
}

.card-header h3 {
  margin: 0;
  font-size: 1.3em;
  font-weight: 500;
  color: #cbd5e0;
}

.metric-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-badge.live {
  background: linear-gradient(135deg, #f8b4b4 0%, #e8a5a5 100%);
  color: #1a202c;
}

.metric-badge.operational {
  background: linear-gradient(135deg, #e8a8a8 0%, #d89b9b 100%);
  color: #1a202c;
}

.metric-badge.monitoring {
  background: linear-gradient(135deg, #f0c9c9 0%, #e8a5a5 100%);
  color: #1a202c;
}

.metric-badge.forecast {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  color: #e2e8f0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  padding: 20px 24px;
}

.metric-item {
  text-align: center;
  padding: 12px;
  background: rgba(45, 55, 72, 0.5);
  border-radius: 8px;
  border: 1px solid #4a5568;
}

.metric-label {
  display: block;
  font-size: 0.85em;
  color: #cbd5e0;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  display: block;
  font-size: 1.8em;
  font-weight: 600;
  color: #f8b4b4;
  margin-bottom: 2px;
}

.metric-unit {
  font-size: 0.8em;
  color: #a0aec0;
  font-weight: 400;
}

/* Turbine Status */
.turbine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 20px 24px;
}

.turbine-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(45, 55, 72, 0.5);
  border-radius: 8px;
  border: 1px solid #4a5568;
  transition: all 0.3s ease;
}

.turbine-item:hover {
  background: rgba(55, 65, 85, 0.7);
  border-color: #5a6578;
}

.turbine-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.turbine-label {
  font-size: 0.9em;
  color: #cbd5e0;
  font-weight: 500;
}

.wind-speed {
  font-size: 1.1em;
  color: #90a4c0;
  font-weight: 600;
}

.turbine-status-badge {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid;
  transition: all 0.3s ease;
}

.status-operational {
  background: linear-gradient(135deg, #f8b4b4 0%, #e8a5a5 100%);
  color: #1a202c;
  border-color: #f8b4b4;
}

.status-maintenance {
  background: linear-gradient(135deg, #e8a8a8 0%, #d89b9b 100%);
  color: #1a202c;
  border-color: #e8a8a8;
}

.status-off {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  color: #e2e8f0;
  border-color: #2d3748;
}

/* Chart Section */
.chart-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 4px;
}

.section-header h3 {
  margin: 0;
  font-size: 1.4em;
  font-weight: 500;
  color: #cbd5e0;
}

.chart-info {
  font-size: 0.9em;
  color: #a0aec0;
  font-style: italic;
}

.chart-container {
  background: linear-gradient(145deg, #1a2332 0%, #2a3441 100%);
  border-radius: 12px;
  border: 1px solid #2d3748;
  padding: 0;
  box-shadow: 0 4px 20px rgba(15, 20, 25, 0.3);
  position: relative;
  height: 400px;
}

canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: rgba(15, 20, 25, 0.8);
  border-radius: 12px;
  border: 1px solid #2d3748;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cardUpdate {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(15, 20, 25, 0.3);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(248, 180, 180, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(15, 20, 25, 0.3);
  }
}

@keyframes statusPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Last Updated Animations */
#last-updated {
  transition: all 0.5s ease;
  font-weight: 500;
  opacity: 1;
  animation: fadeIn 0.3s ease-in-out;
}

#last-updated.updating {
  animation: pulse 0.6s ease-in-out;
}

#last-updated.stale {
  animation: stalePulse 2s infinite;
}

@keyframes stalePulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .dashboard-header {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .header-content h1 {
    font-size: 1.8em;
  }

  .metrics-row {
    grid-template-columns: 1fr;
  }

  .primary-metrics {
    grid-template-columns: 1fr;
  }

  .secondary-metrics {
    grid-template-columns: 1fr;
  }

  .monitoring-area {
    padding: 20px;
  }
}

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

  .dashboard-header {
    padding: 20px;
  }

  .header-content h1 {
    font-size: 1.5em;
  }

  .control-panel {
    justify-content: center;
  }

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

  .turbine-grid {
    grid-template-columns: 1fr;
  }

  .chart-container {
    height: 350px;
  }

  .section-header {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .monitoring-area {
    padding: 16px;
  }

  .card-header {
    padding: 16px 20px 12px;
  }

  .card-header h3 {
    font-size: 1.1em;
  }

  .metric-item {
    padding: 10px;
  }

  .metric-value {
    font-size: 1.5em;
  }

  .turbine-item {
    padding: 12px;
  }

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