/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #f1f5f9;
  padding: 1rem;
}

body.light-mode {
  background: linear-gradient(to right, #fdfbfb, #ebedee);
  color: #222;
}

.main-wrapper {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.toggleBtn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid #ffffff66;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  z-index: 10;
}

.toggleBtn svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.toggleBtn:hover {
  background-color: #ffffff33;
  transform: scale(1.05);
}

.toggleBtn:hover svg {
  filter: drop-shadow(0 0 4px currentColor);
}

body.light-mode .toggleBtn {
  background-color: #00000010;
  color: #222;
  border-color: #22222244;
}

body.light-mode .toggleBtn:hover {
  background-color: #00000022;
}

.card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

body.light-mode .card {
  background: rgba(255, 255, 255, 0.8);
  border-color: #ddd;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
}

h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #facc15;
}

body.light-mode h2 {
  color: #d97706;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1.2rem;
  border-radius: 8px;
  border: none;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 1rem;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}

body.light-mode input {
  background: #fff;
  color: #111;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

input::placeholder {
  color: #94a3b8;
}

body.light-mode input::placeholder {
  color: #aaa;
}

button.Btn {
  width: 100%;
  padding: 0.9rem;
  background: #facc15;
  color: #000;
  border: none;
  font-size: 1.1rem;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 1rem;
}

button#calculateBtn:hover {
  background: #eab308;
}

.tip-buttons {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 20px;
  gap: 10px;
}

.tip-btn {
  flex: 1;
  padding: 10px;
  background-color: #f0f0f0;
  border: 2px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease-in-out;
  color: #111;
}

.tip-btn:hover {
  background-color: #d8f3dc;
  border-color: #52b788;
  color: #2d6a4f;
}

.tip-btn.active {
  background-color: #52b788;
  color: white;
  border-color: #40916c;
}

.result {
  margin-top: 2rem;
  font-size: 1.1rem;
  text-align: center;
  line-height: 1.6;
}

.highlight {
  color: #22c55e;
  font-weight: 600;
}

body.light-mode .highlight {
  color: #15803d;
}
.alert {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: #ef4444;
  color: white;
  padding: 1rem 1.5rem;
  font-weight: bold;
  font-size: 1rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.alert.show {
  opacity: 1;
  transform: translateX(-50%) scale(1.05);
}

/* Responsive Enhancements */
@media (max-width: 500px) {
  .card {
    padding: 1.5rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .toggleBtn {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
}