:root {
  --bg-dark: #070a12;
  --card-bg: rgba(15, 23, 42, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --accent-cyan: #38bdf8;
  --accent-blue: #0284c7;
  --accent-emerald: #10b981;
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --input-bg: rgba(30, 41, 59, 0.6);
  --input-border: rgba(255, 255, 255, 0.12);
  --radius-lg: 20px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(2, 132, 199, 0.08) 0%, transparent 40%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
}

.app-wrapper {
  width: 100%;
  max-width: 1100px;
}

/* Header & Animated Logo */
.app-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-container {
  width: 70px;
  height: 70px;
  margin: 0 auto 0.75rem auto;
}

.ripple-logo {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.water-drop {
  animation: dropFall 2.5s infinite ease-in;
  transform-origin: center;
}

.ripple-ring {
  transform-origin: 50px 65px;
  opacity: 0;
}

.ring-1 { animation: rippleExpand 2.5s infinite 1.1s ease-out; }
.ring-2 { animation: rippleExpand 2.5s infinite 1.3s ease-out; }
.ring-3 { animation: rippleExpand 2.5s infinite 1.5s ease-out; }

@keyframes dropFall {
  0% { transform: translateY(-20px) scale(0.8); opacity: 0; }
  30% { opacity: 1; }
  50% { transform: translateY(20px) scale(1); opacity: 1; }
  55% { transform: translateY(22px) scale(0.2); opacity: 0; }
  100% { opacity: 0; }
}

@keyframes rippleExpand {
  0% { transform: scale(0.2); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

.brand-title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-cyan) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Main Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}

@media (max-width: 850px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.section-heading {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.section-sub {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.full-width {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: span 1; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input, .form-group select {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Dropdown dark theme option styling */
.form-group select option {
  background-color: #0f172a;
  color: #f8fafc;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.primary-btn {
  width: 100%;
  margin-top: 1.5rem;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.3);
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 3rem 1rem;
}

.liquid-loader {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--accent-cyan);
  margin: 0 auto 1rem auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Mission Result Display */
.mission-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.5rem;
}

.mission-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.mission-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.why-box {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent-cyan);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.steps-box h4 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.steps-list {
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.steps-list li::marker {
  color: var(--accent-cyan);
  font-weight: 600;
}

.mission-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.complete-btn {
  flex: 2;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

.secondary-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
}

/* Reservoir / Water Tank Sidebar */
.reservoir-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.card-title { font-size: 1.1rem; font-weight: 600; }
.card-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.water-tank-wrapper {
  width: 100px;
  height: 180px;
  background: rgba(30, 41, 59, 0.4);
  border: 2px solid var(--input-border);
  border-radius: 50px;
  padding: 5px;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5);
}

.water-tank {
  width: 100%;
  height: 100%;
  border-radius: 45px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.water-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Liquid Surface Wave Animation */
.wave {
  position: absolute;
  top: -10px;
  left: 0;
  width: 200%;
  height: 12px;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
  border-radius: 50%;
  animation: waveMotion 3s infinite linear;
}

.wave-2 {
  top: -6px;
  opacity: 0.5;
  animation: waveMotion 2s infinite linear reverse;
}

@keyframes waveMotion {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
}

.stat-number {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.reset-stats-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.2s ease;
}

.reset-stats-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Mission History Drawer Styles */
.history-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--card-border);
}

.history-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.history-item small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.empty-history {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.hidden { display: none !important; }