:root {
  --bs-primary: #9b1eae;
  --bs-success: #02C39A;
  --bs-danger:  #F93943;
  --bs-warning: #FCD757;
  --bs-info:    #60B2E5;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base styles */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #fefcf7 !important;
    color: #333;
    min-height: 100vh;
    padding-top: 56px; /* For fixed navbar */
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.navbar.navbar-expand-lg.navbar-dark {
    background-color: #5B1166 !important;
    height: 56px;
    padding: 0;
}

.navbar-brand {
    padding: 0.5rem 1rem;
}

.navbar-brand img {
    height: 30px;
    margin-right: 10px;
}

.nav-item .fas, 
.nav-item .far {
    margin-right: 5px;
}

.nav-link {
    padding: 0.5rem 1rem !important;
    line-height: 36px;
}

/* Forms */
.auth-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Buttons */
/* 
   Generic button styles removed to prevent conflicts with Bootstrap's 
   default button classes (.btn, .btn-primary, .btn-outline-secondary, etc.).
   Use Bootstrap classes for styling buttons instead.
*/

/* Messages */
.error {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Recipe Cards */
.recipe-card {
    height: 100%;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

.recipe-card .recipe-image {
    height: 200px;
    object-fit: cover;
}

.recipe-card .card-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.recipe-card a {
    color: inherit;
    text-decoration: none;
}

/* Search Box */
.search-box {
    max-width: 500px;
    margin: 0 auto;
}

#searchSpinner {
    display: none;
    width: 1.5rem;
    height: 1.5rem;
}

/* Filter and Sort */
#togglePlannedBtn.active {
    background-color: #198754;
    color: white;
    border-color: #198754;
}

.btn-group .btn.active {
    background-color: #5B1166;
    color: white;
    border-color: #5B1166;
}

.dropdown-item.active {
    background-color: #5B1166;
}

/* Star Rating */
.star-rating {
    color: #ffc107;
    display: inline-flex;
    gap: 5px;
}

.star-rating .fa-star-o {
    color: #6c757d;
}

/* Shopping List */
.shopping-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.shopping-item:last-child {
    border-bottom: none;
}

.shopping-item.checked {
    opacity: 0.6;
    text-decoration: line-through;
}

/* Menu Planner */
.menu-day {
    min-height: 150px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .main-nav a {
        display: block;
        text-align: center;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .recipe-card .recipe-image {
        height: 150px;
    }
}

@media (max-width: 991px) { /* Corresponds to Bootstrap's 'lg' breakpoint */
    .navbar-collapse {
        background-color: #5B1166; /* Match the navbar color */
        padding: 1rem;
        border-radius: 0.25rem;
        margin-top: 0.5rem;
    }
}

/* Custom styles to complement Bootstrap */

/* Card hover effect */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Button hover effects */
.btn-outline-primary:hover {
    transform: translateY(-2px);
}

/* Custom form styles */
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

/* Custom alert styles */
.alert {
    border-radius: 8px;
    border: none;
}

/* Recipe Card Styles */
.recipe-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

.recipe-card .recipe-image {
    height: 200px;
    object-fit: cover;
}

.recipe-card .card-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Filter and Sort Styles */
.btn-group .btn.active {
    background-color: #5B1166;
    color: white;
    border-color: #5B1166;
}

#togglePlannedBtn.active {
    background-color: #198754;
    color: white;
    border-color: #198754;
}

.dropdown-item.active {
    background-color: #5B1166;
}

.badge {
    font-weight: 500;
}

.star-rating {
    color: #ffc107;
}

.star-rating .fa-star-o {
    color: #6c757d;
}

/* Hide the "View Recipe" button since the whole card is clickable */
.recipe-card a {
    color: inherit;
}

.recipe-card a:hover {
    text-decoration: none;
}

/* Meal Planner */
.meal-card {
    background: #FCF7FB;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    position: relative;
    transition: transform 0.2s;
}

.meal-card-body {
    background: #f5eef4;
    border-radius: 0 0 8px 8px;
    border-top: 2px solid #dbdbdb;
    box-shadow: inset 0 8px 12px -4px rgba(0,0,0,0.10);
    padding: 1.5rem;
}

.meal-card:hover {
    transform: translateY(-2px);
}

.meal-card img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.meal-card .remove-meal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #dc3545;
    border: none;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.meal-card .remove-meal:hover {
    background: #dc3545;
    color: white;
}

.add-meal-card {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.add-meal-card:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.meal-description {
    display: none;
}

/* Shopping List */
.shopping-list-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.shopping-list-item:hover {
    background-color: #f8f9fa;
}

.shopping-list-item.checked {
    background-color: #e9ecef;
    color: #6c757d;
    text-decoration: line-through;
}

.recipe-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    margin-bottom: 1.5rem;
}

.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}

.recipe-items {
    padding: 1rem;
}

.custom-control-input {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 1rem;
}

.item-details {
    flex-grow: 1;
}

.recipe-header .form-check {
    margin-bottom: 0; /* Override Bootstrap's default margin */
}

.recipe-header .check-all-box {
    transform: scale(1.2); /* Make checkbox slightly larger to match */
    margin-right: 5px; /* Add some space between box and label */
}

.recipe-items {
    padding: 0;
    list-style: none;
}

/* Custom Bootstrap Color Overrides */
.btn-primary {
  background-color: #9b1eae !important;
  border-color: #9b1eae !important;
  color: #fff !important;
}
.bg-primary {
  background-color: #9b1eae !important;
  border-color: #9b1eae !important;
}
.text-primary {
  color: #9b1eae !important;
}

.btn-success {
  background-color: #02C39A !important;
  border-color: #02C39A !important;
  color: #fff !important;
}
.bg-success {
  background-color: #02C39A !important;
  border-color: #02C39A !important;
}
.text-success {
  color: #02C39A !important;
}

.btn-danger {
  background-color: #F93943 !important;
  border-color: #F93943 !important;
  color: #fff !important;
}
.bg-danger {
  background-color: #F93943 !important;
  border-color: #F93943 !important;
}
.text-danger {
  color: #F93943 !important;
}

.btn-warning {
  background-color: #FCD757 !important;
  border-color: #FCD757 !important;
  color: #212529 !important;
}
.bg-warning {
  background-color: #FCD757 !important;
  border-color: #FCD757 !important;
}
.text-warning {
  color: #FCD757 !important;
}

.btn-info {
  background-color: #60B2E5 !important;
  border-color: #60B2E5 !important;
  color: #fff !important;
}
.bg-info {
  background-color: #60B2E5 !important;
  border-color: #60B2E5 !important;
}
.text-info {
  color: #60B2E5 !important;
}

/* Outline Primary Button Overrides */
.btn-outline-primary {
  color: #9b1eae !important;
  border-color: #9b1eae !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary:focus {
  background-color: #9b1eae !important;
  color: #fff !important;
  border-color: #9b1eae !important;
}

/* Add Side/Dessert Box Drag Area Styles */
.add-side-box, .add-dessert-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  width: 100%;
  border: 2px dashed #9b1eae;
  border-radius: 8px;
  background: #faf6fb;
  color: #9b1eae;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  margin-bottom: 8px;
  transition: background 0.2s, border-color 0.2s;
}
.add-side-box:hover, .add-dessert-box:hover, .add-side-box.drag-over, .add-dessert-box.drag-over {
  background: #f3e6f7;
  border-color: #7a1586;
}
.add-side-box i, .add-dessert-box i {
  margin-right: 8px;
  font-size: 1.5rem;
}

/* Dessert Toggle Button Styles */
.btn-dessert-toggle {
  background: #fff;
  border: 1.5px solid #eee;
  border-radius: 50%;
  padding: 6px 8px;
  margin-left: 8px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  color: #9b1eae;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-dessert-toggle:hover {
  background: #fcd75722;
  border-color: #fcd757;
}
.btn-dessert-toggle.active, .btn-dessert-toggle.text-warning {
  background: #9b1eae;
  border-color: #9b1eae;
  color: #fff;
  box-shadow: 0 2px 8px rgba(155,30,174,0.15);
}

.form-check-input:checked {
  background-color: #02C39A !important;
  border-color: #02C39A !important;
} 