@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&family=DM+Sans:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:  #111;
  --accent2: #555;
  --bg:      #f5f5f5;
  --card:    #fff;
  --border:  #e2e2e2;
  --text:    #111;
  --text2:   #555;
  --text3:   #999;
  --radius:  8px;
  --blue:    #2563eb;
  --red:     #dc2626;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: 'Sora', sans-serif; font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.05rem; }
p  { color: var(--text2); line-height: 1.7; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 60px 0; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 99px; }

/* navbar */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex; align-items: center;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.05rem;
  text-decoration: none; color: var(--text);
}
.nav-logo-icon {
  width: 30px; height: 30px;
  background: var(--text); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.nav-logo span { color: var(--text2); font-weight: 400; font-size: .95rem; }

.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-links a {
  display: block; padding: 6px 12px; border-radius: 6px;
  text-decoration: none; font-size: .88rem; color: var(--text2);
  transition: background .12s, color .12s;
}
.nav-links a:hover { background: var(--bg); color: var(--text); }
.nav-links a.active { background: var(--bg); color: var(--text); font-weight: 500; }

.nav-mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger { display: flex; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* tlačítka */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: .92rem; font-weight: 500;
  text-decoration: none; border: none; cursor: pointer;
  transition: opacity .12s, transform .12s;
  white-space: nowrap;
}
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { opacity: .8; transform: translateY(-1px); }
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text2); }
.btn-ghost { background: none; color: var(--text2); padding: 10px 4px; }
.btn-ghost:hover { color: var(--text); }

/* section header */
.section-header { text-align: center; max-width: 500px; margin: 0 auto 40px; }
.section-tag {
  display: inline-block;
  border: 1px solid var(--border); color: var(--text3);
  font-size: .7rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  padding: 3px 11px; border-radius: 99px; margin-bottom: 10px;
}
.section-header h2 { margin-bottom: 6px; }
.section-header p { color: var(--text3); font-size: .92rem; }

/* kalkulačka */
.calculator-section { background: var(--card); border-bottom: 1px solid var(--border); }
.calc-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }

.calc-form-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.calc-form-card h2 { font-size: 1.15rem; margin-bottom: 3px; }
.calc-form-card .subtitle { font-size: .85rem; color: var(--text3); margin-bottom: 20px; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .82rem; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.form-label span { color: var(--text3); font-weight: 400; }

.form-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: .92rem; color: var(--text);
  background: var(--card); outline: none; transition: border-color .12s;
}
.form-input:focus { border-color: var(--text); }
.form-input option { background: #fff; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.gender-toggle { display: flex; gap: 7px; }
.gender-btn {
  flex: 1; padding: 8px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--text2);
  font-family: 'DM Sans', sans-serif; font-size: .86rem; font-weight: 500;
  cursor: pointer; transition: all .12s;
}
.gender-btn:hover { border-color: var(--text2); }
.gender-btn.active { border-color: var(--text); background: var(--text); color: #fff; }

.goal-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.goal-btn {
  padding: 8px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--text2);
  font-family: 'DM Sans', sans-serif; font-size: .82rem; font-weight: 500;
  cursor: pointer; transition: all .12s; text-align: center;
}
.goal-btn:hover { border-color: var(--text2); }
.goal-btn.active { border-color: var(--text); background: var(--text); color: #fff; }

.activity-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer;
}

.divider { height: 1px; background: var(--border); margin: 16px 0; }
.form-section-title { font-size: .75rem; font-weight: 600; color: var(--text3); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
.calc-btn { width: 100%; padding: 12px; font-size: .95rem; border-radius: var(--radius); margin-top: 4px; justify-content: center; }

/* výsledky */
.results-panel { display: flex; flex-direction: column; gap: 12px; }
.results-placeholder {
  background: var(--bg); border: 1.5px dashed var(--border);
  border-radius: var(--radius); padding: 44px 24px; text-align: center;
}
.results-placeholder-icon { font-size: 2.2rem; margin-bottom: 10px; opacity: .35; }
.results-placeholder p { font-size: .86rem; color: var(--text3); }

.result-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
}
.result-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.result-card-header h3 { font-size: .92rem; }
.result-badge { font-size: .71rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-orange { background: #fff7ed; color: #c2410c; }
.badge-blue   { background: #eff6ff; color: #1d4ed8; }

.bmi-gauge { margin-bottom: 10px; }
.bmi-gauge-bar { height: 7px; border-radius: 99px; background: linear-gradient(90deg, #60a5fa, #34d399, #fbbf24, #f87171); margin-bottom: 5px; position: relative; }
.bmi-gauge-marker { position: absolute; top: -4px; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 2px solid #111; transform: translateX(-50%); box-shadow: 0 1px 4px rgba(0,0,0,.15); left: 62%; transition: left .5s; }
.bmi-gauge-labels { display: flex; justify-content: space-between; font-size: .67rem; color: var(--text3); }
.bmi-result-num { font-family: 'Sora', sans-serif; font-size: 2rem; font-weight: 700; }

.kcal-breakdown { display: flex; flex-direction: column; gap: 7px; }
.kcal-item { display: flex; align-items: center; justify-content: space-between; }
.kcal-item-label { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--text2); }
.kcal-dot { width: 7px; height: 7px; border-radius: 50%; }
.kcal-item-val { font-family: 'Sora', sans-serif; font-size: .9rem; font-weight: 600; }
.kcal-bar-wrap { height: 4px; background: var(--border); border-radius: 99px; margin: 2px 0 6px; overflow: hidden; }
.kcal-bar-inner { height: 100%; border-radius: 99px; }
.fill-green  { background: #111; }
.fill-orange { background: #ea580c; }
.fill-blue   { background: #2563eb; }

.go-to-plan-btn { width: 100%; justify-content: center; padding: 12px; border-radius: var(--radius); }

/* recepty */
.recipes-section { background: var(--bg); }

.recipe-search-wrap { display: flex; gap: 8px; margin-bottom: 22px; }
.recipe-search-input { flex: 1; }
.recipe-search-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.recipe-search-title { font-size: .9rem; color: var(--text2); }
.recipe-search-divider { height: 1px; background: var(--border); margin: 24px 0 20px; }
.recipe-local-label { font-size: .7rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }

.recipes-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 28px; }
.filter-btn {
  padding: 6px 14px; border-radius: 99px;
  border: 1.5px solid var(--border); background: var(--card);
  font-family: 'DM Sans', sans-serif; font-size: .82rem; font-weight: 500; color: var(--text2);
  cursor: pointer; transition: all .12s;
}
.filter-btn:hover { border-color: var(--text2); color: var(--text); }
.filter-btn.active { border-color: var(--text); background: var(--text); color: #fff; }

.recipes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }

.recipe-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: box-shadow .12s, transform .12s;
}
.recipe-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.09); transform: translateY(-2px); }

.recipe-img-wrap { position: relative; height: 150px; overflow: hidden; background: var(--bg); }
.recipe-img { width: 100%; height: 100%; object-fit: cover; }
.recipe-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; }
.recipe-fav-btn {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.9); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.recipe-fav-btn.active { background: #fee2e2; }
.recipe-kcal-tag {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 99px;
}
.api-tag { background: rgba(37,99,235,.75) !important; }

.recipe-body { padding: 12px; }
.recipe-category { font-size: .68rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.recipe-title { font-size: .88rem; font-weight: 600; margin-bottom: 7px; line-height: 1.3; color: var(--text); }
.recipe-meta { display: flex; align-items: center; justify-content: space-between; }
.recipe-tags { display: flex; gap: 3px; flex-wrap: wrap; }
.recipe-tag { font-size: .66rem; padding: 2px 6px; border-radius: 99px; background: var(--bg); color: var(--text3); border: 1px solid var(--border); }
.recipe-arrow { font-size: .78rem; color: var(--text3); transition: color .12s; }
.recipe-card:hover .recipe-arrow { color: var(--text); }

/* jídelníček */
.plan-section { background: var(--card); border-top: 1px solid var(--border); }
.plan-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-bottom: 22px; }
.plan-day-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--bg);
  cursor: pointer; transition: all .12s; font-family: 'DM Sans', sans-serif;
}
.plan-day-btn:hover { border-color: var(--text2); }
.plan-day-btn.active { border-color: var(--text); background: var(--text); }
.plan-day-name { font-size: .66rem; font-weight: 600; color: var(--text3); text-transform: uppercase; }
.plan-day-btn.active .plan-day-name { color: rgba(255,255,255,.6); }
.plan-day-num { font-family: 'Sora', sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.plan-day-btn.active .plan-day-num { color: #fff; }

.plan-content { display: grid; grid-template-columns: 1fr 270px; gap: 18px; }
.plan-meals { display: flex; flex-direction: column; gap: 10px; }

.meal-slot {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
}
.meal-slot-header { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.meal-slot-icon { font-size: 1rem; }
.meal-slot-name { font-size: .74rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.meal-slot-kcal { margin-left: auto; font-size: .76rem; color: var(--text2); font-weight: 500; }

.meal-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
}
.meal-item-img { width: 42px; height: 42px; border-radius: 6px; background: var(--bg); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.meal-item-info { flex: 1; }
.meal-item-title { font-size: .86rem; font-weight: 600; margin-bottom: 2px; color: var(--text); }
.meal-item-desc  { font-size: .73rem; color: var(--text3); }
.meal-item-kcal  { font-family: 'Sora', sans-serif; font-size: .88rem; font-weight: 600; color: var(--text2); white-space: nowrap; }

.meal-swap-btn {
  flex-shrink: 0; margin-left: 6px;
  background: none; border: 1.5px solid var(--border); border-radius: 6px;
  padding: 4px 8px; font-size: .72rem; color: var(--text3); cursor: pointer;
  transition: border-color .12s, color .12s; white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
}
.meal-swap-btn:hover { border-color: var(--text2); color: var(--text); }
.swap-count { font-weight: 600; }

.plan-sidebar { display: flex; flex-direction: column; gap: 12px; }
.plan-summary-card { background: var(--text); color: #fff; border-radius: var(--radius); padding: 18px; }
.plan-summary-card h3 { font-size: .82rem; opacity: .55; margin-bottom: 3px; font-family: 'DM Sans', sans-serif; font-weight: 500; }
.plan-total-kcal { font-family: 'Sora', sans-serif; font-size: 1.9rem; font-weight: 700; }
.plan-total-label { font-size: .75rem; opacity: .5; margin-bottom: 14px; }
.plan-macros { display: flex; flex-direction: column; gap: 7px; }
.plan-macro { display: flex; align-items: center; justify-content: space-between; }
.plan-macro-label { font-size: .78rem; opacity: .65; }
.plan-macro-bar { flex: 1; height: 3px; background: rgba(255,255,255,.2); border-radius: 99px; margin: 0 8px; overflow: hidden; }
.plan-macro-fill { height: 100%; border-radius: 99px; background: rgba(255,255,255,.6); }
.plan-macro-val { font-size: .78rem; font-weight: 600; }

.plan-progress-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.plan-progress-card h3 { font-size: .88rem; margin-bottom: 12px; }
.progress-item { margin-bottom: 10px; }
.progress-item-header { display: flex; justify-content: space-between; font-size: .78rem; color: var(--text2); margin-bottom: 4px; }
.progress-bar { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width .4s; }

/* footer */
.footer { background: var(--card); padding: 18px 0; border-top: 1px solid var(--border); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--text3); }
.footer-bottom a { color: var(--text3); text-decoration: none; }
.footer-bottom a:hover { color: var(--text); }

/* loading */
.recipes-loading { grid-column: 1 / -1; text-align: center; padding: 44px 0; color: var(--text3); font-size: .88rem; }
.recipes-loading::after {
  content: ''; display: block; width: 28px; height: 28px;
  border: 2px solid var(--border); border-top-color: var(--text2);
  border-radius: 50%; margin: 12px auto 0; animation: spin .7s linear infinite;
}

/* notifikace */
.notification {
  position: fixed; bottom: 18px; right: 18px; z-index: 1000;
  padding: 10px 16px; border-radius: var(--radius);
  font-size: .84rem; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  animation: slideIn .2s ease; max-width: 270px;
}
.notification-success { background: #111; color: #fff; }
.notification-error   { background: #dc2626; color: #fff; }

/* modal */
.recipe-modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .15s;
}
.recipe-modal-box {
  background: var(--card); border-radius: var(--radius);
  max-width: 540px; width: 100%; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.15);
}
.recipe-modal-body { padding: 20px; }
.recipe-modal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.recipe-modal-title { font-size: 1.15rem; line-height: 1.25; }
.recipe-modal-close {
  background: var(--bg); border: 1px solid var(--border); border-radius: 50%;
  width: 30px; height: 30px; cursor: pointer; font-size: .85rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.recipe-modal-close:hover { background: var(--border); }
.recipe-modal-label { font-size: .72rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.recipe-modal-tags { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin-bottom: 14px; }
.recipe-modal-tags li { background: var(--bg); border: 1px solid var(--border); border-radius: 99px; padding: 3px 9px; font-size: .76rem; color: var(--text2); }
.recipe-modal-text { font-size: .84rem; color: var(--text2); line-height: 1.75; white-space: pre-line; }

/* animace */
@keyframes fadeSlideIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideIn     { from { opacity:0; transform:translateX(14px); } to { opacity:1; transform:translateX(0); } }
@keyframes fadeIn      { from { opacity:0; } to { opacity:1; } }
@keyframes spin        { to { transform: rotate(360deg); } }

/* responzivita */
@media (max-width: 1024px) {
  .calc-layout  { grid-template-columns: 1fr; }
  .recipes-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-content { grid-template-columns: 1fr; }
  .plan-sidebar { flex-direction: row; }
  .plan-summary-card, .plan-progress-card { flex: 1; }
}

@media (max-width: 768px) {
  .section { padding: 40px 0; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--card); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 8px; gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-mobile-toggle { display: block; }
  .recipes-grid { grid-template-columns: 1fr; }
  .recipe-search-wrap { flex-direction: column; }
  .plan-days { grid-template-columns: repeat(4, 1fr); }
  .plan-sidebar { flex-direction: column; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .plan-days { grid-template-columns: repeat(4, 1fr); }
}
