/* App shell — desktop layout mirroring mobile tabs */
@import url("./styles.css");

/* Cookie banner on auth/app pages (styles.css has full rules) */

body.app-body {
  margin: 0;
  min-height: 100vh;
  background: var(--gray-50);
}

.app-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.app-sidebar {
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.app-sidebar .brand-mini {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.5rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 0.5rem;
}

.app-sidebar .brand-mini img.wordmark {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.app-sidebar .brand-mini img.hat {
  width: 24px;
  height: 24px;
}

.app-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.app-nav-btn ion-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.app-nav-btn:hover {
  background: var(--gray-50);
}

.app-nav-btn.active {
  color: var(--red);
  background: #fee2e2;
}

.app-sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
}

.app-topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.app-topbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.topbar-btn {
  font-size: 0.8rem;
  white-space: nowrap;
}

.app-content {
  flex: 1;
  padding: 1.25rem 1.5rem 2rem;
  max-width: 1200px;
  width: 100%;
}

/* Search + filters */
.app-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.85rem;
}

.app-search input {
  flex: 1;
  border: none;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.app-search ion-icon {
  color: var(--gray-400);
  font-size: 1.1rem;
}

.filter-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}

.filter-chip {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  font-family: inherit;
}

.filter-chip.active {
  border-color: var(--red);
  background: #fee2e2;
  color: var(--red);
}

/* Cards grid */
.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.dish-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
}

.dish-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.dish-card-img {
  aspect-ratio: 4 / 3;
  background: var(--gray-100);
  position: relative;
  overflow: hidden;
}

.dish-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-card-img .lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.5rem;
}

.dish-card-img .vegan-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--green);
  color: var(--white);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.dish-card-body {
  padding: 0.65rem 0.75rem 0.75rem;
}

.dish-card-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin: 0 0 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dish-card-meta {
  font-size: 0.7rem;
  color: var(--gray-500);
  margin: 0;
}

.dish-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
}

.dish-card-price {
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--gray-900);
}

.diff-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.diff-easy {
  background: #ecfdf5;
  color: var(--green);
}
.diff-medium {
  background: #fffbeb;
  color: var(--gold);
}
.diff-hard {
  background: #fee2e2;
  color: var(--red);
}

/* Chef list */
.chef-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chef-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.chef-card-banner {
  min-height: 100%;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  background-size: cover;
  background-position: center;
}

.chef-card-body {
  padding: 0.75rem 1rem 1rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chef-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.chef-card-avatar-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
}

.chef-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.chef-stars {
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 1px;
}

/* Stream cards */
.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.stream-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.stream-card-thumb {
  aspect-ratio: 16 / 9;
  background: var(--gray-900);
  position: relative;
  overflow: hidden;
}

.stream-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.stream-live-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--red);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.stream-card-body {
  padding: 0.85rem;
}

.stream-card-body h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  background: var(--gray-50);
}

.auth-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0 0 0.35rem;
  text-align: center;
}

.auth-sub {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.35rem;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
}

.auth-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  background: var(--gray-50);
}

.auth-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.auth-role-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-role-btn {
  flex: 1;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.auth-role-btn.active-chef {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.auth-role-btn.active-learner {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.auth-footer-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.auth-footer-link a {
  color: var(--red);
  font-weight: 600;
}

/* Dish detail */
.dish-detail {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 720px;
}

.dish-detail-hero {
  aspect-ratio: 16 / 10;
  background: var(--gray-100);
}

.dish-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-detail-body {
  padding: 1.25rem;
}

.empty-state,
.loading-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}

.profile-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 400px;
}

.profile-card h2 {
  margin: 0 0 0.25rem;
}

.profile-role {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

.streams-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.streams-overline {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--red);
  text-transform: uppercase;
}

.stream-form {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.stream-form .field {
  margin-bottom: 1rem;
}

.stream-form .field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--gray-700);
}

.stream-form .field input,
.stream-form .field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font: inherit;
}

.chef-stream-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 0.85rem;
}

.chef-stream-card h3 {
  margin: 0.35rem 0 0.25rem;
  font-size: 1rem;
}

.chef-stream-desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--gray-500);
}

.chef-stream-meta {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--gray-400);
}

.chef-stream-status {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.chef-stream-status.live {
  background: #fee2e2;
  color: var(--red);
}

.chef-stream-status.sched {
  background: #fef3c7;
  color: var(--gold);
}

.chef-stream-status.ended {
  background: var(--gray-100);
  color: var(--gray-500);
}

.chef-stream-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--gray-100);
}

.chef-stream-actions .btn {
  font-size: 0.8rem;
  padding: 0.5rem 0.85rem;
}

/* Favourite toggle on dish cards */
.dish-card-wrap {
  position: relative;
}

.dish-fav-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.dish-fav-btn.active {
  color: var(--red);
}

.dish-fav-btn-lg {
  position: static;
  width: 2.5rem;
  height: 2.5rem;
}

.dish-detail-actions {
  margin-bottom: 0.75rem;
}

.booking-duration-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stream-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
}

/* Toast notifications */
.oc-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  background: var(--gray-800);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
  text-align: center;
}

.oc-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.oc-toast-success {
  background: #059669;
}

.oc-toast-error {
  background: var(--red);
}

.oc-toast-info {
  background: var(--gray-700);
}

/* Modal */
.oc-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.oc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.oc-modal-panel {
  position: relative;
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.oc-modal-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.oc-modal-body {
  margin-bottom: 1.25rem;
  line-height: 1.6;
  color: var(--gray-700);
}

.oc-modal-close {
  width: 100%;
}

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    z-index: 50;
    padding: 0.35rem;
    border-top: 1px solid var(--gray-200);
    border-right: none;
  }
  .app-sidebar .brand-mini,
  .app-sidebar-footer {
    display: none;
  }
  .app-nav-btn span.label {
    display: none;
  }
  .app-nav-btn {
    flex-direction: column;
    padding: 0.5rem;
    font-size: 0.65rem;
    justify-content: center;
  }
  .app-content {
    padding-bottom: 5rem;
  }
  .chef-card {
    grid-template-columns: 1fr;
  }
  .chef-card-banner {
    height: 80px;
  }
}
