/* IMPORT GOOGLE FONT */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  color: #333;
}

/* GLASSMORPHISM BACKGROUND EFFECT */
.glass-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
}

.blob-1 {
  top: -100px;
  left: -100px;
  width: 500px;
  height: 500px;
  background: linear-gradient(180deg, #ff6b6b 0%, #ff8e53 100%);
  animation: float 20s ease-in-out infinite;
}

.blob-2 {
  bottom: -100px;
  right: -100px;
  width: 600px;
  height: 600px;
  background: linear-gradient(180deg, #4facfe 0%, #00f2fe 100%);
  animation: float 25s ease-in-out infinite reverse;
}

.blob-3 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: linear-gradient(180deg, #a18cd1 0%, #fbc2eb 100%);
  animation: float 30s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-30px, 30px) scale(0.9); }
}

/* HEADER */
header {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding: 25px 20px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  margin-bottom: 30px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.header-icon {
  font-size: 40px;
  color: #4CAF50;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.badge-pro {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
  display: inline-block;
}

.header-subtitle {
  color: #666;
  font-size: 14px;
  font-weight: 400;
  margin: 0;
}

/* GLASS CARD EFFECT */
.glass-card {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  transition: all 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(31, 38, 135, 0.2);
  background: rgba(255, 255, 255, 0.95);
}

.glass-card-light {
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* STATUS BAR */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto 30px;
  padding: 18px 25px;
  max-width: 1200px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  flex-wrap: wrap;
  gap: 15px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-icon {
  color: #764ba2;
  font-size: 16px;
}

.status-label {
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

.status-value {
  font-weight: 700;
  font-size: 14px;
}

.status-value.ok { color: #10b981; }
.status-value.bad { color: #ef4444; }
.status-value.checking { color: #f59e0b; }

/* CONTAINER */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* CARD STYLES */
.card {
  padding: 30px;
  margin-bottom: 30px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  font-size: 28px;
  color: #4CAF50;
  background: rgba(76, 175, 80, 0.1);
  padding: 10px;
  border-radius: 16px;
}

.card-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.card-badge .live-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.live-badge i {
  font-size: 8px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* SOIL CARD */
.soil-value-container {
  text-align: center;
  margin-bottom: 25px;
}

.soil-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  margin-bottom: 15px;
}

.soil-number {
  font-size: 72px;
  font-weight: 700;
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.soil-unit {
  font-size: 28px;
  color: #666;
  font-weight: 500;
}

.soil-range {
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: 400px;
  margin: 15px auto;
}

.soil-range span {
  font-size: 12px;
  color: #666;
  font-weight: 600;
}

.soil-progress {
  flex: 1;
  height: 10px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.soil-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #2E7D32);
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* PUMP THRESHOLD INDICATOR */
.pump-threshold-indicator {
  margin-top: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.threshold-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.threshold-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 30px;
}

.threshold-label i {
  font-size: 12px;
}

.threshold-value {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  margin-left: 5px;
}

.pump-on-label {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.pump-on-label i {
  color: #ef4444;
}

.pump-off-label {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.pump-off-label i {
  color: #10b981;
}

.threshold-bar {
  display: flex;
  height: 40px;
  border-radius: 30px;
  overflow: hidden;
  margin: 15px 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.threshold-range {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 100%;
  transition: width 0.5s ease;
}

.threshold-range .range-label {
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  z-index: 1;
  white-space: nowrap;
  padding: 0 5px;
}

.pump-on-range {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.optimal-range {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.pump-off-range {
  background: linear-gradient(135deg, #10b981, #059669);
}

.threshold-description {
  text-align: center;
  font-size: 13px;
  color: #4b5563;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 15px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px dashed #d1d5db;
}

.threshold-description i {
  color: #3b82f6;
}

.threshold-description strong {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}

/* CHART CONTAINER */
.chart-container {
  margin: 20px 0;
  padding: 20px;
  background: white;
  border-radius: 20px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.03);
}

canvas {
  width: 100% !important;
  height: 250px !important;
  display: block;
}

/* DATA BATTERY & SOLAR - DESKTOP VERSION */
.data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 20px 0;
}

.data-item {
  padding: 15px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s;
}

.data-item:hover {
  transform: translateY(-3px);
  background: white;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.data-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.data-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.data-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.data-value {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-value span {
  font-size: 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* BATTERY PROGRESS */
.battery-level {
  margin-top: 20px;
  padding: 15px;
  background: rgba(0,0,0,0.02);
  border-radius: 16px;
}

.battery-level-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: #666;
}

.battery-percent {
  font-weight: 700;
  color: #10b981;
}

.battery-progress {
  height: 8px;
  background: rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
}

.battery-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 8px;
  transition: width 0.3s ease;
}

/* SOLAR INFO */
.solar-info {
  margin-top: 20px;
  padding: 15px;
  background: rgba(251, 191, 36, 0.1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b45309;
  font-size: 13px;
  flex-wrap: wrap;
}

.solar-info strong {
  color: #f59e0b;
  font-size: 14px;
  margin-left: 5px;
}

/* CONTROL CARD */
.control-card .card-icon {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin: 20px 0;
}

.status-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.status-box {
  padding: 20px;
  border-radius: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.status-box i {
  font-size: 28px;
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

.status-box-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.status-box-value {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.control-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mode-btn {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  padding: 16px;
  border: none;
  border-radius: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: none;
  outline: none;
}

.mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.pump-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pump-btn {
  padding: 14px;
  border: none;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  outline: none;
}

.on-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.on-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.off-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.off-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

/* SYSTEM STATUS */
.system-status {
  margin-top: 25px;
  padding: 20px;
  background: rgba(0,0,0,0.02);
  border-radius: 18px;
  display: flex;
  gap: 25px;
  justify-content: center;
  flex-wrap: wrap;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot.green {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

.dot.yellow {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 25px;
  margin-top: 50px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: #555;
  font-size: 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.footer-content i {
  color: #4CAF50;
  font-size: 18px;
}

.footer-version {
  font-size: 12px;
  color: #888;
}

/* ============================================ */
/* RESPONSIVE ANDROID - DATA BATERAI DI ATAS, PANEL SURYA DI BAWAH */
/* ============================================ */
@media (max-width: 768px) {
  /* Container */
  .container {
    padding: 0 12px !important;
  }
  
  /* Card padding lebih kecil */
  .card {
    padding: 16px !important;
    margin-bottom: 16px !important;
  }
  
  /* Header card lebih compact */
  .card-header {
    margin-bottom: 12px !important;
    gap: 8px !important;
  }
  
  .card-title h2 {
    font-size: 16px !important;
  }
  
  .card-icon {
    font-size: 20px !important;
    padding: 6px !important;
  }
  
  /* Data grid - PASTIKAN VERTICAL STACK (1 kolom) */
  .data-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin: 12px 0 !important;
  }
  
  /* Data item - horizontal layout agar tidak ketutup */
  .data-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 15px !important;
    gap: 12px !important;
  }
  
  .data-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
  }
  
  .data-content {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    flex: 1 !important;
    gap: 10px !important;
  }
  
  .data-label {
    font-size: 12px !important;
    flex-shrink: 0 !important;
  }
  
  .data-value {
    font-size: 16px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  
  .data-value span {
    font-size: 18px !important;
  }
  
  /* Battery level */
  .battery-level {
    padding: 10px !important;
    margin-top: 10px !important;
  }
  
  .battery-level-text {
    font-size: 12px !important;
  }
  
  /* Solar info */
  .solar-info {
    padding: 10px !important;
    margin-top: 10px !important;
    font-size: 12px !important;
  }
  
  /* Soil card */
  .soil-number {
    font-size: 54px !important;
  }
  
  .soil-unit {
    font-size: 22px !important;
  }
  
  /* Chart */
  .chart-container {
    padding: 12px !important;
  }
  
  canvas {
    height: 180px !important;
  }
  
  /* Threshold */
  .pump-threshold-indicator {
    padding: 10px !important;
  }
  
  .threshold-labels {
    gap: 8px !important;
  }
  
  .threshold-label {
    font-size: 11px !important;
    padding: 4px 10px !important;
  }
  
  .threshold-bar {
    height: 32px !important;
  }
  
  .threshold-range .range-label {
    font-size: 9px !important;
  }
  
  .threshold-description {
    font-size: 11px !important;
    padding: 8px 12px !important;
  }
  
  /* Status bar */
  .status-bar {
    padding: 12px 16px !important;
    margin: 0 12px 20px 12px !important;
    border-radius: 20px !important;
  }
  
  .status-label, .status-value {
    font-size: 11px !important;
  }
  
  /* Control card */
  .control-grid {
    gap: 15px !important;
  }
  
  .status-box {
    padding: 12px !important;
  }
  
  .status-box i {
    width: 40px !important;
    height: 40px !important;
    font-size: 20px !important;
  }
  
  .status-box-value {
    font-size: 18px !important;
  }
  
  .mode-btn, .pump-btn {
    padding: 12px !important;
    font-size: 13px !important;
  }
  
  /* Footer */
  footer {
    padding: 15px !important;
  }
  
  .footer-content {
    font-size: 11px !important;
    gap: 10px !important;
  }
}

/* Untuk layar sangat kecil */
@media (max-width: 480px) {
  .data-item {
    padding: 10px 12px !important;
  }
  
  .data-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }
  
  .data-label {
    font-size: 11px !important;
  }
  
  .data-value {
    font-size: 14px !important;
  }
  
  .data-value span {
    font-size: 16px !important;
  }
  
  .soil-number {
    font-size: 48px !important;
  }
  
  .card-title h2 {
    font-size: 14px !important;
  }
}

/* UTILITY CLASSES */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.w-100 {
  width: 100%;
}
