/* Správa aut – mobilní aplikace pro Aleše. Velká tlačítka, málo textu, nic se neukládá ručně. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #0f0f0f;
  --dark: #1a1a1a;
  --accent: #e63329;
  --accent-dark: #b8251c;
  --green: #1f8a3b;
  --yellow: #c98a00;
  --blue: #2457b8;
  --purple: #6b3fa0;
  --gray-1: #f3f3f3;
  --gray-2: #dedede;
  --gray-3: #8a8a8a;
  --text: #1a1a1a;
  --text-light: #555;
  --white: #fff;
  --radius: 14px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gray-1);
  color: var(--text);
  line-height: 1.45;
  font-size: 16px;
  min-height: 100vh;
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

/* horní lišta */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: var(--black);
  color: var(--white);
}
.top-back {
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  line-height: 1;
  width: 40px;
  height: 44px;
  margin-left: -8px;
  cursor: pointer;
}
.top-title { flex: 1; font-weight: 800; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-save { font-size: .8rem; color: #9fd3a9; white-space: nowrap; }

.app { max-width: 640px; margin: 0 auto; padding: 16px; }
.loading, .muted { color: var(--gray-3); }
.section { margin-top: 22px; }
.section h2 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-3); margin-bottom: 10px; }
.card { background: var(--white); border-radius: var(--radius); padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.notice { background: #fff4e0; border: 1px solid #f0d199; color: #6b4a00; border-radius: var(--radius); padding: 12px 14px; font-size: .92rem; }
.notice--bad { background: #fde8e6; border-color: #f3b4ae; color: #8a1f17; }
.notice--ok { background: #e6f4ea; border-color: #b3dcc0; color: #1d5a2e; }

/* tlačítka */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--gray-2);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--white); }
.btn--dark { background: var(--black); border-color: var(--black); color: var(--white); }
.btn--green { background: var(--green); border-color: var(--green); color: var(--white); }
.btn--yellow { background: var(--yellow); border-color: var(--yellow); color: var(--white); }
.btn--purple { background: var(--purple); border-color: var(--purple); color: var(--white); }
.btn--rec { background: var(--accent); border-color: var(--accent); color: var(--white); animation: pulse 1.2s infinite; }
.btn--small { min-height: 42px; font-size: .92rem; padding: 8px 12px; width: auto; }
.btn--danger { color: var(--accent); border-color: #f3b4ae; }
.btn--google { background: #fff; border-color: #c8c8c8; color: #1f1f1f; text-decoration: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-col { display: grid; gap: 10px; }
@keyframes pulse { 50% { opacity: .7; } }

/* spodní lišta s fotoaparátem - vždy po ruce palcem */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(243,243,243,.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--gray-2);
}
.dock-inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.dock .btn--camera { min-height: 64px; font-size: 1.2rem; }
.dock .btn--gallery { width: 64px; min-height: 64px; font-size: 1.5rem; padding: 0; }

.thanks { text-align: center; }
.thanks-icon { font-size: 2.6rem; }
.thanks h1 { font-size: 1.5rem; margin: 6px 0 12px; }
.thanks p { margin-bottom: 10px; }
.thanks .btn { margin-top: 8px; }

/* záložky úvodní obrazovky */
.tabs {
  position: sticky;
  top: calc(56px + env(safe-area-inset-top, 0px));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: -16px -16px 16px;
  padding: 10px 16px;
  background: var(--gray-1);
  border-bottom: 1px solid var(--gray-2);
}
.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  text-decoration: none;
  background: var(--white);
  border: 2px solid var(--gray-2);
  white-space: nowrap;
}
.tab--on { background: var(--black); border-color: var(--black); color: var(--white); }

/* seznam aut */
.car-list { display: grid; gap: 10px; }
.car-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.car-item img, .car-item .ph { width: 84px; height: 63px; object-fit: cover; border-radius: 8px; background: var(--gray-2); display: grid; place-items: center; font-size: 1.6rem; }
.car-item-name { font-weight: 700; line-height: 1.25; }
.car-item-meta { font-size: .85rem; color: var(--text-light); margin-top: 3px; }
.chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--gray-2); color: var(--text); }
.chip--na-prodej { background: var(--green); color: var(--white); }
.chip--pripravujeme { background: var(--yellow); color: var(--white); }
.chip--rezervovano { background: var(--blue); color: var(--white); }
.chip--prodano { background: #555; color: var(--white); }
.chip--soukrome { background: var(--purple); color: var(--white); }
.chip--writing { background: #fff4e0; color: #6b4a00; }
.chip--review { background: #e8f0fe; color: #1d3d8a; }

/* fotky */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--gray-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: none;
  border-radius: 999px;
  background: rgba(0,0,0,.6);
  color: var(--white);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
}
.photo-del--confirm { background: var(--accent); }
.photo-cover {
  position: absolute;
  left: 4px;
  bottom: 4px;
  border: none;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(0,0,0,.55);
  color: var(--white);
  cursor: pointer;
}
.photo-cover--on { background: var(--accent); }
.photo-state { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.55); font-weight: 700; font-size: .85rem; text-align: center; padding: 4px; }
.photo-state--bad { background: rgba(253,232,230,.9); color: #8a1f17; cursor: pointer; }
.photos-empty { grid-column: 1 / -1; text-align: center; padding: 28px 10px; color: var(--gray-3); background: var(--white); border-radius: var(--radius); border: 2px dashed var(--gray-2); }

/* popis */
textarea {
  width: 100%;
  min-height: 130px;
  padding: 12px;
  border: 2px solid var(--gray-2);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  resize: vertical;
  background: var(--white);
}
textarea:focus, input:focus { outline: none; border-color: var(--accent); }
input[type=text], input[type=url], input[type=password], input[type=email] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--gray-2);
  border-radius: 12px;
  font: inherit;
}
.hint { font-size: .85rem; color: var(--text-light); margin-top: 8px; }

/* inzerát */
.ad-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); display: block; background: var(--gray-2); }
.ad-title { font-size: 1.3rem; font-weight: 800; line-height: 1.25; margin-top: 12px; }
.ad-price { font-size: 1.4rem; font-weight: 800; color: var(--accent); margin-top: 4px; }
.ad-facts { color: var(--text-light); font-size: .92rem; margin-top: 4px; }
.ad-text { margin-top: 12px; white-space: pre-line; }
.ad-list { margin: 10px 0 0 0; list-style: none; }
.ad-list li { padding-left: 22px; position: relative; margin-bottom: 4px; }
.ad-list li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.ad-missing { margin-top: 12px; }

.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-btn { min-height: 50px; border-radius: 12px; border: 2px solid var(--gray-2); background: var(--white); font-weight: 700; cursor: pointer; }
.status-btn--on { border-color: var(--text); background: var(--black); color: var(--white); }

.channel { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--gray-2); }
.channel:first-child { border-top: none; }
.channel-name { font-weight: 700; }
.channel-state { font-size: .9rem; color: var(--text-light); text-align: right; }

.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(0,0,0,.15); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.writing { display: flex; gap: 12px; align-items: center; }
