:root {
  --primary: #2d3748;
  --primary-accent: #3182ce;
  --bg-color: #f7fafc;
  --card-bg: #ffffff;
  --text-main: #1a202c;
  --text-muted: #718096;
  --border-color: #e2e8f0;
  --danger: #e53e3e;
  --success: #38a169;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.app-container {
  width: 100%;
  max-width: 520px;
  background-color: #fdfdfd;
  min-height: 100vh;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  background-color: #edf2f7;
  color: var(--text-muted);
}

.badge.active {
  background-color: #ebf8ff;
  color: var(--primary-accent);
  font-weight: 600;
}

/* Buttons & Inputs */
button {
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary-accent);
  color: #fff;
  padding: 8px 16px;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: #2b6cb0;
}

.btn-secondary {
  background-color: #edf2f7;
  color: var(--text-main);
  padding: 8px 16px;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-text {
  background: none;
  color: var(--primary-accent);
  font-size: 0.85rem;
  font-weight: 500;
}

.btn-small {
  background-color: #edf2f7;
  color: var(--text-main);
  padding: 4px 10px;
  font-size: 0.8rem;
}

.btn-link {
  background: none;
  color: var(--text-muted);
  text-decoration: underline;
  padding: 6px;
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
  padding: 6px 14px;
}

.input-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background-color: #fff;
}

/* Cards & Layout */
.app-main {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 700;
}

/* Weather Card */
.weather-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.weather-main-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.weather-icon {
  font-size: 2.2rem;
}

.weather-temp {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.weather-condition {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.location-info {
  font-size: 0.9rem;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.location-name {
  font-weight: 600;
  color: var(--primary-accent);
}

.coord-advice {
  font-size: 0.85rem;
  color: #4a5568;
}

.location-form {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

/* Schedule Card */
.schedule-selector {
  display: flex;
  gap: 8px;
}

.radio-chip {
  flex: 1;
  position: relative;
}

.radio-chip input {
  position: absolute;
  opacity: 0;
}

.radio-chip span {
  display: block;
  text-align: center;
  padding: 8px 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background-color: #fafafa;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.radio-chip input:checked + span {
  border-color: var(--primary-accent);
  background-color: #ebf8ff;
  color: var(--primary-accent);
  font-weight: 600;
}

/* Suggestion Card */
.coord-display {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: stretch;
  min-height: 140px;
}

.coord-pair-card {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background-color: #fcfcfc;
}

.coord-pair-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 6px;
}

.coord-pair-card .item-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Closet Card */
.closet-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.tab-btn {
  padding: 6px 12px;
  border-radius: 20px;
  background-color: #edf2f7;
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.tab-btn.active {
  background-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.closet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.clothes-card {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: #fff;
  display: flex;
  flex-direction: column;
}

.clothes-card img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.clothes-card .meta {
  padding: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clothes-card .delete-btn {
  background: none;
  color: var(--danger);
  font-size: 0.75rem;
  padding: 2px 4px;
}

/* Add Clothes Form */
.add-clothes-box {
  background-color: #f7fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
}

.image-preview {
  margin-top: 8px;
  width: 100%;
  height: 140px;
  border: 1px dashed var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 4px;
}

.image-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Auth Panel */
.auth-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.auth-card {
  background-color: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
}

.auth-card h2 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.auth-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.auth-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.hidden {
  display: none !important;
}

.empty-state {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 12px;
  width: 100%;
}