/* strompris-specific.css - Strømpris-spesifikk styling */

/* Mobile-optimized base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 25%, #10b981 50%, #84cc16 75%, #eab308 100%);
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 10px;
}

.calculator-card {
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  border: 2px solid rgba(14, 165, 233, 0.3);
}

h1 {
  font-size: 1.2em;
  text-align: center;
  margin-bottom: 8px;
}

@media (min-width: 480px) {
  h1 {
    font-size: 1.5em;
    margin-bottom: 10px;
  }
}

h2 {
  font-size: 1.1em;
  color: #0c4a6e;
  text-align: center;
  margin-bottom: 15px;
}

@media (min-width: 480px) {
  h2 {
    font-size: 1.3em;
    margin-bottom: 20px;
  }
}

/* Input groups */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  color: #475569;
  font-weight: 500;
  font-size: 14px;
}

.input-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  background: white;
  transition: all 0.3s ease;
}

.input-group select:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.area-help {
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}

/* Toggle switch for grid fees */
.toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: #f8fafc;
  border-radius: 10px;
  margin-bottom: 20px;
}

.toggle-label {
  color: #475569;
  font-size: 14px;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.4s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #0ea5e9;
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Date selector */
.date-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

@media (min-width: 480px) {
  .date-selector {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.date-btn {
  padding: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(14, 165, 233, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 600;
  color: #0c4a6e;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.date-btn:hover {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.date-btn.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  color: white;
  border-color: #0ea5e9;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.3);
}

.date-icon {
  font-size: 18px;
}

/* Current price display */
.current-price-display {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid rgba(14, 165, 233, 0.2);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.price-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.status-label {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.status-indicator {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-indicator.low {
  background: rgba(34, 197, 94, 0.2);
  color: #15803d;
}

.status-indicator.normal {
  background: rgba(59, 130, 246, 0.2);
  color: #1e40af;
}

.status-indicator.high {
  background: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.price-value {
  font-size: 36px;
  font-weight: 700;
  color: #0c4a6e;
  margin-bottom: 8px;
}

@media (min-width: 480px) {
  .price-value {
    font-size: 48px;
  }
}

.price-unit {
  font-size: 16px;
  color: #64748b;
  font-weight: 400;
}

.price-comparison {
  font-size: 14px;
  color: #64748b;
  margin-top: 8px;
}

.price-comparison .positive {
  color: #15803d;
  font-weight: 600;
}

.price-comparison .negative {
  color: #b91c1c;
  font-weight: 600;
}

.price-average {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* Chart container */
.chart-container {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid rgba(14, 165, 233, 0.2);
  height: 300px;
}

@media (min-width: 480px) {
  .chart-container {
    height: 400px;
    padding: 25px;
  }
}

/* Price table */
.price-table {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.price-table h3 {
  color: #0c4a6e;
  margin-bottom: 15px;
  font-size: 16px;
}

#priceTableContent {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 600px) {
  #priceTableContent {
    grid-template-columns: repeat(2, 1fr);
  }
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #e2e8f0;
  transition: all 0.2s ease;
  font-size: 14px;
}

.price-row:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.price-row.low {
  background: rgba(34, 197, 94, 0.05);
  border-left-color: #22c55e;
}

.price-row.normal {
  background: rgba(59, 130, 246, 0.05);
  border-left-color: #3b82f6;
}

.price-row.high {
  background: rgba(239, 68, 68, 0.05);
  border-left-color: #ef4444;
}

.price-hour {
  color: #475569;
  font-weight: 500;
}

.price-amount {
  font-weight: 700;
  color: #0f172a;
}

/* Best hours */
.best-hours {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid rgba(34, 197, 94, 0.2);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
}

.best-hours h3 {
  color: #15803d;
  margin-bottom: 15px;
  font-size: 16px;
}

.best-hours-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.best-hour-card {
  background: white;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  border: 1px solid rgba(34, 197, 94, 0.2);
  position: relative;
}

.best-hour-rank {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #22c55e;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.best-hour-time {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 8px;
  margin-bottom: 4px;
}

.best-hour-price {
  font-size: 12px;
  color: #15803d;
  font-weight: 600;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(14, 165, 233, 0.2);
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading p {
  color: #64748b;
  font-size: 14px;
}

/* Error state */
.error {
  background: rgba(254, 226, 226, 0.5);
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  padding: 15px;
  margin: 15px 0;
  text-align: center;
}

.error p {
  color: #b91c1c;
  font-size: 14px;
  margin: 0;
}

/* Statistics grid */
.statistics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 15px;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

@media (min-width: 600px) {
  .statistics-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  text-align: center;
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
}

.stat-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #0c4a6e;
}

.stat-unit {
  font-size: 12px;
  color: #64748b;
}

/* Date range display */
.date-range-display {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 15px;
  text-align: center;
  font-size: 13px;
  color: #0c4a6e;
}

/* Custom date modal */
.custom-date-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.custom-date-modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 15px;
  padding: 25px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  color: #0c4a6e;
  margin: 0;
  font-size: 18px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #64748b;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-inputs {
  display: grid;
  gap: 15px;
  margin-bottom: 20px;
}

.date-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.date-input-group label {
  font-size: 14px;
  color: #475569;
  font-weight: 500;
}

.date-input-group input {
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.date-input-group input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.modal-btn.cancel {
  background: #f3f4f6;
  color: #6b7280;
}

.modal-btn.confirm {
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  color: white;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Area map */
.area-map {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 15px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.area-map h3 {
  color: #0c4a6e;
  margin-bottom: 15px;
  font-size: 16px;
}

.map-legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 480px) {
  .map-legend {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .map-legend {
    grid-template-columns: repeat(3, 1fr);
  }
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}

.legend-color {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.legend-color.no1 { background: #3b82f6; }
.legend-color.no2 { background: #ef4444; }
.legend-color.no3 { background: #10b981; }
.legend-color.no4 { background: #f59e0b; }
.legend-color.no5 { background: #8b5cf6; }

/* Info note */
.info-note {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 10px;
  padding: 15px;
  margin-top: 20px;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

.info-note strong {
  color: #0c4a6e;
}

/* Pulse animation for button */
.calculate-btn {
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 20px;
}

.calculate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(14, 165, 233, 0.4);
}

.calculate-btn.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(14, 165, 233, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
  }
}