/* assets/css/style.css - Smart Garden Web App Theme (Matching React Native App) */
:root {
  --primary-dark: #1B5E20;
  --primary: #2E7D32;
  --primary-light: #43A047;
  --accent-glow: #DCEDC8;
  --bg-app: #F1F8E9;
  --card-bg: #FFFFFF;
  --border-color: #C5E1A5;
  --text-main: #1B5E20;
  --text-sec: #558B2F;
  --text-muted: #607D8B;
  --danger: #D32F2F;
  --warning: #F9A825;
  --info: #0277BD;
  --shadow: rgba(46, 125, 50, 0.12);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-app);
  color: #37474F;
  min-height: 100vh;
  padding-bottom: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Container utama berukuran layaknya layar HP/Tablet/PC */
.app-container {
  width: 100%;
  max-width: 500px;
  min-height: 100vh;
  background-color: var(--bg-app);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(0,0,0,0.08);
}

/* Header Status Bar */
.top-bar {
  background-color: var(--primary-dark);
  color: #FFFFFF;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-title {
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.device-badge {
  background-color: var(--primary);
  color: #FFF;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 14px;
}

/* Tab Screens */
.tab-screen {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header Control Card (Pompa R1 & R2) */
.header-control-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-control-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tank-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.status-subtitle {
  font-size: 12px;
  color: var(--text-sec);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.pump-btn-group {
  display: flex;
  gap: 8px;
  width: 100%;
}

.pump-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: 25px;
  border: none;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
}

.pump-btn:active {
  transform: scale(0.96);
}

.pump-btn.on {
  background-color: var(--primary-light);
}

.pump-btn.off {
  background-color: var(--danger);
}

/* Tank Visualization Container */
.tank-visual-wrapper {
  position: relative;
  width: 100%;
  height: 310px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -30px;
  margin-bottom: -15px;
}

.tank-bg-img {
  width: 100%;
  max-width: 330px;
  height: 310px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  mix-blend-mode: multiply;
}

.tank-inner-water {
  width: 32%;
  height: 22%;
  position: absolute;
  top: 73.5%;
  left: 34%;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,0.25);
  border: 1.5px solid rgba(255,255,255,0.6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  mix-blend-mode: normal;
}

.water-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 50%;
  background-color: var(--primary);
  opacity: 0.85;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}

.grid-line {
  position: absolute;
  width: 100%;
  border-top: 1px dashed rgba(255,255,255,0.7);
  z-index: 10;
}

.grid-text {
  position: absolute;
  width: 100%;
  text-align: center;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  top: -7px;
}

/* Info Card & Main Stats */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px var(--shadow);
}

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

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-sec);
}

.status-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.percentage-big {
  font-size: 36px;
  font-weight: 900;
  text-align: center;
  margin: 4px 0 2px 0;
}

.progress-bar-bg {
  height: 10px;
  background-color: var(--bg-app);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  transition: width 0.5s ease, background-color 0.4s ease;
}

.divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 14px 0;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-box-mini {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.icon-box-mini {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  font-size: 16px;
}

.stat-label-mini {
  font-size: 10px;
  color: var(--text-sec);
  font-weight: 600;
}

.stat-value-mini {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

.stats-row-wide {
  grid-column: span 3;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.stat-box-wide {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-box-wide .icon-box {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* Config & Form Inputs */
.stepper-container {
  display: flex;
  align-items: center;
  background: #FFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.stepper-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 18px;
  color: var(--text-sec);
  cursor: pointer;
  font-weight: bold;
}

.stepper-input {
  flex: 1;
  border: none;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  width: 40px;
  outline: none;
}

.visual-track {
  display: flex;
  height: 28px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin: 10px 0;
}

.visual-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 10px;
  font-weight: 800;
  transition: flex 0.4s ease;
}

.legend-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-sec);
  font-weight: 600;
}

/* Pin Mapping Grid */
.pin-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.pin-card {
  height: 40px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border-color);
  font-weight: 800;
  font-size: 12px;
}

.pin-card.safe { background: var(--accent-glow); border-color: var(--primary); color: var(--primary); }
.pin-card.input { background: #E1F5FE; border-color: var(--info); color: var(--info); }
.pin-card.risk { background: #FBE9E7; border-color: var(--danger); color: var(--danger); }
.pin-card.used { background: #546E7A; border-color: #546E7A; color: #FFF; }

/* User List Card */
.user-card {
  display: flex;
  align-items: center;
  background: #FAFAFA;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.user-info { flex: 1; }
.user-name { font-weight: 700; font-size: 15px; color: var(--text-main); }
.user-role { font-size: 11px; font-weight: 700; color: var(--text-sec); }

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 500px;
  height: 75px;
  background: #FFFFFF;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 15px var(--shadow);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 6px;
  z-index: 1000;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 600;
  gap: 2px;
  padding: 2px 0;
  transition: all 0.2s ease;
}

.nav-item i {
  font-size: 20px;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

/* Guide Image Card Styling */
.guide-img-box {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-top: 10px;
  box-shadow: 0 4px 12px var(--shadow);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.guide-img-box:hover {
  transform: scale(1.01);
}

.guide-img-box img {
  width: 100%;
  height: auto;
  display: block;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 800;
}

.nav-item.active i {
  background-color: var(--accent-glow);
  color: var(--primary);
}

.save-btn {
  background-color: var(--primary);
  color: #FFF;
  border: none;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.save-btn:hover { background-color: var(--primary-dark); }

/* Login Screen Styles */
.login-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: #FFFFFF;
}

.login-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
  margin-bottom: 12px;
}

.login-title-box {
  text-align: center;
  margin-bottom: 24px;
}

.login-title-main {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-dark);
}

.login-title-highlight {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary);
  display: block;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-form {
  width: 100%;
  max-width: 360px;
}

.input-field-group {
  display: flex;
  align-items: center;
  background: #F9F9F9;
  border: 1.2px solid #E0E0E0;
  border-radius: 14px;
  padding: 0 14px;
  margin-bottom: 14px;
  height: 48px;
}

.input-field-group i {
  font-size: 20px;
  color: var(--primary);
  margin-right: 10px;
}

.input-field-group input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--primary-dark);
  height: 100%;
}

.input-field-group .toggle-pwd {
  cursor: pointer;
  color: var(--primary);
  margin-right: 0;
  margin-left: 8px;
}

.role-pill-group {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.role-pill-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.role-pill-btn.active {
  background: var(--primary);
  color: #FFFFFF;
}

.login-submit-btn {
  width: 100%;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  padding: 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--shadow);
  transition: all 0.2s ease;
}

.login-submit-btn:hover {
  background: var(--primary-dark);
}

.switch-auth-mode {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
}

.switch-auth-mode span {
  color: var(--primary);
  font-weight: 800;
}

.note-card-box {
  background: var(--primary);
  border-left: 5px solid var(--primary-dark);
  border-radius: 14px;
  padding: 14px;
  margin-top: 20px;
  color: #FFFFFF;
  font-size: 12px;
  line-height: 1.5;
  width: 100%;
  max-width: 360px;
}

.note-card-title {
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.highlight-yellow {
  color: #FFEB3B;
  font-weight: 800;
}

/* Logout Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon-header {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #FFEBEE;
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 12px auto;
}

.modal-title { font-size: 18px; font-weight: 800; color: #37474F; margin-bottom: 6px; }
.modal-msg { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

.modal-btn-row { display: flex; gap: 10px; }
.modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
}

.modal-btn-cancel { background: #ECEFF1; color: #546E7A; }
.modal-btn-confirm { background: var(--danger); color: #FFFFFF; }

