/*
  Tina's Rezeptwelt – Modern UI (2026)
  - Mobile-first, responsive
  - Clean cards, readable typography
  - Accessible focus styles
*/

:root{
  --bg: #0b1220;
  --bg2:#0f1a33;
  --surface: rgba(255,255,255,.08);
  --card: rgba(255,255,255,.10);
  --card-solid:#ffffff;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.72);
  --line: rgba(255,255,255,.14);
  --primary: #35b6d4;
  --primary-2: #1e7b93;
  --danger: #e74c3c;
  --success: #2ecc71;
  --shadow: 0 10px 30px rgba(0,0,0,.28);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1100px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  line-height: 1.55;
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(53,182,212,.22), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(30,123,147,.18), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

/* Optionales Hintergrundbild – wirkt wie "Wallpaper" ohne Lesbarkeit zu zerstören */
body::before{
  content:"";
  position:fixed;
  inset:0;
  background: url('images/background.jpeg') no-repeat center/cover;
  opacity:.10;
  pointer-events:none;
  filter: saturate(1.05) contrast(1.05);
}

main{ flex:1; width:100%; }

a{ color: inherit; }

/* ---------- Header / Navigation ---------- */
header{
  position:sticky;
  top:0;
  z-index:50;
  background: rgba(11,18,32,.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);

  /* WICHTIG: Header ist Flex-Container */
  display:flex;
  align-items:center;
}

/* Logo */
.avatar-logo{
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.18);
}

/* Dein HTML: <header><img class="avatar-logo"> <div class="header-content">...</div></header> */
header > .avatar-logo{
  position: static !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  margin-left: 16px;
  margin-right: 12px; /* Abstand zum Titel */
}

/* ✅ FIX: NICHT mehr zentrieren -> Titel sitzt direkt neben dem Logo */
.header-content{
  flex: 1 1 auto;
  width:auto;
  max-width: none;     /* <- wichtig */
  margin: 0;           /* <- wichtig */
  padding: 14px 16px 14px 0; /* links kommt vom Logo */
  display:flex;
  align-items:center;
  gap: 12px;
}

.header-content h1{
  margin:0;
  font-size: 1.1rem;
  letter-spacing: .2px;
  white-space: nowrap;
}

/* Nav */
.header-content nav{
  margin-left:auto;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-content nav a{
  text-decoration:none;
  color: var(--text);
  font-weight: 650;
  font-size: .92rem;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.header-content nav a:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
  transform: translateY(-1px);
}

.header-content nav a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible{
  outline: 3px solid rgba(53,182,212,.35);
  outline-offset: 2px;
}

/* Hamburger */
.hamburger{
  margin-left:auto; /* bleibt ok, weil auf Desktop display:none */
  display:none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  cursor:pointer;
  position: relative;
}
.hamburger span{
  display:block;
  height:2px;
  width:18px;
  background: rgba(255,255,255,.9);
  position:absolute;
  left:50%;
  transform: translateX(-50%);
  border-radius: 2px;
}
.hamburger span:nth-child(1){ top: 15px; }
.hamburger span:nth-child(2){ top: 21px; }
.hamburger span:nth-child(3){ top: 27px; }

/* Mobile nav */
@media (max-width: 860px){
  .hamburger{ display:inline-block; }
  .header-content nav{ display:none; width:100%; margin-left:0; }
  .header-content{ flex-wrap: wrap; padding-right:16px; }
  .header-content.open nav{
    display:flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
  }
  .header-content nav a{ width:100%; text-align:center; padding: 12px 14px; font-size: 1rem; }
  .header-content h1{ flex: 1; }
}

/* ---------- Layout / Cards ---------- */
.container{
  width: calc(100% - 32px);
  max-width: 760px;
  margin: 22px auto;
  padding: 22px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* Variante für breite Seiten (z.B. Admin) */
.container-wide{
  max-width: var(--max);
}

/* Admin Tabellen – ohne horizontales Scrollen auf Desktop */
.table-container{ width:100%; overflow-x:auto; }
.admin-table{
  width:100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.admin-table th,
.admin-table td{
  padding: 10px;
  border: 1px solid rgba(255,255,255,.14);
  vertical-align: top;
  word-break: break-word;
}
.admin-table th{ color: var(--text); background: rgba(255,255,255,.06); }

@media (max-width: 820px){
  .admin-table{ table-layout: auto; }
  .admin-table th, .admin-table td{ padding: 8px; }
}

.container h2{
  margin: 0 0 14px;
  font-size: 1.5rem;
  line-height: 1.2;
}
.container p{ color: var(--muted); margin: 0 0 12px; }

/* Hilfscontainer für breite Seiten (z.B. Rezepte-Listen) */
.page{
  width: calc(100% - 32px);
  max-width: var(--max);
  margin: 22px auto;
}

/* ---------- Forms ---------- */
form{ display:flex; flex-direction:column; gap: 12px; text-align:left; }
label{ font-weight: 650; color: var(--text); }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="file"],
textarea,
select{
  width:100%;
  padding: 12px 12px;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: var(--text);
}

textarea{ min-height: 120px; resize: vertical; }

button,
.expand-btn,
.toggle-btn,
.search-btn{
  appearance:none;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #06212a;
  background: linear-gradient(180deg, rgba(53,182,212,1), rgba(30,123,147,1));
  cursor:pointer;
  box-shadow: 0 10px 20px rgba(0,0,0,.22);
  transition: transform .12s ease, filter .12s ease;
}

button:hover,
.expand-btn:hover,
.toggle-btn:hover,
.search-btn:hover{
  transform: translateY(-1px);
  filter: brightness(1.03);
}

button:active,
.expand-btn:active,
.toggle-btn:active,
.search-btn:active{ transform: translateY(0px) scale(.99); }

/* Links als Button */
.back-link,
a.expand-btn,
a.button-link{
  display:inline-block;
  text-decoration:none;
  text-align:center;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
}

/* ---------- Messages ---------- */
.error,
.success{
  padding: 12px 14px;
  border-radius: 14px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
}
.error{ background: rgba(231,76,60,.92); }
.success{ background: rgba(46,204,113,.92); }

/* ---------- Recipe cards ---------- */
.rezept-card{
  width: 100%;
  max-width: 760px;
  margin: 14px auto;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.rezept-details{
  display:none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.rezept-details.open{ display:block; }

.rezept-card h2{ margin: 0 0 10px; font-size: 1.25rem; }
.rezept-card p{ margin: 6px 0; color: var(--muted); }

.recipe-top{
  display:flex;
  gap: 16px;
  align-items:flex-start;
}

.thumbnail{
  width: 140px;
  height: 110px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 10px 20px rgba(0,0,0,.18);
  cursor: pointer;
  transition: transform .15s ease;
}
.thumbnail:hover{ transform: scale(1.02); }

.actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.actions a{
  text-decoration:none;
  font-weight: 800;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
}

.actions a:hover{ background: rgba(255,255,255,.10); }

.like-bereich{ margin-top: 10px; }

/* Filter / Suche */
.form-container{
  text-align:center;
  width: calc(100% - 32px);
  max-width: 760px; /* gleiche Breite wie Content */
  margin: 22px auto 14px auto; /* oben wie container */
  padding: 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.12);
  backdrop-filter: blur(10px);
}
.form-container form{ margin: 0; }

.filter-select,
.search-input{
  width: min(420px, 100%);
  display:block;
  margin: 0 auto;
}

/* Pagination */
.pagination{
  width: calc(100% - 32px);
  max-width: var(--max);
  margin: 18px auto;
  padding: 10px;
  display:flex;
  justify-content:center;
  flex-wrap: wrap;
  gap: 8px;
}
.pagination a,
.pagination span{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  text-decoration:none;
  font-weight: 800;
}
.pagination .active,
.pagination span.current{ background: rgba(53,182,212,.22); border-color: rgba(53,182,212,.35); }

/* Tables (Admin) */
.table-container{
  width: 100%;
  overflow:auto;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
}

table{
  width: 100%;
  border-collapse: collapse;
  background: rgba(0,0,0,.12);
}
th,td{
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  text-align:left;
}
th{ color: var(--text); font-weight: 900; }

/* ---------- Modal ---------- */
.modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:1000;
  background: rgba(0,0,0,.75);
  justify-content:center;
  align-items:center;
}

.modal img{
  max-width: min(92vw, 980px);
  max-height: 82vh;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}

.modal .close{
  position:absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  display:grid;
  place-items:center;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color:#fff;
  font-size: 26px;
  cursor:pointer;
}

/* ---------- Social Share (kleine Leiste) ---------- */
.social-share{
  position: fixed;
  left: 14px;
  bottom: 14px;
  display:flex;
  gap: 8px;
  z-index: 60;
}
.social-share a{
  width: 42px;
  height: 42px;
  display:grid;
  place-items:center;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  text-decoration:none;
}

@media (max-width: 860px){
  .social-share{ left: 10px; bottom: 10px; }
  .social-share a{ width: 40px; height: 40px; border-radius: 12px; }
}

/* Auf Smartphones: Social-Widgets nicht als Floating-Overlay, sondern im Footer */
@media (max-width: 640px){
  .social-share{
    position: static;
    left: auto;
    bottom: auto;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 16px 6px;
    margin: 0 auto;
    width: 100%;
    max-width: var(--max);
  }
  .social-share a{
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
}

/* Admin-Link im Footer – erst nach Doppelklick sichtbar */
.admin-link{ display:none; }
.admin-link.revealed{ display:inline; }
#copyright{ cursor: pointer; }

/* ---------- Footer ---------- */
footer{
  border-top: 1px solid var(--line);
  background: rgba(11,18,32,.72);
  backdrop-filter: blur(10px);
}
footer p{
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px;
  text-align:center;
  color: var(--muted);
}
footer a{ color: var(--text); text-decoration:none; border-bottom: 1px dashed rgba(255,255,255,.35); }
footer a:hover{ border-bottom-color: rgba(53,182,212,.6); }

/* ---------- Small screens tweaks ---------- */
@media (max-width: 640px){
  .container{ width: calc(100% - 24px); padding: 18px; border-radius: 16px; }
  .rezept-card{ width: calc(100% - 24px); padding: 16px; }
  .recipe-top{ flex-direction: column; }
  .thumbnail{ width: 100%; height: auto; max-height: 240px; }
}

/* Print – keep readable */
@media print{
  body::before{ display:none !important; }
  header, footer, .social-share{ display:none !important; }
  body{ background:#fff !important; color:#000 !important; }
  .container, .rezept-card{ background:#fff !important; border: 1px solid #ddd !important; box-shadow:none !important; }
}

/* ---------- Profile ---------- */
.profile-form{
  width: calc(100% - 32px);
  max-width: 760px;
  margin: 22px auto;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  text-align: center;
}
.profile-form .avatar{
  width: 96px;
  height: 96px;
  border-radius: 24px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  margin: 0 auto 10px;
  display:block;
}
.profile-form h2{
  margin: 8px 0 4px;
  font-size: 1.2rem;
}
.profile-form p{
  margin: 4px 0;
  color: var(--muted);
}

@media (max-width: 640px){
  .social-share{ visibility: hidden; }
  .social-share.in-footer{ visibility: visible; }
}

/* =========================
   ADMIN: Mobile Tabellen -> Karten
   ========================= */
@media (max-width: 820px){

  .table-container{ overflow: visible; }

  table.admin-table thead,
  table.comments-table thead{
    display: none;
  }

  table.admin-table,
  table.admin-table tbody,
  table.admin-table tr,
  table.admin-table td,
  table.comments-table,
  table.comments-table tbody,
  table.comments-table tr,
  table.comments-table td{
    display: block;
    width: 100%;
  }

  table.admin-table tr,
  table.comments-table tr{
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.10);
    backdrop-filter: blur(10px);
  }

  table.admin-table td,
  table.comments-table td{
    border: 0 !important;
    padding: 8px 0 !important;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: flex-start;
    word-break: break-word;
  }

  table.admin-table td::before,
  table.comments-table td::before{
    content: attr(data-label);
    opacity: .75;
    font-weight: 600;
    flex: 0 0 42%;
  }

  table.admin-table td > *,
  table.comments-table td > *{
    flex: 1 1 auto;
    max-width: 58%;
  }

  .admin-actions{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
  }

  table.admin-table td select.filter-select,
  table.admin-table td button.toggle-btn{
    width: 100%;
    max-width: none;
  }
}

/* =========================
   Buttons: Like | Drucken | Kommentare gleiche Höhe
   ========================= */
.recipe-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:10px;
  flex-wrap:wrap;
}

.recipe-actions .like-button,
.recipe-actions .toggle-btn{
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 12px;
  line-height: 1;
  box-sizing: border-box;
}

.recipe-actions .like-button{
  font-size: 1rem; /* statt 14px */
}

.recipe-actions .like-button img{
  width: 18px;
  height: 18px;
  display:block;
}

.recipe-actions .like-button span{
  display:inline-block;
  font-weight: 600;
}

/* =========================================
   HEADER: Logo + Titel rechts daneben (fix)
   ========================================= */

/* Header als Flex-Container */
header{
  padding: 14px 16px !important;
  display: flex;
  align-items: center !important;
}

/* Logo */
header > .avatar-logo{
  width: 56px;
  height: 56px;
  margin: 0 12px 0 0 !important; /* Abstand zum Titel */
  flex-shrink: 0;
}

/* Container für Titel + Navigation */
.header-content{
  display: flex;
  align-items: center !important;
  flex: 1;
  gap: 12px;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
}

/* Titel exakt vertikal mittig zum Logo */
.header-content h1{
  margin: 0 !important;
  height: 56px;              /* gleiche Höhe wie Logo */
  display: flex;
  align-items: center;
  line-height: 1;
  white-space: nowrap;
}

/* Navigation ganz nach rechts */
.header-content nav{
  margin-left: auto !important;
}

/* =========================================
   FINAL FIX für DEIN HTML:
   header > .header-content > .header-left (logo + titel) + hamburger + nav
   ========================================= */

header{
  display:flex !important;
  align-items:center !important;
  padding: 14px 16px !important;
}

/* header-content ist der Haupt-Row-Container */
header .header-content{
  display:flex !important;
  align-items:center !important;
  gap: 12px !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;

  /* wichtig: kein "display: contents" */
  flex-wrap: nowrap !important;
}

/* Linksblock: Logo + Titel nebeneinander */
header .header-left{
  display:flex !important;
  align-items:center !important;
  gap: 12px !important;
  flex: 0 0 auto !important;
}

/* Logo */
header .header-left .avatar-logo{
  width: 56px !important;
  height: 56px !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
}

/* Titel: exakt mittig zur Logo-Höhe */
header .header-left h1{
  margin: 0 !important;
  height: 56px !important;       /* gleiche Höhe wie Logo */
  display:flex !important;
  align-items:center !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* Nav immer nach rechts */
header .header-content nav{
  margin-left: auto !important;
  display:flex !important;
  gap: 8px !important;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Desktop: Hamburger bleibt versteckt (wie bisher) */
header .hamburger{
  margin-left: 8px;
}

/* Mobile Verhalten sauber halten */
@media (max-width: 860px){
  header .header-content{
    flex-wrap: wrap !important;
  }

  /* Links (Logo+Titel) nimmt die Reihe */
  header .header-left{
    flex: 1 1 auto !important;
    min-width: 0;
  }

  /* Hamburger rechts */
  header .hamburger{
    display:inline-block;
    margin-left: auto;
  }

  /* Nav klappt darunter auf */
  header .header-content nav{
    display:none !important;
    width:100% !important;
    margin-left:0 !important;
  }

  header .header-content.open nav{
    display:flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
  }
}

/* =========================
   FIX: Dropdown (select) lesbar
   ========================= */

/* Select selbst */
select{
  background-color: rgba(255,255,255,.08);
  color: #ffffff;
}

/* Dropdown-Einträge */
select option{
  background-color: #ffffff; /* weißer Hintergrund */
  color: #000000;            /* schwarze Schrift */
}

/* Optional: Hover / ausgewählt */
select option:checked{
  background-color: #35b6d4;
  color: #000000;
}

/* =========================
   ADMIN / LISTEN: Action Buttons wie "Like/Drucken/Kommentare"
   ========================= */
.action-buttons{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 10px; /* optional, passt meist gut */
}

.action-btn{
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 12px;
  line-height: 1;
  box-sizing: border-box;

  text-decoration:none;
  font-weight: 700;
  font-size: 14px;

  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease, border-color .12s ease;
}

.action-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
}

.action-btn:active{
  transform: translateY(0px) scale(.99);
}

/* Edit = leicht "primary" */
.action-btn.edit{
  border-color: rgba(53,182,212,.35);
  background: rgba(53,182,212,.14);
}

/* Delete = danger */
.action-btn.delete{
  border-color: rgba(231,76,60,.45);
  background: rgba(231,76,60,.16);
}

/* Icon klein */
.action-btn i{
  font-size: 14px;
  opacity: .95;
}
