/*
 * MeineSterne Styles — portiert aus der Original-App
 */

/* FLASH TOAST */
.flash-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  min-width: 220px;
  max-width: 90vw;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: .95rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.flash-toast--notice { background: #4caf78; color: #fff; }
.flash-toast--alert  { background: #e05c5c; color: #fff; }
.flash-toast--hidden { opacity: 0; pointer-events: none; }

:root {
  --font: ui-rounded, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --gold: #FFD93D;
  --green: #5cb85c;
  --bg: #FFF9F0;
  --card: #fff;
  --shadow: 0 4px 20px rgba(0,0,0,.08);
  --r: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); min-height: 100vh; padding: 16px 12px 40px; }

/* HEADER */
.app-header { text-align: center; margin-bottom: 16px; }
.app-title { font-size: clamp(1.5rem,6vw,2.2rem); color: #333; }
.app-sub { color: #aaa; font-size: .85rem; margin-top: 2px; }

/* SETTINGS TABS */
.settings-bar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.stab { background: white; border: 2px solid #e8e8e8; border-radius: 24px; padding: 6px 16px; font-size: .82rem; font-weight: 700; color: #aaa; cursor: pointer; transition: all .18s; text-decoration: none; display: inline-block; }
.stab:hover { border-color: #ccc; color: #666; }
.stab.active { border-color: var(--gold); background: var(--gold); color: #333; }

/* WEEK NAV */
.week-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; }
.week-nav a, .week-nav button { background: white; border: 2px solid #eee; border-radius: 50%; width: 36px; height: 36px; font-size: 1.1rem; cursor: pointer; transition: all .18s; display: flex; align-items: center; justify-content: center; text-decoration: none; color: #333; }
.week-nav a:hover, .week-nav button:hover { border-color: var(--gold); background: var(--gold); }
.week-nav-today { background: var(--gold) !important; border-color: var(--gold) !important; border-radius: 12px !important; width: auto !important; padding: 0 10px !important; font-size: .8rem !important; font-weight: 700; color: #fff !important; }
.week-label { font-size: .98rem; font-weight: 700; color: #666; min-width: 160px; text-align: center; }

/* TOTALS */
.totals { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 22px; max-width: 600px; margin-left: auto; margin-right: auto; }
.total-card { border-radius: var(--r); padding: 13px 14px; text-align: center; box-shadow: var(--shadow); min-width: 120px; flex: 1; }
.kid-avatar { font-size: 1.4rem; }
.kid-display-name { font-size: 1.05rem; font-weight: 800; margin: 2px 0; }
.stars-disp { font-size: 1.05rem; line-height: 1.5; word-break: break-all; min-height: 1.5rem; }
.total-unit { font-size: .7rem; color: #aaa; margin-top: 1px; }

/* MEDIENZEIT */
.mt-section-title { text-align: center; font-size: .72rem; font-weight: 700; color: #aaa; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.mt-cards { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 22px; max-width: 600px; margin-left: auto; margin-right: auto; }
.mt-card { border-radius: var(--r); padding: 13px 14px; text-align: center; box-shadow: var(--shadow); min-width: 120px; flex: 1; }
.mt-kid-name { font-size: .95rem; font-weight: 800; margin: 2px 0; }
.mt-balance { font-size: 1.3rem; font-weight: 800; color: #333; line-height: 1.2; }
.mt-minutes { font-size: .72rem; color: #888; margin-bottom: 5px; }
.mt-base-info { font-size: .66rem; color: #bbb; margin-bottom: 8px; line-height: 1.4; }
.mt-redeem-btn { background: var(--gold); border: none; border-radius: 20px; padding: 5px 14px; font-weight: 800; font-size: .78rem; cursor: pointer; transition: all .15s; width: 100%; }
.mt-redeem-btn:hover { opacity: .85; }
.mt-progress { height: 5px; background: #eee; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.mt-progress-bar { height: 100%; border-radius: 3px; transition: width .4s ease; }

/* DAYS GRID */
.days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; max-width: 900px; margin: 0 auto; }
.day-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s; }
.day-card:hover { transform: translateY(-2px); }
.day-header { padding: 9px 14px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, #f9f9f9, #efefef); border-bottom: 2px solid #eee; }
.day-name { font-size: .95rem; font-weight: 700; color: #444; }
.day-date { font-size: .72rem; color: #ccc; }
.tasks-list { padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.task-row { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-radius: 11px; background: #fafafa; border: 2px solid transparent; transition: all .15s; user-select: none; -webkit-tap-highlight-color: transparent; }
.kid-toggle { width: 36px; height: 36px; border-radius: 50%; border: 2px solid; font-size: .9rem; font-weight: 800; cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; flex-shrink: 0; -webkit-tap-highlight-color: transparent; color: #444; }
.kid-toggle:active { transform: scale(.88); }
.kid-toggle--done { box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.kid-toggle--confirming { opacity: .45; transform: scale(.88); box-shadow: none !important; }
.t-emoji { font-size: 1.35rem; flex-shrink: 0; width: 30px; text-align: center; }
.t-info { flex: 1; min-width: 0; }
.t-label { font-size: .84rem; font-weight: 700; color: #444; line-height: 1.2; }
.t-sub { font-size: .68rem; color: #ccc; }
.t-badges { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.badge { font-size: .64rem; font-weight: 800; padding: 2px 6px; border-radius: 16px; white-space: nowrap; line-height: 1.4; color: white; }
.badge.both { background: var(--green); }
.badge.bonus { background: var(--gold); color: #555; }
.badge.skip { background: #eee; color: #bbb; border: 1.5px solid #ddd; }

/* LEGEND */
.legend { max-width: 520px; margin: 20px auto 0; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: .74rem; color: #888; font-weight: 600; }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; }

.info-box { max-width: 480px; margin: 10px auto 0; background: white; border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); font-size: .76rem; color: #aaa; line-height: 1.65; text-align: center; }
.info-box strong { color: #888; }

/* PIN OVERLAY */
.pin-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; display: flex; align-items: center; justify-content: center; }
.pin-box { background: white; border-radius: 24px; padding: 28px 24px; text-align: center; width: 88%; max-width: 320px; box-shadow: 0 12px 50px rgba(0,0,0,.2); animation: popIn .2s ease; }
.pin-title { font-size: 1.2rem; color: #333; margin-bottom: 4px; }
.pin-sub { font-size: .8rem; color: #aaa; margin-bottom: 20px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin-bottom: 20px; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; background: #eee; border: 2px solid #ddd; transition: all .15s; }
.pin-dot.filled { background: var(--gold); border-color: var(--gold); }
.pin-dot.error { background: #FF6B6B; border-color: #FF6B6B; }
.pin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.pin-btn { background: #f5f5f5; border: 2px solid #eee; border-radius: 14px; padding: 14px; font-size: 1.3rem; font-weight: 700; cursor: pointer; transition: all .12s; color: #333; }
.pin-btn:active { background: var(--gold); border-color: var(--gold); transform: scale(.94); }
.pin-cancel { background: none; border: none; color: #aaa; font-size: .85rem; font-weight: 700; cursor: pointer; }
.pin-cancel:hover { color: #FF6B6B; }

/* REDEEM OVERLAY */
.redeem-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 300; display: flex; align-items: center; justify-content: center; }
.redeem-box { background: white; border-radius: 24px; padding: 24px 22px; text-align: center; width: 88%; max-width: 320px; box-shadow: 0 12px 50px rgba(0,0,0,.2); animation: popIn .2s ease; }
.redeem-title { font-size: 1.1rem; color: #333; margin-bottom: 4px; }
.redeem-sub { font-size: .8rem; color: #aaa; margin-bottom: 16px; }
.redeem-amount { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 6px; }
.redeem-amount button { background: #f0f0f0; border: 2px solid #ddd; border-radius: 50%; width: 36px; height: 36px; font-size: 1.2rem; cursor: pointer; font-weight: 800; transition: all .15s; }
.redeem-amount button:hover { background: var(--gold); border-color: var(--gold); }
.redeem-num { font-size: 2rem; font-weight: 800; color: #333; min-width: 44px; }
.redeem-min-label { font-size: .75rem; color: #aaa; margin-bottom: 16px; }
.redeem-confirm { background: var(--gold); border: none; border-radius: 12px; padding: 10px 24px; font-weight: 800; font-size: .92rem; cursor: pointer; width: 100%; margin-bottom: 8px; }
.redeem-cancel-btn { background: none; border: none; color: #aaa; font-size: .82rem; font-weight: 700; cursor: pointer; }

/* SETTINGS FORMS */
.settings-panel { max-width: 520px; margin: 0 auto 18px; background: white; border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.sp-title { font-size: 1rem; color: #555; margin-bottom: 14px; font-weight: 700; }
.s-row { margin-bottom: 10px; }
.s-row label { display: block; font-size: .78rem; font-weight: 700; color: #777; margin-bottom: 3px; }
.s-row input, .s-row select { width: 100%; padding: 8px 11px; border: 2px solid #eee; border-radius: 10px; font-size: .88rem; outline: none; transition: border .2s; }
.s-row input:focus, .s-row select:focus { border-color: var(--gold); }
.save-btn { background: var(--gold); border: none; border-radius: 11px; padding: 8px 18px; font-weight: 800; font-size: .88rem; cursor: pointer; transition: opacity .2s; }
.save-btn:hover { opacity: .85; }
.form-errors { background: #fff5f5; border: 1.5px solid #f5c0c0; border-radius: 11px; padding: 12px 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.form-error-item { color: #c0392b; font-size: .82rem; font-weight: 500; }
.auth-links { display: flex; gap: 12px; justify-content: flex-start; flex-wrap: wrap; margin-top: 16px; }
.auth-link { color: #888; font-size: .82rem; font-weight: 600; text-decoration: none; padding: 6px 14px; border-radius: 11px; border: 1.5px solid #e8e8e8; transition: all .18s; }
.auth-link:hover { border-color: var(--gold); color: #555; background: #fffbef; }
.settings-row { display: flex; align-items: center; gap: 8px; padding: 11px 10px; border-bottom: 1px solid #f0f0f0; border-radius: 8px; text-decoration: none; color: inherit; transition: background .15s; -webkit-tap-highlight-color: transparent; }
.settings-row:hover, .settings-row:active { background: #fdf6e3; }

/* COLOR SWATCHES */
.color-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.color-swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: all .15s; flex-shrink: 0; }
.color-swatch.selected { border-color: #333; transform: scale(1.15); }

/* SWIM DAYS */
.swim-days { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.swim-day-toggle { display: none; }
.swim-day-btn { padding: 6px 12px; border-radius: 20px; border: 2px solid #eee; background: white; font-size: .82rem; font-weight: 700; cursor: pointer; color: #aaa; transition: all .15s; user-select: none; }
.swim-day-toggle:checked + .swim-day-btn,
.swim-day-btn.selected { border-color: var(--gold); background: var(--gold); color: #333; }

/* ACTIVITY DIVIDER */
.activity-divider { height: 1px; background: #efefef; margin: 4px 0; }

@keyframes pop { 0% { transform: scale(1) } 50% { transform: scale(1.28) } 100% { transform: scale(1) } }
.popped { animation: pop .2s ease; }
@keyframes popIn { from { transform: scale(.85); opacity: 0 } to { transform: scale(1); opacity: 1 } }
