/* -------------------------------------------------------
   Renés Kochbuch – App Styles (Light/Dark via data-bs-theme)
-------------------------------------------------------- */

:root{
  --font-head: "Playfair Display", serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* Brand palette (light) */
  --kb-bg: #faf7f2;
  --kb-header: #1f3d2b;   /* deep green */
  --kb-accent: #c97b63;   /* terracotta */
  --kb-text: #2a2a2a;
  --kb-muted: #6b6b6b;
  --kb-footer: #eee7dd;
}

/* Bootstrap 5.3 theme hook */
html[data-bs-theme="dark"]{
  /* Brand palette (dark) */
  --kb-bg: #0f1412;
  --kb-header: #0d2117;
  --kb-accent: #d38b73;
  --kb-text: #e8e6e1;
  --kb-muted: #b7b3aa;
  --kb-footer: #111815;
}

body{
  background: var(--kb-bg);
  color: var(--kb-text);
  font-family: var(--font-body);
}

/* Header / Navbar */
.app-navbar{
  background: var(--kb-header);
}

.app-brand{
  font-family: var(--font-head);
  font-size: 1.4rem;
  letter-spacing: 0.5px;
}

.app-brand span{
  color: var(--kb-accent);
}

/* Navbar links */
.navbar .nav-link{
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}

.navbar .nav-link:hover,
.navbar .nav-link.active{
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Main area */
.app-main{
  min-height: 70vh;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* Footer */
.app-footer{
  background: var(--kb-footer);
  color: var(--kb-muted);
  font-size: 0.9rem;
}

.app-footer a{
  color: var(--kb-muted);
  text-decoration: none;
}

.app-footer a:hover{
  color: var(--kb-text);
  text-decoration: underline;
}

/* Theme toggle */
.app-theme-toggle{
  color: rgba(255,255,255,0.9);
}

.app-theme-icon{
  font-size: 1rem;
  line-height: 1;
  user-select: none;
}

/* Make the switch look nicer on dark navbar */
.form-switch .form-check-input{
  cursor: pointer;
}

/* Optional: cards a bit more "cookbook" */
.card{
  border-radius: 14px;
}

html[data-bs-theme="dark"] .card{
  background-color: #141b18;
  border-color: rgba(255,255,255,0.08);
}


/* -------------------------------------------------------
   Home / Hero / Featured / Buttons
-------------------------------------------------------- */

.btn-accent{
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--kb-accent);
  --bs-btn-border-color: var(--kb-accent);
  --bs-btn-hover-bg: rgba(201,123,99,0.9);
  --bs-btn-hover-border-color: rgba(201,123,99,0.9);
  --bs-btn-active-bg: rgba(201,123,99,0.85);
  --bs-btn-active-border-color: rgba(201,123,99,0.85);
}

.btn-soft{
  background: rgba(201,123,99,0.14);
  border: 1px solid rgba(201,123,99,0.24);
  color: var(--kb-text);
  border-radius: 999px;
  padding: .45rem .85rem;
}

html[data-bs-theme="dark"] .btn-soft{
  background: rgba(211,139,115,0.12);
  border-color: rgba(211,139,115,0.22);
}

.btn-soft:hover{
  filter: brightness(0.98);
}

.kb-section-title{
  font-family: var(--font-head);
  letter-spacing: .2px;
}

/* Hero */
.kb-hero{
  border-radius: 18px;
  position: relative;
  background: transparent;
}

.kb-hero-bg{
  position: absolute;
  inset: 0;
  background-image:
    url("https://images.unsplash.com/photo-1543353071-873f17a7a088?auto=format&fit=crop&w=1600&q=70");
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.kb-hero-overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(10, 18, 14, 0.88) 0%,
    rgba(10, 18, 14, 0.68) 55%,
    rgba(10, 18, 14, 0.40) 100%
  );
}

html[data-bs-theme="dark"] .kb-hero-overlay{
  background: linear-gradient(
    90deg,
    rgba(0,0,0,0.82) 0%,
    rgba(0,0,0,0.66) 55%,
    rgba(0,0,0,0.35) 100%
  );
}

.kb-hero-content{
  position: relative;
  padding: 2.2rem 1.4rem;
}

@media (min-width: 992px){
  .kb-hero-content{ padding: 2.8rem 2.2rem; }
}

.kb-hero-title{
  font-family: var(--font-head);
  color: #fff;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.15;
}

.kb-hero-title span{
  color: var(--kb-accent);
}

.kb-hero-sub{
  color: rgba(255,255,255,0.86);
  font-size: 1.05rem;
  max-width: 52ch;
}

/* Search */
.kb-search .input-group-text{
  border: 0;
  background: rgba(255,255,255,0.96);
}

.kb-search-input{
  border: 0;
  background: rgba(255,255,255,0.96);
}

.kb-search .btn-accent{
  border: 0;
}

.kb-search .input-group{
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,0.20);
}

.kb-search-icon{
  font-size: 1.05rem;
}

/* Hero side panel */
.kb-hero-panel{
  border-radius: 18px;
  background: rgba(250,247,242,0.92);
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
}

html[data-bs-theme="dark"] .kb-hero-panel{
  background: rgba(20, 27, 24, 0.92);
  border: 1px solid rgba(255,255,255,0.10);
}

.kb-panel-title{
  font-family: var(--font-head);
  font-size: 1.25rem;
}

.kb-badge{
  border-radius: 999px;
}

/* Metrics */
.kb-metric{
  padding: .6rem .4rem;
  border-radius: 14px;
  background: rgba(201,123,99,0.10);
  border: 1px solid rgba(201,123,99,0.18);
}

html[data-bs-theme="dark"] .kb-metric{
  background: rgba(211,139,115,0.10);
  border-color: rgba(211,139,115,0.20);
}

.kb-metric-number{
  font-weight: 700;
  font-size: 1.05rem;
}

.kb-metric-label{
  font-size: .85rem;
  color: var(--kb-muted);
}

/* Featured recipe cards */
.kb-recipe-card{
  border-radius: 18px;
  position: relative;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
  transition: transform .15s ease, box-shadow .15s ease;
}

.kb-recipe-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(0,0,0,0.14);
}

.kb-recipe-img{
  height: 210px;
  background-size: cover;
  background-position: center;
}

.kb-recipe-overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 35%, rgba(0,0,0,0.70) 100%);
}

.kb-recipe-body{
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem 1rem 1.1rem 1rem;
}

.kb-recipe-title{
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.35rem;
}

.kb-meta{
  font-size: .85rem;
  color: rgba(255,255,255,0.88);
}

.kb-tag{
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .25rem .75rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  background: rgba(201,123,99,0.92);
  color: #fff !important;
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}

.kb-tag:hover{
  background: rgba(201,123,99,1);
  color: #fff;
  transform: translateY(-1px);
}

html[data-bs-theme="dark"] .kb-tag{
  background: rgba(201,123,99,0.65);
  color: #fff !important;
}

html[data-bs-theme="dark"] .kb-tag:hover{
  background: rgba(201,123,99,0.8);
}

/* Feature cards */
.kb-feature{
  border-radius: 18px;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

html[data-bs-theme="dark"] .kb-feature{
  background: rgba(20, 27, 24, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
}

.kb-feature-icon{
  font-size: 1.6rem;
  margin-bottom: .4rem;
}

.kb-feature-title{
  font-family: var(--font-head);
  font-size: 1.25rem;
}

/* -------------------------------------------------------
   Recipes page
-------------------------------------------------------- */

.kb-page-title{
  font-family: var(--font-head);
  letter-spacing: .2px;
}

.kb-toolbar{
  border-radius: 18px;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

html[data-bs-theme="dark"] .kb-toolbar{
  background: rgba(20, 27, 24, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
}

.btn-soft.active{
  outline: 2px solid rgba(201,123,99,0.35);
}

/* Tile cards */
.kb-tile{
  border-radius: 18px;
  position: relative;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
  transition: transform .15s ease, box-shadow .15s ease;
}

.kb-tile:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(0,0,0,0.14);
}

.kb-tile-img{
  height: 210px;
  background-size: cover;
  background-position: center;
}

.kb-tile-overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.06) 35%, rgba(0,0,0,0.72) 100%);
}

.kb-tile-body{
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem 1rem 1.1rem 1rem;
}

.kb-tile-desc{
  color: rgba(255,255,255,0.85);
  font-size: .95rem;
  max-width: 54ch;
}

/* List view */
.kb-list{
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.kb-list-item{
  padding: 1rem;
  background: rgba(255,255,255,0.75);
}

html[data-bs-theme="dark"] .kb-list-item{
  background: rgba(20, 27, 24, 0.85);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.kb-thumb{
  width: 100%;
  height: 110px;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
}

.kb-card-title{
  font-family: var(--font-head);
}

.kb-mini-meta{
  color: var(--kb-muted);
  font-size: .9rem;
  display: flex;
  gap: .5rem;
  align-items: center;
  white-space: nowrap;
}

.kb-pill{
  border-radius: 999px;
  background: rgba(201,123,99,0.14);
  border: 1px solid rgba(201,123,99,0.22);
  color: var(--kb-text);
  font-weight: 500;
}

html[data-bs-theme="dark"] .kb-pill{
  background: rgba(211,139,115,0.12);
  border-color: rgba(211,139,115,0.22);
}


/* -------------------------------------------------------
   Recipe detail page
-------------------------------------------------------- */

.kb-back-link{
  color: rgba(255,255,255,0.86);
  text-decoration: none;
  display: inline-block;
  margin-bottom: .4rem;
}
.kb-back-link:hover{
  text-decoration: underline;
}

.kb-recipe-hero{
  border-radius: 18px;
  position: relative;
  background: transparent;
}

.kb-recipe-hero-bg{
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.kb-recipe-hero-overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(10, 18, 14, 0.88) 0%,
    rgba(10, 18, 14, 0.62) 55%,
    rgba(10, 18, 14, 0.38) 100%
  );
}

html[data-bs-theme="dark"] .kb-recipe-hero-overlay{
  background: linear-gradient(
    90deg,
    rgba(0,0,0,0.82) 0%,
    rgba(0,0,0,0.62) 55%,
    rgba(0,0,0,0.34) 100%
  );
}

.kb-recipe-hero-content{
  position: relative;
  padding: 2.2rem 1.4rem;
}

@media (min-width: 992px){
  .kb-recipe-hero-content{ padding: 2.8rem 2.2rem; }
}

.kb-recipe-h1{
  font-family: var(--font-head);
  color: #fff;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.12;
}

.kb-recipe-lead{
  color: rgba(255,255,255,0.86);
  max-width: 70ch;
}

/* Meta row */
.kb-recipe-meta-row{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .75rem;
}
@media (min-width: 992px){
  .kb-recipe-meta-row{ grid-template-columns: repeat(5, minmax(0,1fr)); }
}

.kb-meta-card{
  border-radius: 16px;
  padding: .75rem .85rem;
  background: rgba(250,247,242,0.92);
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
}
html[data-bs-theme="dark"] .kb-meta-card{
  background: rgba(20, 27, 24, 0.92);
  border: 1px solid rgba(255,255,255,0.10);
}

.kb-meta-label{
  font-size: .78rem;
  color: var(--kb-muted);
}
.kb-meta-value{
  font-weight: 700;
}

/* Panels */
.kb-panel{
  border-radius: 18px;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
html[data-bs-theme="dark"] .kb-panel{
  background: rgba(20, 27, 24, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
}

.kb-h2{
  font-family: var(--font-head);
  letter-spacing: .2px;
  font-size: 1.4rem;
}

/* Ingredients */
.kb-servings{
  width: 84px;
  border-radius: 12px;
}

.kb-ingredients .list-group-item{
  background: transparent;
}

.kb-qty{
  min-width: 92px;
  text-align: right;
  padding-top: .1rem;
}

.kb-qty-num{
  font-weight: 800;
  font-size: 1.05rem;
}

.kb-qty-unit{
  color: var(--kb-muted);
  margin-left: .15rem;
}

/* Steps */
.kb-steps{
  margin: 0;
  padding-left: 1.1rem;
}

.kb-step{
  padding: .7rem .5rem;
  border-radius: 14px;
  margin-bottom: .6rem;
  background: rgba(201,123,99,0.10);
  border: 1px solid rgba(201,123,99,0.18);
}
html[data-bs-theme="dark"] .kb-step{
  background: rgba(211,139,115,0.10);
  border-color: rgba(211,139,115,0.20);
}

.kb-step-top{
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.kb-step-text{
  flex: 1;
}

/* Import box */
.kb-import-box{
  border-radius: 16px;
  padding: .85rem;
  background: rgba(201,123,99,0.10);
  border: 1px solid rgba(201,123,99,0.18);
}
html[data-bs-theme="dark"] .kb-import-box{
  background: rgba(211,139,115,0.10);
  border-color: rgba(211,139,115,0.20);
}

/* Cookmode callout */
.kb-callout{
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255,255,255,0.70);
  border: 1px solid rgba(0,0,0,0.06);
}
html[data-bs-theme="dark"] .kb-callout{
  background: rgba(0,0,0,0.20);
  border-color: rgba(255,255,255,0.08);
}

/* Cook logs */
.kb-logs{
  display: grid;
  gap: .75rem;
}

.kb-log{
  border-radius: 16px;
  padding: .85rem;
  background: rgba(0,0,0,0.03);
}
html[data-bs-theme="dark"] .kb-log{
  background: rgba(255,255,255,0.05);
}

.kb-log-date{
  font-weight: 700;
}

@media print{
  nav, footer, .btn, .kb-callout { display:none !important; }
  body{ background:#fff !important; }
  .card{ box-shadow:none !important; }
}


/* -------------------------------------------------------
   Cook mode
-------------------------------------------------------- */

.kb-cook-topbar{
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

html[data-bs-theme="dark"] .kb-cook-topbar{
  background: rgba(20, 27, 24, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
}

.kb-cook-title{
  font-family: var(--font-head);
  font-size: 1.15rem;
  color: var(--kb-text);
}

.kb-progress{
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  overflow: hidden;
}

html[data-bs-theme="dark"] .kb-progress{
  background: rgba(255,255,255,0.08);
}

.kb-progress-bar{
  height: 100%;
  width: 0%;
  background: var(--kb-accent);
  border-radius: 999px;
  transition: width .2s ease;
}

/* switches on toolbar */
.kb-switch .form-check-input{
  cursor: pointer;
}

/* stage */
.kb-cook-stage{
  border-radius: 18px;
}

.kb-cook-step-title{
  font-family: var(--font-head);
  font-size: 1.6rem;
  letter-spacing: .2px;
}

.kb-cook-step-text{
  font-size: 1.15rem;
  line-height: 1.5;
  padding: .9rem 1rem;
  border-radius: 16px;
  background: rgba(201,123,99,0.10);
  border: 1px solid rgba(201,123,99,0.18);
}

html[data-bs-theme="dark"] .kb-cook-step-text{
  background: rgba(211,139,115,0.10);
  border-color: rgba(211,139,115,0.20);
}

.kb-cook-nav{
  border-radius: 16px;
}

/* mise-en-place */
.kb-mise{
  border-radius: 16px;
  padding: .85rem 1rem;
  background: rgba(0,0,0,0.03);
}

html[data-bs-theme="dark"] .kb-mise{
  background: rgba(255,255,255,0.05);
}

/* Timers */
.kb-timers{
  display: grid;
  gap: .75rem;
}

.kb-timer{
  border-radius: 16px;
  padding: .9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.03);
}

html[data-bs-theme="dark"] .kb-timer{
  background: rgba(255,255,255,0.05);
}

.kb-timer-label{
  font-weight: 700;
}

.kb-timer-time{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--kb-muted);
  margin-top: .2rem;
}

.kb-timer-done{
  outline: 2px solid rgba(201,123,99,0.35);
}

.kb-timer-actions{
  display: flex;
  gap: .5rem;
}


/* -------------------------------------------------------
   Import page
-------------------------------------------------------- */

.kb-pills .nav-link{
  border-radius: 999px;
  background: rgba(201,123,99,0.10);
  border: 1px solid rgba(201,123,99,0.18);
  color: var(--kb-text);
  font-weight: 600;
}

html[data-bs-theme="dark"] .kb-pills .nav-link{
  background: rgba(211,139,115,0.10);
  border-color: rgba(211,139,115,0.20);
}

.kb-pills .nav-link.active{
  background: var(--kb-accent);
  border-color: var(--kb-accent);
  color: #fff;
}

.kb-raw-text{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .92rem;
  border-radius: 16px;
}

.kb-raw-ref{
  border-radius: 14px;
  padding: .6rem .75rem;
  background: rgba(0,0,0,0.03);
}
html[data-bs-theme="dark"] .kb-raw-ref{
  background: rgba(255,255,255,0.05);
}

.kb-field{
  margin-bottom: .9rem;
}

.kb-subsection{
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: .9rem;
}

html[data-bs-theme="dark"] .kb-subsection{
  border-top-color: rgba(255,255,255,0.10);
}

.kb-h3{
  font-family: var(--font-head);
  letter-spacing: .2px;
  font-size: 1.15rem;
}

.kb-row .form-control,
.kb-row .form-select{
  border-radius: 14px;
}

.kb-hr{
  border: none;
  border-top: 1px dashed rgba(0,0,0,0.18);
  margin: 1rem 0 0.2rem;
}

html[data-bs-theme="dark"] .kb-hr{
  border-top-color: rgba(255,255,255,0.18);
}

.kb-modal{
  border-radius: 18px;
}

/* Editor tweaks */
.kb-panel .form-control,
.kb-panel .form-select{
  border-radius: 14px;
}
