  /* --- DESIGN VARIABLE PALETTE --- */
    :root {
        --bg-main: #FFF8F6;
        --primary: #8a1538;
        --primary-hover: #610e26;
        --text-main: #2b1815;
        --text-muted: #7c6864;
        --border-soft: rgba(138, 21, 56, 0.12);
        
        /* Category Card Soft Palette */
        --card-bg: #FFF5F4;
        --card-bg-hover: #FFEBEB;
        --card-border: #FCDEDE;
        
        --font-heading: 'Playfair Display', serif;
        --font-body: 'Poppins', sans-serif;
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: var(--font-body);
    }

    body {
      background-color: var(--bg-main);
      background: url('bg-cooking.jpg') no-repeat center center fixed;
      background-size: cover;
      color: var(--text-main);
      padding-top: 115px;
      scroll-behavior: smooth;
    }

    .main-content {
      max-width: 1360px;
      margin: 0 auto;
      padding: 30px 20px 80px 20px;
      position: relative;
    }

    /* --- TOP HEADER SINGLE ROW --- */
    .top-header {
      display: flex;
      align-items: center;
      gap: 14px;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      padding: 16px 20px;
      border-radius: 20px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
      border: 1px solid rgba(0, 0, 0, 0.06);
      width: 100%;
      flex-wrap: nowrap;
      overflow-x: auto;
      margin-bottom: 40px;
    }

   

    .search-bar-container input {
      width: 100%;
      height: 70px;
      padding: 0 16px 0 44px;
      border-radius: 16px;
      border: 1.5px solid rgba(138, 21, 56, 0.15);
      background-color: var(--bg-main);
      outline: none;
      font-size: 0.9rem;
      font-weight: 500;
      transition: all 0.3s ease;
      color: #8a1538; 
    }

    .search-bar-container input::placeholder {
      color: #7c6864;
      opacity: 0.8;
    }

    .search-bar-container input:focus {
        border-color: var(--primary);
        background-color: #ffffff;
        box-shadow: 0 0 0 4px rgba(138, 21, 56, 0.12);
    }

    .search-icon {
      position: absolute;
      left: 16px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--primary);
      font-size: 1.1rem;
    }

    /* 2. CATEGORIES BOX CONTAINER & SLIDE ANIMATION */
    @keyframes slideInFromRight {
      0% { opacity: 0; transform: translateX(30px); }
      100% { opacity: 1; transform: translateX(0); }
    }

    .cat-box-container {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      padding: 8px 12px;
      background: linear-gradient(135deg, #FFF5F4 0%, #FFEBEB 100%);
      border: 1.5px solid rgba(138, 21, 56, 0.18);
      border-radius: 18px;
      box-shadow: 0 8px 20px rgba(138, 21, 56, 0.12);
      flex-shrink: 0;
      overflow: hidden;
    }

    .cat-grid-row {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .category-box-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      width: 100px;
      height: 70px;
      background-color: #ffffff;
      border: 1.5px solid var(--card-border);
      border-radius: 14px;
      text-decoration: none;
      transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
      flex-shrink: 0;
      animation: slideInFromRight 0.5s ease forwards;
      opacity: 0;
    }

    .cat-grid-row .category-box-card:nth-child(1) { animation-delay: 0.1s; }
    .cat-grid-row .category-box-card:nth-child(2) { animation-delay: 0.2s; }
    .cat-grid-row .category-box-card:nth-child(3) { animation-delay: 0.3s; }
    .cat-grid-row .category-box-card:nth-child(4) { animation-delay: 0.4s; }

    .category-box-card:hover {
      background-color: var(--card-bg-hover);
      border-color: var(--primary);
      transform: translateY(-4px) scale(1.03);
      box-shadow: 0 8px 20px rgba(138, 21, 56, 0.2);
    }

    .category-box-card:hover .cat-icon {
      transform: scale(1.15);
      transition: transform 0.3s ease;
    }

    .category-box-card .cat-icon {
      font-size: 1.3rem;
      line-height: 1;
      transition: transform 0.3s ease;
    }

    .category-box-card .cat-label {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-main);
      text-align: center;
      line-height: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 90px;
    }

    .category-box-card.active {
      background-color: var(--primary);
      border-color: var(--primary);
    }

    .category-box-card.active .cat-label {
      color: #ffffff;
    }

    .more-toggle-card {
      cursor: pointer;
      border: 1.5px dashed var(--primary);
      background-color: #ffffff;
      width: 100px;
    }

    .more-toggle-card .cat-icon {
      color: var(--primary);
      font-size: 1rem;
    }

    .more-toggle-card .cat-label {
      color: var(--primary);
    }

    .more-toggle-card:hover {
      background-color: var(--primary);
      border-style: solid;
    }

    .more-toggle-card:hover .cat-icon,
    .more-toggle-card:hover .cat-label {
      color: #ffffff;
    }

    .expanded-categories-grid {
      display: none;
      align-items: center;
      gap: 10px;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px dashed rgba(138, 21, 56, 0.2);
      flex-wrap: wrap;
    }

    .expanded-categories-grid.show {
      display: flex;
    }

    .expanded-categories-grid .category-box-card {
      width: 110px;
      height: 65px;
      flex-direction: row;
      gap: 8px;
      padding: 0 10px;
    }

    .expanded-categories-grid .category-box-card .cat-label {
      font-size: 0.78rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 70px;
    }

    /* 3. MINUTE FILTER CONTAINER */
    .time-filter-container {
      position: relative;
      width: 130px;
      flex-shrink: 0;
    }

    .time-filter-container input {
      width: 100%;
      height: 70px;
      padding: 0 10px 0 36px;
      border-radius: 16px;
      border: 1.5px solid rgba(138, 21, 56, 0.15);
      background-color: var(--bg-main);
      outline: none;
      font-size: 0.88rem;
      font-weight: 600;
      color: var(--primary);
      transition: all 0.3s ease;
    }

    .time-filter-container input::placeholder {
      color: var(--text-muted);
      opacity: 0.8;
      font-weight: 400;
      font-size: 0.82rem;
    }

    .time-filter-container input:focus {
      border-color: var(--primary);
      background-color: #ffffff;
      box-shadow: 0 0 0 4px rgba(138, 21, 56, 0.12);
    }

    .time-icon {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--primary);
      font-size: 1rem;
    }

    /* 4. FAVOURITE ICON BUTTON */
    .top-fav-btn {
      height: 70px;
      width: 60px;
      border-radius: 16px;
      background-color: var(--bg-main);
      border: 1.5px solid rgba(138, 21, 56, 0.15);
      color: var(--primary);
      display: flex;
      align-items: center;
      justify-content: center;
      text-decoration: none;
      font-size: 1.2rem;
      flex-shrink: 0;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .top-fav-btn:hover {
      background-color: var(--primary);
      color: #ffffff;
      border-color: var(--primary);
      transform: translateY(-2px);
    }

    /* RECIPE SECTIONS & CARDS */
    .recipe-section {
      margin-bottom: 60px;
      scroll-margin-top: 120px; 
    }

    .category-flex-header {
      margin-bottom: 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(255, 255, 255, 0.85);
      backdrop-filter: blur(8px);
      padding: 14px 24px;
      border-radius: 16px;
      position: relative;
      box-shadow: 0 8px 30px rgba(255, 255, 255, 0.6), 0 4px 15px rgba(0, 0, 0, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.9);
    }

    .category-flex-header h3 {
      font-family: var(--font-heading);
      font-size: 1.8rem;
      color: var(--text-main);
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .recipe-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 30px;
    }

    .recipe-card {
      background: #ffffff;
      border-radius: 20px;
      overflow: hidden;
      box-shadow: 0 10px 30px rgba(255, 255, 255, 0.5), 0 8px 25px rgba(0, 0, 0, 0.08);
      transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
      border: 1px solid rgba(255, 255, 255, 0.8);
      display: flex;
      flex-direction: column;
      position: relative;
    }

    .recipe-card:hover {
      transform: translateY(-6px);
      box-shadow: 0 15px 40px rgba(255, 255, 255, 0.7), 0 16px 35px rgba(0, 0, 0, 0.12);
    }

    .image-container {
      position: relative;
      height: 220px;
    }

    .image-container img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .favorite-btn {
      position: absolute;
      top: 15px;
      right: 15px;
      width: 40px;
      height: 40px;
      background-color: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(4px);
      border: none;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--primary);
      font-size: 1.15rem;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
      transition: all 0.3s ease;
      z-index: 5;
    }

    .favorite-btn.favorited {
      background-color: rgba(255, 255, 255, 0.92);
    }

    .favorite-btn.favorited i {
      color: #e63946 !important;
    }

    .card-body {
      padding: 24px;
      display: flex;
      flex-direction: column;
      flex-grow: 1;
    }

    .card-body h4 {
      font-family: var(--font-heading);
      font-size: 1.3rem;
      font-weight: 600;
      margin-bottom: 6px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .cuisine {
      font-size: 0.88rem;
      color: var(--text-muted);
      margin-bottom: 20px;
      line-height: 1.4;
    }

    .card-meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.88rem;
      padding-top: 14px;
      border-top: 1px dashed rgba(138, 21, 56, 0.1);
      margin-top: auto;
    }

    .view-recipe-btn {
      width: 100%;
      padding: 13px 0;
      background-color: var(--primary);
      color: #ffffff;
      border: none;
      border-radius: 12px;
      font-size: 0.95rem;
      font-weight: 600;
      cursor: pointer;
      margin-top: 14px;
      box-shadow: 0 6px 18px rgba(138, 21, 56, 0.25);
      transition: background-color 0.2s ease;
    }

    .view-recipe-btn:hover {
      background-color: var(--primary-hover);
    }

    .empty-notice {
      grid-column: 1 / -1;
      text-align: center;
      padding: 40px;
      color: var(--text-muted);
      background: rgba(255, 255, 255, 0.8);
      backdrop-filter: blur(4px);
      border-radius: 16px;
      border: 1px dashed var(--border-soft);
      box-shadow: 0 8px 25px rgba(255, 255, 255, 0.4);
    }

    /* --- AI CHAT BUTTON --- */
    .ai-chat-trigger-btn {
        position: fixed;
        bottom: 25px;
        right: 25px;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
        color: #ffffff;
        border: none;
        padding: 15px 22px;
        border-radius: 35px;
        font-weight: 600;
        cursor: pointer;
        z-index: 1000;
        font-size: 0.95rem;
        box-shadow: 0 6px 20px rgba(138, 21, 56, 0.3);
        transition: transform 0.2s ease;
    }

    .ai-chat-trigger-btn:hover {
      transform: scale(1.05);
    }
    
    .view-all-link {
      text-decoration: none;
      color: var(--primary);
      font-weight: 700;
      font-size: 0.9rem;
      background-color: #fff9f2;
      padding: 6px 18px;
      border-radius: 50px;
      border: 1.5px solid rgba(138, 21, 56, 0.2);
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .view-all-link:hover {
      background-color: var(--primary);
      color: white;
      border-color: var(--primary);
      transform: translateX(3px);
    }
    .main-content {
    padding-top: 100px; /* Prevents menu content from getting hidden under user_header */
  }


  
  