/* ========== CSS VARIABLES & RESET ========== */
:root {
  --primary-color: #ff9500;
  --dark-color: #333;
  --success-color: #2ed573;
  --info-color: #70a1ff;
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background: #f9f9f9;
  color: var(--dark-color);
}
.container {
  max-width: 800px;
  margin: 20px auto;
  padding: 0 20px;
}

/* ========== HEADER ========== */
header {
  text-align: center;
  margin-bottom: 20px;
}
header h1 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 2rem;
  color: var(--primary-color);
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  width: 100%;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  overflow: hidden;
}
.tab-button {
  flex: 1;
  padding: 10px;
  background: #fafafa;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  color: var(--dark-color);
}
.tab-button.active {
  background: white;
  color: var(--dark-color);
  box-shadow: inset 0 -2px 0 var(--primary-color);
}
.tab-button:hover {
  background: #fff;
}

/* ========== VIEWS ========== */
.view {
  display: none;
}
.view.active {
  display: block;
}

/* ========== LOADING ========== */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ========== CARDS & BUTTONS ========== */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 20px;
}
.card .card-header {
  border-bottom: 1px solid #eee;
  padding: 12px 16px;
}
.card .card-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--dark-color);
}
.card .card-content {
  padding: 16px;
}

button,
input,
select {
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}
button {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 8px 16px;
  cursor: pointer;
}
button:hover {
  background: #e08900;
}
button.secondary {
  background: var(--info-color);
  color: white;
}
button.secondary:hover {
  background: #5a8dee;
}

.save-button {
  display: block;
  width: 100%;
  background: var(--success-color);
  margin-top: 10px;
}
.save-button:hover {
  background: #26bb62;
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 16px;
}
label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}
input,
select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
}

/* ========== HOME LAYOUT ========== */
#home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
#circle-widget {
  width: 280px;
  height: 280px;
  cursor: pointer;
  position: relative;
}
#safe-time-card {
  width: 100%;
}
#safe-time {
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary-color);
  margin: 8px 0;
}
#location-refresh {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
#location-info {
  font-size: 0.9rem;
  color: #555;
}

/* ========== CIRCLE CENTER ========== */
.center-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 176px;
  height: 176px;
  background: var(--dark-color);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
}
.center-info .time {
  font-size: 1rem;
}
.center-info .uvi {
  font-size: 2.5rem;
  color: var(--primary-color);
}
.center-info .label {
  font-size: 0.9rem;
}

/* ========== SETTINGS LAYOUT ========== */
#settings-form {
  width: 100%;
}

/* ========== ABOUT ========== */
#about ul {
  margin-top: 8px;
  margin-left: 20px;
}
#about li {
  margin-bottom: 4px;
}

.card-content ul {
  margin-top: 8px;
  margin-left: 20px;
}

.card-content li {
  margin-bottom: 4px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  #location-refresh {
    flex-direction: column;
    gap: 10px;
  }
  button {
    width: 100%;
  }
}

/* ========== Location fieldset (in main.css) ========== */
.location-frame {
  position: relative;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.location-frame legend {
  padding: 0 0.5rem;
  margin-left: 1rem;
  background: #f9f9f9;
  font-weight: 600;
  font-size: 1rem;
}
/* City suggestions dropdown */
.suggestions {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
}
.suggestion-item {
  padding: 8px;
  cursor: pointer;
}
.suggestion-item:hover {
  background: #f0f0f0;
}

.location-button-container {
  text-align: right;
  margin-bottom: 1rem;
}

#btn-detect-location {
  font-size: 0.9rem;
  padding: 6px 12px;
  white-space: nowrap;
}
