/* General reset + background */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  color: white;
  line-height: 1.6;

  /* Waterflow background */
  background: linear-gradient(270deg, #1c1c1c, #2a2a2a, #1c1c1c);
  background-size: 600% 600%;
  animation: waterflow 20s ease infinite;
  -webkit-animation: waterflow 20s ease infinite; /* Safari/Chrome mobile fix */
  background-attachment: fixed;

  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

@keyframes waterflow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }
}

/* Wrap */
.wrap {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

/* Card */
.card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
}

/* Title */
.app-title {
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
}

/* Controls */
.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.controls input {
  padding: 10px;
  border: none;
  border-radius: 8px;
  outline: none;
}

.buttons-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Buttons */
.btn {
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-primary {
  background: #444;
  color: white;
}

.btn-primary:hover {
  background: #666;
}

.btn-secondary {
  background: #555;
  color: white;
}

.btn-secondary:hover {
  background: #777;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
}

/* Result area */
.result {
  margin-top: 20px;
  text-align: center;
}

.svg-wrap {
  margin-bottom: 10px;
}

.city-block {
  margin-bottom: 10px;
}

.city-name {
  font-size: 20px;
  font-weight: bold;
}

.country {
  font-size: 14px;
  opacity: 0.8;
}

.local-time {
  font-size: 12px;
  opacity: 0.7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 15px;
}

.grid-item {
  background: rgba(255,255,255,0.05);
  padding: 10px;
  border-radius: 8px;
}

.label {
  font-size: 12px;
  opacity: 0.8;
}

.value {
  font-size: 16px;
  font-weight: bold;
}

/* Unit toggle */
.unit-container {
  margin-top: 15px;
  text-align: center;
}

.hidden {
  display: none;
}

/* Loading spinner */
.spinner {
  border: 4px solid rgba(255,255,255,0.2);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

/* Credits */
.credits-wrap {
  margin-top: 20px;
  text-align: center;
}

.credits-line {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.2);
  margin: 15px 0;
}

.credits-text {
  font-size: 12px;
  opacity: 0.7;
}

/* Sidebar */
.sidebar {
  height: 100%;
  width: 0;
  position: fixed;
  top: 0; left: 0;
  background: rgba(17, 17, 17, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-x: hidden;
  transition: 0.3s;
  padding-top: 60px;
  z-index: 1000;
}

.sidebar a {
  padding: 12px 25px;
  text-decoration: none;
  font-size: 18px;
  color: #ccc;
  display: block;
  transition: 0.3s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar.open {
  width: 250px;
}

/* Hamburger */
.hamburger {
  position: fixed;
  top: 20px;
  left: 20px;
  cursor: pointer;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 30px;
  height: 3px;
  margin: 6px;
  background: white;
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}
