/* ============================================
   KALLIPSO — βασικό stylesheet (mobile-first)
   Brand: πράσινο #1F6F5C, ανοιχτό #E8F3EF
   ============================================ */

:root {
  --brand:        #1F6F5C;
  --brand-dark:   #17554662;
  --brand-darker: #175546;
  --brand-light:  #E8F3EF;
  --text:         #1c2b27;
  --text-muted:   #5c6f69;
  --bg:           #f7faf9;
  --card:         #ffffff;
  --danger:       #b3362c;
  --danger-bg:    #fdecea;
  --radius:       14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.auth-wrap { justify-content: center; }

/* ---------- Brand header ---------- */
.brand {
  text-align: center;
  margin-bottom: 24px;
}

.brand .logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  display: block;
}

.brand h1 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: 0.12em;
  color: var(--brand);
  font-weight: 700;
}

.brand p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(31, 111, 92, 0.08);
  padding: 20px;
  margin-bottom: 16px;
}

/* ---------- Tabs (Σύνδεση / Εγγραφή) ---------- */
.tabs {
  display: flex;
  background: var(--brand-light);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}

.tabs button {
  flex: 1;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  transition: background 0.15s;
}

.tabs button.active {
  background: var(--brand);
  color: #fff;
}

/* ---------- Forms ---------- */
form { display: block; }
form.hidden { display: none; }

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 14px 0 4px;
  color: var(--text);
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1.5px solid #d5e3de;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

input:focus { border-color: var(--brand); }

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 13px;
  margin-top: 20px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover, .btn:focus { background: var(--brand-darker); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-secondary {
  background: var(--brand-light);
  color: var(--brand);
}

.btn-secondary:hover, .btn-secondary:focus { background: #d9ebe4; }

/* ---------- Μηνύματα ---------- */
.msg {
  display: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.msg.error {
  display: block;
  background: var(--danger-bg);
  color: var(--danger);
}

.msg.ok {
  display: block;
  background: var(--brand-light);
  color: var(--brand-darker);
}

/* ---------- Home (μετά το login) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.topbar .title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.08em;
}

.topbar form { margin: 0; }

.topbar .logout {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

.greeting { margin: 0 0 16px; font-size: 1.15rem; }

.placeholder {
  border: 2px dashed #c8ddd6;
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 14px;
  background: #fff;
}

.placeholder .emoji { font-size: 1.8rem; display: block; margin-bottom: 6px; }

/* ---------- Ντουλάπα ---------- */
.hidden { display: none !important; }

.back {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1.5px solid #d5e3de;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}

select:focus { border-color: var(--brand); }

input[type="file"] {
  width: 100%;
  padding: 10px;
  font-size: 0.9rem;
  border: 1.5px dashed #c8ddd6;
  border-radius: 10px;
  background: var(--brand-light);
  color: var(--text);
}

label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-weight: 600;
  font-size: 0.95rem;
}

label.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

@media (min-width: 480px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

.garment {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(31, 111, 92, 0.08);
  overflow: hidden;
  display: flex;
}

.garment-photo {
  width: 110px;
  min-height: 110px;
  flex-shrink: 0;
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.garment-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.garment-photo .noimg { font-size: 2rem; opacity: 0.5; }

.garment-info {
  padding: 10px 12px;
  flex: 1;
  min-width: 0;
}

.garment-info strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 6px;
  overflow-wrap: break-word;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.chip {
  background: var(--brand-light);
  color: var(--brand-darker);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.75rem;
  font-weight: 600;
}

.chip-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.status-select {
  width: auto;
  padding: 5px 8px;
  font-size: 0.8rem;
  border: 1.5px solid #d5e3de;
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted);
}

/* ---------- Πρόταση της ημέρας ---------- */
.card-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--brand);
}

.weather-bar {
  background: var(--brand-light);
  color: var(--brand-darker);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.moods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.mood {
  border: 1.5px solid #d5e3de;
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.mood.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.outfit-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.outfit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border-radius: 10px;
  padding: 8px;
  font-weight: 600;
}

.outfit-photo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--brand-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.outfit-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.outfit-photo .noimg { font-size: 1.4rem; opacity: 0.5; }

.reason {
  background: var(--brand-light);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--brand-darker);
  margin: 0 0 4px;
}

/* ---------- Style profile (ντυσίματα) ---------- */
.style-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

@media (min-width: 480px) {
  .style-grid { grid-template-columns: 1fr 1fr; }
}

.style-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(31, 111, 92, 0.08);
  overflow: hidden;
  padding-bottom: 10px;
}

.style-card img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.style-card .style-notes {
  padding: 10px 12px 6px;
  font-size: 0.88rem;
  color: var(--text);
}

.style-card .chip-btn { margin-left: 12px; }

/* ---------- Nav tiles (αρχική) ---------- */
.nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.nav-tile {
  display: block;
  text-align: center;
  text-decoration: none;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(31, 111, 92, 0.08);
  padding: 16px 8px;
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1.6;
}

.nav-tile strong { font-size: 0.9rem; color: var(--brand-darker); }

/* ---------- Το φόρεσα: ημερομηνία + ώρα ---------- */
.worn-when {
  display: flex;
  gap: 8px;
}

.worn-when input { flex: 1; }

/* ---------- Ημερολόγιο ---------- */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-nav strong { color: var(--brand); font-size: 1.05rem; }

.cal-nav button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 1.4rem;
  cursor: pointer;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-wday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
}

.cal-day {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.cal-day.today { outline: 2px solid var(--brand); }

.cal-day.has-outfit {
  background: var(--brand-light);
  font-weight: 700;
  color: var(--brand-darker);
}

.cal-day .dot {
  position: absolute;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

.cal-outfit {
  border-top: 1px solid #e4efeb;
  padding-top: 10px;
  margin-top: 10px;
}

.cal-outfit:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.cal-outfit .chips { margin-bottom: 8px; }

/* ---------- Στατιστικά ---------- */
.stat-row, .combo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #eef5f2;
}

.stat-row:last-child, .combo-row:last-child { border-bottom: 0; }

.stat-photo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--brand-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-photo img { width: 100%; height: 100%; object-fit: cover; }
.stat-photo .noimg { font-size: 1.2rem; opacity: 0.5; }

.stat-info { flex: 1; min-width: 0; }
.stat-info strong { font-size: 0.92rem; }

.stat-bar {
  height: 6px;
  background: var(--brand-light);
  border-radius: 999px;
  margin-top: 4px;
  overflow: hidden;
}

.stat-bar span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}

.combo-photos { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.combo-plus { color: var(--text-muted); font-weight: 700; }

/* ---------- Tips ---------- */
.tips-cat {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(31, 111, 92, 0.08);
  margin-bottom: 12px;
  overflow: hidden;
}

.tips-cat summary {
  padding: 16px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brand-darker);
  cursor: pointer;
  list-style: none;
}

.tips-cat summary::-webkit-details-marker { display: none; }
.tips-cat summary::after { content: ' ▾'; color: var(--text-muted); }
.tips-cat[open] summary::after { content: ' ▴'; }

.tips-list {
  margin: 0;
  padding: 0 16px 14px 32px;
}

.tips-list li {
  margin-bottom: 10px;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ---------- Lightbox (μεγέθυνση φωτογραφιών) ---------- */
.garment-photo img,
.style-card img,
.outfit-photo img { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(12, 24, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  touch-action: pinch-zoom;
}

.lightbox.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------- Footer ---------- */
.foot {
  margin-top: auto;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 16px 0 8px;
}
