/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #27ae60;
  --primary-dark: #219653;
  --accent: #f39c12;
  --text: #2c3e50;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --border: #ddd;
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --hover: #2ecc71;
  --font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

[data-theme="dark"] {
  --primary: #2ecc71;
  --primary-dark: #27ae60;
  --text: #ecf0f1;
  --bg: #1a1a1a;
  --card-bg: #2d2d2d;
  --border: #444;
  --shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== HEADER ===== */
.header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  position: relative;
}

.header h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

#darkModeToggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}

#darkModeToggle:hover {
  background: rgba(255,255,255,0.3);
}

#darkModeToggle i {
  margin-right: 5px;
}

/* ===== GRID LAYOUT ===== */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* ===== CARD STYLES ===== */
.card {
  background: var(--card-bg);
  padding: 24px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.card h2 {
  color: var(--primary);
  margin-bottom: 18px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== FORM STYLES ===== */
.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.input-group i {
  color: var(--primary);
  margin-right: 6px;
}

input[type="number"], select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: border 0.3s;
}

input[type="number"]:focus, select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
}

/* ===== BUTTONS ===== */
.btn-calculate {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.3s;
}

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

/* ===== RESULTS ===== */
.result {
  margin-top: 16px;
  padding: 14px;
  background: rgba(39, 174, 96, 0.1);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  font-weight: 500;
  line-height: 1.5;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  margin-top: 20px;
  padding: 20px;
  color: var(--text);
  opacity: 0.7;
  font-size: 0.95rem;
}

.footer i {
  color: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header {
    padding: 16px;
  }

  .header h1 {
    font-size: 1.8rem;
  }

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

  #darkModeToggle {
    position: static;
    display: inline-flex;
    margin-top: 10px;
  }
}

/* ===== COST CALCULATOR CARD (SPECIAL) ===== */
.cost-calculator {
  border: 2px solid transparent;
  background: var(--card-bg);
  position: relative;
}

.cost-calculator::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 12px;
  opacity: 0.3;
  pointer-events: none;
}

.cost-calculator .note {
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(243, 156, 18, 0.1);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cost-calculator .note i {
  color: var(--accent);
}
