/* Backyard Ultra Czechia - hlavní styl */

:root {
  --blue: #1c3f7a;
  --blue-dark: #142c58;
  --red: #d9332a;
  --red-dark: #b8261f;
  --gray-100: #f7f8fa;
  --gray-200: #eceef1;
  --gray-400: #9aa3ad;
  --gray-600: #5b6570;
  --text: #1c242c;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(15, 23, 32, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--white); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; color: var(--gray-600); }

.btn {
  display: inline-block; padding: 14px 28px; border-radius: 999px; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase; font-size: .85rem;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.7); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-dark { background: var(--blue); color: var(--white); }
.btn-dark:hover { background: var(--blue-dark); }
.btn-outline-dark { background: transparent; border-color: var(--gray-400); color: var(--text); }
.btn-outline-dark:hover { background: var(--gray-100); border-color: var(--blue); color: var(--blue); }
.btn-danger { background: #c0331d; color: #fff; }
.btn-danger:hover { background: #9c281a; }
.btn-sm { padding: 9px 18px; font-size: .78rem; }
.btn-xs { padding: 6px 14px; font-size: .75rem; }

/* --- Header / Nav --- */
.site-header { background: var(--blue-dark); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.logo { display: inline-flex; align-items: center; flex-wrap: nowrap; white-space: nowrap; color: var(--white); font-weight: 800; font-size: 1.05rem; letter-spacing: .03em; }
.logo span { color: var(--red); }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--gray-200); font-weight: 600; font-size: .92rem; text-transform: uppercase; letter-spacing: .03em; }
.nav-links a:hover, .nav-links a.active { color: var(--red); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.6rem; cursor: pointer; }

@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--blue-dark);
    flex-direction: column; gap: 0; max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav-links.open { max-height: 300px; }
  .nav-links li { border-top: 1px solid rgba(255,255,255,.08); }
  .nav-links a { display: block; padding: 14px 20px; }
}

/* --- Hero --- */
.hero { background-size: cover; background-position: center; color: var(--white); padding: 100px 0 128px; }
.hero .eyebrow { color: var(--red); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; margin-bottom: 14px; }
.hero h1 { color: var(--white); max-width: 720px; }
.hero p.lead { color: var(--gray-200); max-width: 560px; font-size: 1.1rem; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

.page-hero { background: var(--blue-dark); color: var(--white); padding: 64px 0 44px; }
.page-hero h1 { color: var(--white); margin-bottom: 6px; }
.breadcrumb { color: var(--gray-400); font-size: .9rem; }
.breadcrumb a { color: var(--gray-400); }

/* --- Sections --- */
section { padding: 64px 0; }
.section-alt { background: var(--gray-100); }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }

.list-check { list-style: none; padding: 0; margin: 0; }
.list-check li { position: relative; padding-left: 28px; margin-bottom: 12px; color: var(--text); }
.list-check li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--red); font-weight: 800; }

/* --- Tabulky --- */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table.results { width: 100%; border-collapse: collapse; background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
table.results th, table.results td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--gray-200); }
table.results th { background: var(--gray-100); text-transform: uppercase; font-size: .78rem; letter-spacing: .05em; color: var(--gray-600); }
table.results tr:last-child td { border-bottom: none; }
table.results td.date { white-space: nowrap; color: var(--gray-600); font-variant-numeric: tabular-nums; }

@media (max-width: 700px) {
  table.results-responsive thead { display: none; }
  table.results-responsive, table.results-responsive tbody, table.results-responsive tr, table.results-responsive td { display: block; width: 100% !important; }
  table.results-responsive tr { padding: 14px 18px; border-bottom: 1px solid var(--gray-200); }
  table.results-responsive td { padding: 3px 0; border-bottom: none; }
}

/* --- Skupina závodů (festival s víc kategoriemi, např. 6H/12H na jedné akci) --- */
.zavod-skupina { background: var(--gray-100); border-left: 4px solid var(--red); border-radius: 0 10px 10px 0; padding: 16px 22px; margin: 4px 0; }
.zavod-skupina-hlavicka { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.zavod-skupina-datum { color: var(--gray-600); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zavod-skupina-nazev { font-weight: 800; font-size: 1.02rem; text-transform: uppercase; letter-spacing: .03em; color: var(--blue-dark); }
.zavod-podzavod { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 0 10px 40px; }
.zavod-podzavod + .zavod-podzavod { border-top: 1px solid var(--gray-200); }
.zavod-podzavod-nazev { font-weight: 600; display: flex; align-items: center; gap: 9px; }
.zavod-podzavod-nazev::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }
@media (max-width: 700px) {
  table.results-responsive .zavod-skupina { margin: 0; border-radius: 0; border-left: none; border-top: 4px solid var(--red); }
}

.year-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.year-tabs a { padding: 8px 18px; border-radius: 999px; background: var(--gray-200); color: var(--text); font-weight: 700; font-size: .9rem; }
.year-tabs a.active, .year-tabs a:hover { background: var(--blue); color: var(--white); text-decoration: none; }

.empty-note { padding: 30px; text-align: center; color: var(--gray-600); background: var(--gray-100); border-radius: var(--radius); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-ok { background: #e6f6ec; color: #1a7a3d; }
.badge-link { background: #fef3e6; color: #a85e12; }
.badge-err { background: #fdeceb; color: #c0331d; }
.badge.badge-vyprodano {
  background: var(--gray-200); color: var(--gray-600);
  padding: 6px 14px; border: 2px solid transparent;
  font-weight: 700; font-size: .75rem; letter-spacing: .02em; text-transform: uppercase;
}

.dup-chip { display: inline-flex; align-items: center; gap: 4px; background: #fef3e6; color: #a85e12; border-radius: 999px; padding: 2px 4px 2px 10px; font-size: .75rem; font-weight: 600; margin: 2px 4px 2px 0; }
.dup-chip-x { border: none; background: transparent; color: #a85e12; cursor: pointer; font-size: .95rem; line-height: 1; padding: 3px 6px; border-radius: 50%; }
.dup-chip-x:hover { background: rgba(168, 94, 18, .18); }

.admin-details-toggle { cursor: pointer; font-weight: 600; padding: 8px 0; list-style: revert; }
.admin-details-toggle::marker { color: var(--gray-600); }
details[open] > .admin-details-toggle { margin-bottom: 8px; }

.akce-radek { display: flex; flex-direction: row; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

/* --- Formuláře / admin --- */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .9rem; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 8px; font-family: inherit; font-size: 1rem;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { outline: 2px solid var(--red); border-color: transparent; }
.form-field input[type="radio"] { width: auto; }
.radio-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }

.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-weight: 600; }
.alert-success { background: #e6f6ec; color: #1a7a3d; }
.alert-error { background: #fdeceb; color: #c0331d; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--gray-200); background: var(--white); color: var(--gray-600); cursor: pointer; margin-left: 6px; vertical-align: middle; padding: 0; }
.icon-btn:hover { background: var(--gray-100); color: var(--text); }

.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,32,.6); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-overlay[hidden] { display: none; }
.modal-box { background: var(--white); border-radius: var(--radius); padding: 28px; max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-box h3 { margin-bottom: 18px; padding-right: 24px; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--gray-600); }
.modal-close:hover { color: var(--text); }

.admin-shell { background: var(--gray-100); min-height: 100vh; }
.admin-layout { display: flex; min-height: 100vh; align-items: stretch; }
.admin-sidebar { width: 220px; flex-shrink: 0; background: var(--blue-dark); color: var(--white); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar-title { padding: 22px 20px 18px; font-weight: 700; line-height: 1.3; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 10px; }
.admin-sidebar-links { display: flex; flex-direction: column; }
.admin-sidebar-links a { padding: 11px 20px; color: var(--gray-200); text-decoration: none; border-left: 3px solid transparent; }
.admin-sidebar-links a:hover { background: rgba(255,255,255,.07); color: var(--white); }
.admin-sidebar-links a.active { background: rgba(255,255,255,.07); color: var(--white); font-weight: 600; border-left-color: var(--red); }
.admin-sidebar-links-bottom { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.12); }
.admin-main { flex: 1; min-width: 0; }
.admin-back-link { display: inline-block; margin-bottom: 18px; }
.admin-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; margin-bottom: 24px; }
table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--gray-200); }
table.admin-table th { font-size: .78rem; text-transform: uppercase; color: var(--gray-600); }

.admin-sticky-actions { position: fixed; left: 220px; right: 0; bottom: 0; z-index: 20; background: var(--white); padding: 14px 20px; box-shadow: 0 -2px 10px rgba(15, 23, 32, .12); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; }
  .admin-sidebar-title { display: none; }
  .admin-sidebar-links { flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar-links a { padding: 6px 10px; border-left: none; }
  .admin-sidebar-links-bottom { margin-top: 0; padding-top: 0; border-top: none; }
  .admin-sticky-actions { left: 0; padding: 10px 14px; }
}

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--blue-dark); padding: 20px; }
.login-box { background: var(--white); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }

/* --- Partneři --- */
.partner-logos { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; justify-content: center; margin-bottom: 26px; }
.partner-logos:last-child { margin-bottom: 0; }
.partner-logos a { display: block; line-height: 0; transition: transform .15s; }
.partner-logos a:hover { transform: translateY(-2px); }
.partner-logos img { background: var(--white); padding: 18px 28px; border-radius: 10px; height: 90px; width: auto; display: block; border: 1px solid var(--gray-200); box-shadow: var(--shadow); }
@media (max-width: 600px) {
  .partner-logos img { height: 64px; padding: 14px 20px; }
}

/* --- Footer --- */
.site-footer { background: var(--blue-dark); color: var(--gray-400); padding: 30px 0; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .88rem; }
.site-footer a { color: var(--gray-200); }
.site-footer a:hover { color: var(--red); }
