/* Global Custom Properties & Themes */
:root {
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  /* Defaults to Dark Theme */
  --bg-primary: #090a0f;
  --bg-secondary: #131520;
  --bg-tertiary: #1d2030;
  --bg-glass: rgba(19, 21, 32, 0.75);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.07);
  --accent: #ff6b35;
  --accent-hover: #e0531f;
  --accent-light: rgba(255, 107, 53, 0.15);
  --accent-secondary: #ffb238;
  --accent-secondary-light: rgba(255, 178, 56, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px -15px rgba(0, 0, 0, 0.7);
  --glass-blur: 15px;
}

body.light-theme {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f3f5;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: rgba(15, 23, 42, 0.08);
  --accent: #ff6b35;
  --accent-hover: #e0531f;
  --accent-light: rgba(255, 107, 53, 0.1);
  --accent-secondary: #d97706;
  --accent-secondary-light: rgba(217, 119, 6, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -10px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 20px 40px -15px rgba(15, 23, 42, 0.15);
}

/* Reset & Core Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

input, button, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* Scrollbars styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Grid & Layout */
.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  position: relative;
}

@media (max-width: 992px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Navigation */
.sidebar {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

@media (max-width: 992px) {
  .sidebar {
    height: auto;
    position: relative;
    padding: 20px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

@media (max-width: 992px) {
  .brand {
    margin-bottom: 0;
  }
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.25rem;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.brand-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

@media (max-width: 992px) {
  .nav-menu {
    flex-direction: row;
    flex-grow: 0;
    gap: 15px;
  }
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

@media (max-width: 992px) {
  .nav-item span:not(.badge) {
    display: none;
  }
  .nav-item {
    padding: 10px 14px;
  }
}

.nav-item i {
  font-size: 1.2rem;
}

.nav-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--accent-light);
  color: var(--accent);
}

.nav-item .badge {
  background-color: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: auto;
}

.sidebar-footer {
  margin-top: auto;
}

@media (max-width: 992px) {
  .sidebar-footer {
    margin-top: 0;
  }
}

.theme-toggle-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

@media (max-width: 992px) {
  .theme-toggle-btn {
    width: auto;
    padding: 10px;
  }
  .theme-text {
    display: none;
  }
}

.theme-toggle-btn:hover {
  background: var(--border-color);
}

/* Main Content Area */
.main-content {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

@media (max-width: 768px) {
  .main-content {
    padding: 20px;
    gap: 24px;
  }
}

/* ─── Tab Content Switching ─── */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Header/Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

.search-bar-container {
  position: relative;
  flex-grow: 1;
  max-width: 600px;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

#search-input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
  background-color: var(--bg-tertiary);
}

.clear-search-btn {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-full);
}

.clear-search-btn:hover {
  color: var(--text-primary);
  background-color: var(--border-color);
}

.actions-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

@media (max-width: 768px) {
  .actions-container {
    justify-content: space-between;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--accent);
}

.user-info {
  display: flex;
  flex-direction: column;
}

@media (max-width: 576px) {
  .user-info {
    display: none;
  }
}

.user-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.user-rank {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Hero Spotlight Banner */
.hero-banner {
  height: 380px;
  border-radius: var(--radius-lg);
  position: relative;
  background-image: url('https://images.unsplash.com/photo-1543353071-10c8ba85a904?auto=format&fit=crop&w=1200&q=80');
  background-size: cover;
  background-position: center;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow-lg);
  animation: fadeIn var(--transition-slow) ease-out;
}

@media (max-width: 768px) {
  .hero-banner {
    height: 320px;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 10, 15, 0.95) 20%, rgba(9, 10, 15, 0.4) 60%, rgba(9, 10, 15, 0) 100%);
  z-index: 1;
}

.hero-info {
  position: relative;
  z-index: 2;
  padding: 40px;
  max-width: 750px;
}

@media (max-width: 768px) {
  .hero-info {
    padding: 24px;
  }
}

.hero-tag {
  background-color: var(--accent);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 12px;
}

.hero-title {
  font-family: var(--font-title);
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.75rem;
  }
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-meta i {
  color: var(--accent);
}

.video-badge {
  background-color: var(--accent-secondary-light);
  color: var(--accent-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Sections General */
.section-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Horizontal Categories Scroll */
.categories-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none; /* Firefox */
}

.categories-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.category-pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.category-pill:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.category-pill.active {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

/* Filters toggle buttons */
.filters-actions {
  display: flex;
  gap: 8px;
}

.filter-toggle-btn {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-toggle-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.filter-toggle-btn.active {
  background-color: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* Recipes Grid & Cards */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

@media (max-width: 576px) {
  .recipes-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.recipe-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}

.recipe-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 107, 53, 0.25);
}

.card-visuals {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.recipe-card:hover .card-image {
  transform: scale(1.08);
}

.card-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: rgba(19, 21, 32, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.favorite-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: rgba(19, 21, 32, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.favorite-btn:hover {
  transform: scale(1.1);
  background-color: var(--accent);
  color: white;
}

.favorite-btn.favorited {
  color: #ff3366;
  background-color: #ff336618;
  border-color: #ff336650;
}

.favorite-btn.favorited:hover {
  background-color: #ff3366;
  color: white;
}

.card-video-indicator {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background-color: var(--accent-secondary);
  color: #000000;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 10px rgba(255, 178, 56, 0.3);
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.card-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  margin-top: auto;
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-stat i {
  color: var(--accent);
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 500px;
  margin: 40px auto;
}

.empty-state i {
  font-size: 3rem;
  color: var(--text-muted);
}

.empty-state h3 {
  font-family: var(--font-title);
  font-size: 1.25rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Modal Core Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(9, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 50;
}

.modal-close-btn:hover {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Recipe Detail Card (Two Panes) */
.recipe-detail-card {
  max-width: 1000px;
  padding: 0;
  overflow: hidden;
}

.modal-grid-layout {
  display: grid;
  grid-template-columns: 480px 1fr;
  height: 90vh;
  max-height: 700px;
}

@media (max-width: 900px) {
  .modal-grid-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* Visual Pane (Left) */
.modal-visual-pane {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
}

@media (max-width: 900px) {
  .modal-visual-pane {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

.media-container {
  position: relative;
  height: 320px;
  background-color: #000000;
  overflow: hidden;
}

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

.video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
}

.play-btn {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  border: none;
  color: white;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.5);
  transition: all var(--transition-fast);
  padding-left: 5px; /* Visual centering play icon */
}

.play-btn:hover {
  transform: scale(1.1);
  background-color: var(--accent-hover);
}

.video-length-tag {
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.video-player-container {
  position: absolute;
  inset: 0;
  background-color: #000;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.video-wrapper {
  width: 100%;
  flex-grow: 1;
}

.video-wrapper iframe, .video-wrapper video {
  width: 100%;
  height: 100%;
  border: none;
}

.close-video-btn {
  background-color: var(--bg-secondary);
  border: none;
  border-top: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color var(--transition-fast);
}

.close-video-btn:hover {
  background-color: var(--bg-tertiary);
}

.visual-pane-footer {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex-grow: 1;
}

.pane-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-badge {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: capitalize;
}

.recipe-quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.stat-item {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 8px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-item i {
  color: var(--accent);
  font-size: 1.25rem;
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Info Pane (Right) */
.modal-info-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.detail-tab-btn {
  flex-grow: 1;
  background: none;
  border: none;
  padding: 18px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.detail-tab-btn:hover {
  color: var(--text-primary);
}

.detail-tab-btn.active {
  color: var(--accent);
}

.detail-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--accent);
}

.detail-tab-content {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
  display: none;
}

.detail-tab-content.active {
  display: block;
}

/* Servings Selector styling */
.servings-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.servings-label {
  font-weight: 700;
  font-size: 0.9rem;
}

.servings-controls {
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.servings-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.servings-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--accent);
}

.servings-number {
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0 12px;
}

.servings-helper-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Checkable Ingredients List */
.ingredients-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ingredient-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 10px 14px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.ingredient-item:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.ing-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-top: 2px;
}

.ing-checkbox::before {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.65rem;
  color: transparent;
  transition: color var(--transition-fast);
}

.ing-checkbox:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.ing-checkbox:checked::before {
  color: white;
}

.ingredient-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.ingredient-item.completed {
  border-color: var(--border-color);
  opacity: 0.5;
}

.ingredient-item.completed .ingredient-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Instructions List */
.instructions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.instruction-step {
  display: flex;
  gap: 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-md);
  position: relative;
}

.step-num-badge {
  background-color: var(--accent-light);
  color: var(--accent);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.step-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Add Recipe Form Styles */
.form-modal-card {
  max-width: 650px;
  padding: 32px;
}

@media (max-width: 576px) {
  .form-modal-card {
    padding: 20px;
  }
}

.form-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.form-header h2 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
}

.form-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.recipe-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-row {
  display: grid;
  gap: 16px;
}

.form-row.two-cols {
  grid-template-columns: 2fr 1fr;
}

.form-row.three-cols {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 576px) {
  .form-row.two-cols, .form-row.three-cols {
    grid-template-columns: 1fr;
  }
}

.form-helper {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.label-hint {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-muted);
}

/* Dynamic Rows */
.dynamic-inputs-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.ingredient-row {
  display: grid;
  grid-template-columns: 80px 100px 1fr auto;
  gap: 10px;
  align-items: center;
}

.step-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.step-row .step-number {
  font-weight: 700;
  margin-top: 12px;
}

.remove-row-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.remove-row-btn:hover {
  color: #ff3366;
  background-color: rgba(255, 51, 102, 0.1);
}

.add-input-row-btn {
  align-self: flex-start;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: 10px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
  transform: translateX(120%);
  transition: transform var(--transition-normal);
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left-color: #10b981;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast i {
  font-size: 1.1rem;
}

.toast.success i {
  color: #10b981;
}

.toast.error i {
  color: #ef4444;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes timerPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 0 20px 10px rgba(255, 107, 53, 0.2); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 53, 0); }
}

@keyframes timerAlertPulse {
  0% { background-color: var(--accent-light); }
  50% { background-color: rgba(239, 68, 68, 0.3); }
  100% { background-color: var(--accent-light); }
}

/* Inline Cooking Step Timers */
.step-timer-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  border: 1px dashed var(--accent);
  transition: all var(--transition-fast);
  user-select: none;
}

.step-timer-trigger:hover {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.step-timer-trigger i {
  font-size: 0.8rem;
}

/* Floating Timers Container */
.active-timers-container {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 320px;
  background-color: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.active-timers-container.minimized {
  width: 220px;
}

.active-timers-container.minimized .timers-body {
  display: none;
}

.timers-header {
  background-color: var(--bg-tertiary);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.timers-title {
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timers-title i {
  color: var(--accent);
  animation: fa-spin 4s infinite linear;
}

.timers-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timers-toggle-btn:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.timers-body {
  max-height: 350px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Individual Timer Card */
.timer-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: all var(--transition-normal);
}

.timer-card.completed {
  animation: timerAlertPulse 1.5s infinite ease-in-out;
  border-color: #ef4444;
}

.timer-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.timer-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
}

.timer-recipe {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timer-time-display {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--accent-secondary);
  line-height: 1;
}

.timer-card.completed .timer-time-display {
  color: #ef4444;
  animation: pulse 1s infinite alternate;
}

.timer-progress-container {
  height: 4px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.timer-progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--accent), var(--accent-secondary));
  width: 100%;
  transition: width 0.1s linear;
}

.timer-card.completed .timer-progress-bar {
  background: #ef4444;
  width: 100%;
}

.timer-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.timer-control-btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
}

.timer-control-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.timer-control-btn.delete-timer-btn:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Shopping List Tab Layout */
.shopping-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
  align-items: start;
}

@media (max-width: 576px) {
  .shopping-list-grid {
    grid-template-columns: 1fr;
  }
}

.shopping-list-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.shopping-card-header {
  background-color: var(--bg-tertiary);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.shopping-recipe-title {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.remove-recipe-shopping-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.remove-recipe-shopping-btn:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.shopping-card-body {
  padding: 20px;
}

.shopping-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 0;
  transition: opacity var(--transition-fast);
}

.shopping-item-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-muted);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.shopping-item-checkbox::before {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.6rem;
  color: transparent;
  transition: color var(--transition-fast);
}

.shopping-item-checkbox:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.shopping-item-checkbox:checked::before {
  color: white;
}

.shopping-item-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.shopping-item.completed {
  opacity: 0.5;
}

.shopping-item.completed .shopping-item-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Onboarding & Login Screen Styling */
.login-screen-overlay {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(135deg, rgba(9, 10, 15, 0.96), rgba(19, 21, 32, 0.88)), url('cooklearn_hero_banner.jpg');
  background-size: cover;
  background-position: center;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn var(--transition-slow) ease-out;
  transition: opacity var(--transition-normal) ease-out;
}

.login-glass-card {
  position: relative;
  background-color: var(--bg-glass);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--transition-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 5px; /* Border thickness */
  background: linear-gradient(90deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
  background-size: 200% auto;
  animation: rgb-border-flow 3s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes rgb-border-flow {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.logo-icon-lg {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.75rem;
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
  margin-bottom: 16px;
  animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

.login-header h2 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.avatar-selection-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.avatar-selector-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-full);
  border: 3px solid transparent;
  cursor: pointer;
  object-fit: cover;
  transition: all var(--transition-fast);
}

.avatar-selector-item:hover {
  transform: scale(1.08);
}

.avatar-selector-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-light);
  transform: scale(1.08);
}

.btn-login {
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.35);
}

/* Active Step Voice Guide Highlight */
.instruction-step.reading-now {
  border-left: 4px solid var(--accent);
  background-color: var(--accent-light);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.08);
  animation: readingPulse 2s infinite ease-in-out;
}

@keyframes readingPulse {
  0% { background-color: var(--accent-light); }
  50% { background-color: rgba(255, 107, 53, 0.25); }
  100% { background-color: var(--accent-light); }
}

.step-speak-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.step-speak-btn:hover {
  color: var(--accent);
  background-color: var(--border-color);
}

.step-speak-btn.active {
  color: var(--accent);
  animation: pulse 1s infinite alternate;
}

.password-input-wrapper input {
  padding-right: 40px !important;
}

/* --- Community Chat Room --- */
.chat-container-layout {
  display: flex;
  height: calc(100vh - 160px);
  min-height: 450px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.chat-rooms-sidebar {
  width: 240px;
  background: rgba(15, 15, 25, 0.2);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.chat-sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-channels-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 25px;
}

.chat-channel-btn {
  background: transparent;
  border: none;
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  width: 100%;
}

.chat-channel-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.chat-channel-btn.active {
  background: var(--accent-light);
  color: var(--accent);
}

.chat-channel-btn .hashtag {
  font-size: 1.1rem;
  opacity: 0.6;
}

.chat-active-chefs {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

.active-chefs-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.active-chefs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.chef-user-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chef-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.chef-status-info {
  display: flex;
  flex-direction: column;
}

.chef-name-sm {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chef-role-sm {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Chat window */
.chat-window {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
}

.chat-channel-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.chat-channel-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.online-indicator {
  font-size: 0.75rem;
  background: rgba(39, 174, 96, 0.1);
  color: #27ae60;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.chat-messages-stream {
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-msg-row {
  display: flex;
  gap: 12px;
  animation: slideUp 0.3s ease-out;
}

.chat-msg-row.self-msg {
  background: rgba(255, 51, 102, 0.03);
  border-left: 3px solid var(--accent);
  padding: 6px 12px;
  margin-left: -12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.chef-avatar-md {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.chat-msg-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.chat-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.chat-msg-username {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chat-msg-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.chat-msg-tag.moderator {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.chat-msg-tag.master {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
}

.chat-msg-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-msg-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.45;
  word-break: break-word;
}

.chat-msg-tag.flagged {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.chat-msg-row.flagged-msg {
  border-left: 3px solid #f59e0b !important;
  padding-left: 12px;
}

.chat-msg-text.flagged-text {
  color: #f59e0b;
  font-style: italic;
}

.chat-mod-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.chat-mod-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  opacity: 1;
}

/* Attached Recipe styling in chat */
.chat-attached-recipe {
  margin-top: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  max-width: 450px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.chat-attached-recipe:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.attached-recipe-img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.attached-recipe-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.attached-recipe-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.attached-recipe-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.attached-recipe-action {
  align-self: center;
  color: var(--accent);
  font-size: 1.1rem;
  padding: 8px;
}

/* Chat Input Bar */
.chat-input-form {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.01);
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 6px 12px 6px 20px;
  transition: all var(--transition-fast);
}

.chat-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

#chat-message-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.92rem;
  padding: 8px 0;
}

/* Attach recipe dropdown control */
.chat-attach-container {
  position: relative;
}

.chat-attach-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.chat-attach-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-light);
}

.auth-container {
  max-width: 400px;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5), 0 0 30px rgba(0, 255, 255, 0.3), var(--shadow-md);
  border: 2px solid cyan;
  text-align: center;
  position: relative;
  z-index: 10;
  animation: pulse-border 2s infinite alternate;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 15px rgba(0, 255, 255, 0.5), 0 0 30px rgba(0, 255, 255, 0.3); border-color: cyan; }
  100% { box-shadow: 0 0 25px rgba(0, 255, 255, 0.8), 0 0 50px rgba(0, 255, 255, 0.5); border-color: #00ffff; }
}

.chat-recipes-dropdown {
  position: absolute;
  bottom: 45px;
  right: 0;
  width: 280px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 100;
  animation: slideUp 0.2s ease-out;
}

.chat-recipes-dropdown.active {
  display: flex;
}

.chat-recipes-dropdown .dropdown-header {
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.chat-recipes-dropdown .dropdown-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.chat-recipes-dropdown .dropdown-item {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  border: none;
  background: transparent;
  width: 100%;
}

.chat-recipes-dropdown .dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

.chat-send-btn {
  background: var(--accent);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

/* Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments for Chat */
@media (max-width: 900px) {
  .chat-rooms-sidebar {
    display: none; /* Hide rooms sidebar on tablet/mobile for space */
  }
}

/* ─── Avatar Upload Zone (Login Screen) ─── */
.avatar-upload-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.avatar-upload-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
}

.avatar-upload-label:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--accent-rgb, 255, 107, 53), 0.06);
}

.avatar-upload-label i {
  font-size: 1rem;
}

.avatar-upload-label.has-photo {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--accent-rgb, 255, 107, 53), 0.08);
}

.avatar-upload-preview {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.2);
  animation: fadeIn 0.3s ease;
}

/* ─── Private Recipe Lock Badge on Cards ─── */
.private-lock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(6px);
  letter-spacing: 0.03em;
  z-index: 2;
}

.private-lock-badge i {
  font-size: 0.65rem;
  color: var(--accent);
}

/* ─── Private Recipes Tab Empty State ─── */
#tab-private .empty-state i {
  color: var(--accent);
  opacity: 0.5;
}

/* ─── Settings Tab ─── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 8px;
}

.settings-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: box-shadow 0.2s ease;
}

.settings-card:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

.settings-card-danger {
  border-color: rgba(255,51,102,0.2);
  background: rgba(255,51,102,0.03);
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.settings-card-header i {
  font-size: 1.1rem;
  color: var(--accent);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--accent-rgb, 255,107,53), 0.1);
  border-radius: 8px;
}

.settings-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.settings-profile-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.settings-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.settings-username {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.settings-email {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.settings-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.settings-input-row {
  display: flex;
  gap: 10px;
}

.settings-input-row input {
  flex: 1;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--input-bg, rgba(255,255,255,0.05));
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.settings-input-row input:focus {
  border-color: var(--accent);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.settings-theme-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-theme-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.settings-theme-btn:hover,
.settings-theme-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--accent-rgb, 255,107,53), 0.08);
}

.settings-danger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,51,102,0.3);
  background: rgba(255,51,102,0.06);
  color: #ff4d6d;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  width: fit-content;
}

.settings-danger-btn:hover {
  background: rgba(255,51,102,0.14);
  border-color: rgba(255,51,102,0.5);
  color: #ff3361;
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Private Chat Rooms & Unique Code UI ─── */
.private-modal-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.private-tab-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.private-tab-btn:hover,
.private-tab-btn.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.unique-code-generator-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

.unique-code-display {
  flex-grow: 1;
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: 800;
  color: #10b981;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.private-room-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: monospace;
}

.btn-private-share {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  font-weight: 600;
}

.btn-private-share:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #10b981;
}

.btn-private-copy,
.btn-private-post {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
}

.btn-private-copy:hover,
.btn-private-post:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

/* Interactive Private Room Invite Card inside Chat Stream */
.chat-invite-card {
  margin-top: 10px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 78, 59, 0.25));
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 480px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
  animation: fadeIn 0.3s ease;
}

.chat-invite-info h4 {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-invite-info p {
  margin: 0 0 6px 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.chat-invite-code {
  display: inline-block;
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
}

.chat-invite-join-btn {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.chat-invite-join-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
}

/* ─── Private Chat Nav Item Special Highlight ─── */
.nav-item-private-chat {
  position: relative;
}

.nav-item-private-chat.active,
.nav-item-private-chat:hover {
  color: #10b981 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  border-left: 3px solid #10b981;
}

/* ─── Private Chat Rooms Grid (Room Cards) ─── */
.private-chat-rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.private-room-card {
  background: var(--card-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.private-room-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #10b981, #059669);
}

.private-room-card:hover {
  border-color: #10b981;
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.18);
}

.private-room-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.private-room-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #10b981;
  font-size: 1.1rem;
}

.private-room-info {
  flex: 1;
}

.private-room-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 3px 0;
}

.private-room-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.private-room-code-pill {
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 1px;
}

.private-room-card-actions {
  display: flex;
  gap: 8px;
}

.private-room-card-actions .btn {
  flex: 1;
  font-size: 0.8rem;
  padding: 7px 10px;
}

/* ─── Private Chat Modal Layout & Polish ─── */
.private-modal-card {
  max-width: 640px !important;
  width: 92% !important;
  padding: 38px 44px !important;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

.private-modal-card .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-right: 50px;
}

.private-modal-card .modal-close-btn {
  top: 24px;
  right: 26px;
}

.private-modal-tabs {
  display: flex;
  gap: 14px;
  margin: 8px 0 16px 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.private-modal-tabs .private-tab-btn {
  flex: 1;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.private-modal-tabs .private-tab-btn.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: #10b981;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
}

.private-modal-card .form-group {
  margin-bottom: 22px;
}

.private-modal-card label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.private-modal-card input[type="text"] {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.private-modal-card input[type="text"]:focus {
  border-color: #10b981;
  outline: none;
}

.unique-code-generator-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-top: 6px;
}

.unique-code-display {
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 2px;
}

.private-modal-card .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border-color);
}

.private-modal-card .form-actions .btn {
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
}

@media (max-width: 600px) {
  .private-modal-card {
    padding: 24px 20px !important;
  }
}

/* Custom Toggle Switch for Settings 2FA */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-color);
  transition: .4s;
  border-radius: 34px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background-color: #10b981;
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Authentication Toggle Modes */
.login-mode .register-field {
  display: none !important;
}
