:root {
    --beige-white: #e6d7c3;
    --dark-blue: #00468B;
  --secondary-color: #4CAF50;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lora', serif;
}

/* ===========================
   SEARCH ICON
=========================== */
#broad_search img{
  width:30px;
  height:auto;
}
#broad_search {
    cursor: pointer;
}

/* ===========================
   DESKTOP DROPDOWN
=========================== */
.search-wrapper {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    padding: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-radius: 8px;
    display: none;
    z-index: 1000;
}

.search-dropdown input {
    width: 260px;
    padding: 10px 12px;
    font-size: 16px;
}

/* Desktop search results */
#search_results_desktop {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    display: none;
}

#search_results_desktop .search-item {
    padding: 10px;
    display: flex;
    gap: 10px;
    cursor: pointer;
}

#search_results_desktop .search-item:hover {
    background: #f0e6d0;
}

#search_results_desktop img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}


/* ===========================
   MOBILE OVERLAY
=========================== */




.search-overlay-inner {
    padding: 20px;
}

.search-overlay input {
    width: 100%;
    font-size: 18px;
    padding: 14px;
}

#close_search_overlay {
    margin-top: 20px;
    font-size: 18px;
    background: none;
    border: none;
    cursor: pointer;
}

/* ===========================
   RESPONSIVE SWITCH
=========================== */
@media (max-width: 768px) {
    .search-dropdown {
        display: none !important;
    }
}


.header-back {
    text-decoration: none;
  font-size:21px;
    font-weight: 1200;
    color: black;
}

#close_side_bar{
  cursor:pointer;
  position:relative;
  float:right;
  font-weight:bold;
  color:white;
  margin-top:-20px;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* Friend request notification */
#ShR{position: absolute;
  top:30px;
  right:30px;
color: var(--dark-blue);
font-weight: bold;
font-size: 1.2rem;
text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;}

.title-link {
    text-decoration: none;
    color: inherit;
}

/* Cookie Consent Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 70, 139, 0.95);
    color: white;
    padding: 1rem;
    z-index: 1000;
    display: none;
    backdrop-filter: blur(5px);
}

.cookie-banner.show {
    display: block;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.cookie-btn.accept {
    background: #4CAF50;
    color: white;
}

.cookie-btn.accept:hover {
    background: #45a049;
}

.cookie-btn.reject {
    background: #f44336;
    color: white;
}

.cookie-btn.reject:hover {
    background: #da190b;
}

.cookie-btn.settings {
    background: transparent;
    color: white;
    border: 1px solid white;
}

.cookie-btn.settings:hover {
    background: white;
    color: var(--dark-blue);
}

/* Cookie Settings Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-modal.show {
    display: flex;
}

.cookie-modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.cookie-modal h3 {
    color: var(--dark-blue);
    margin-bottom: 1rem;
    font-family: 'Merriweather', serif;
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.cookie-category h4 {
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-category p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .cookie-slider {
    background-color: #4CAF50;
}

input:checked + .cookie-slider:before {
    transform: translateX(26px);
}

.cookie-slider.disabled {
    background-color: #4CAF50;
    cursor: not-allowed;
}

.cookie-modal-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Mobile responsiveness for cookie consent */
@media (max-width: 768px) {
/* Footer profile */
    .user-dropup {
        bottom: 70px;
        width: 10px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 12px;
      text-align:left;
    }

    .user-dropup a {
        padding: 16px;
        font-size: 16px;
        text-align: left;
    }
  
  /* Cookies */

    .cookie-content {
        text-align: center;
    }
    
    .cookie-buttons {
        justify-content: center;
    }
    
    .cookie-btn {
        flex: 1;
        min-width: 100px;
    }
    
    .cookie-modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .cookie-modal-buttons {
        justify-content: center;
    }
    
    .cookie-modal-buttons .cookie-btn {
        flex: 1;
    }
}

/* Header Styles */
header {
    background-color: var(--beige-white);
    padding: 1rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
}

.header-container {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    align-items: center;
}

.title-container {
    text-align: center;
}

h1 {
    font-family: 'Dancing Script', cursive;
    color: var(--dark-blue);
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

h2 {
    font-family: 'Merriweather', serif;
    color: var(--dark-blue);
    font-size: 1rem;
    font-weight: normal;
}

.burger-menu {
    font-size: 1.5rem;
    color: var(--dark-blue);
}

.settings-icon {
    width: 24px;
    height: 24px;
    margin-left: auto;
    display: flex;
    justify-content: flex-end;
}

.settings-icon img {
    width: 100%;
    height: 100%;
}

/* Create Recipe Button Styles */
.create-recipe-button-container {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px;
    margin-top: 100px; /* Space for the fixed header */
}

.create-recipe-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--dark-blue);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    transition: background-color 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.create-recipe-button:hover {
    background-color: #003366; /* Darker shade of your dark blue */
}

.search-recipe-container {
    margin-top: 10px; /* Reduced margin since we have the button container above */
    margin-bottom: 80px;
    padding: 1rem;
}

/* Footer Styles */
footer {
    background-color: var(--beige-white);
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 1rem;
  z-index:999;
}

.footer-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--dark-blue);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
}

.nav-item img {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 12px;
}

.user-menu {
    position: relative;
}

.user-dropup {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    min-width: 160px;
    z-index: 1000;
}

.user-dropup a {
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    white-space: nowrap;
}

.user-dropup a:hover {
    background: #f2f2f2;
}




/* Main content area */
main {
    margin-top: 100px;
    margin-bottom: 80px;
    padding: 1rem;
}

/* PROFILE PAGE */
.profile-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 20px;
}

.profile-section {
    background: var(--primary-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-picture {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-picture img {
    position:relative;  
    top:50%;  
    left:50%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.profile-img.clickable {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.profile-img.clickable:hover {
    opacity: 0.8;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-actions button {
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.change-picture-btn {
    background: var(--primary-color);
    color: black;
}

.reset-password-btn {
    background: var(--secondary-color);
    color: white;
}

.logout-btn {
    background: #B7484B !important;
    color: white;
}

/* SHARE SHOPPING LIST */
/* Share list button styling */
.share-list-btn {
    position: relative;
    cursor: pointer;
    display: block;
    width: calc(100% - 40px);
    margin: 20px auto;
    padding: 15px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Share Overlay styling (adapted to mimic search overlay) */
.share-overlay {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--beige-white);
    z-index: 99;
    transition: top 0.3s ease-in-out;
}

.share-overlay.active {
    top: 0;
}

/* Close Button for overlays, mimicking search.css */
.close-button {
    display: none;
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30px;
    cursor: pointer;
    color: var(--dark-blue);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.share-overlay.active .close-button {
    display: flex;
}

.share-overlay-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background-color: #fff;
    position: sticky;
    top: 0;
}

.share-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.share-search-container {
    padding: 15px 20px;
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#user-search {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 15px;
    background-color: #f5f5f5;
}

.user-results {
    margin-top: 10px;
}

.user-result {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-result:active {
    background-color: #f0f0f0;
}

/* Safe area handling for modern iPhones */
@supports (padding: max(0px)) {
    .share-header {
        padding-top: max(20px, env(safe-area-inset-top));
    }
    
    .share-search-container {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Add notification styling */
.share-notification {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1002;
    display: none;
}

.share-notification.show {
    display: block;
    animation: fadeInOut 2s ease-in-out;
}

.icon{
    width:20px;     
    height:20px;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -20px); }
}

/* Shared Lists Styling */
.shared-lists h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--dark-blue);
    font-size: 1.1rem;
}

.shared-list-entry {
    background-color: #fff;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.shared-list-entry.active {
    background-color: #f0f8ff;
    border-left: 3px solid var(--dark-blue);
}

.shared-list-entry span {
    flex: 1;
    font-size: 0.9rem;
}

.accept-share, .reject-share, {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

.accept-share {
    background-color: #4CAF50;
    color: white;
}

.accept-share:hover {
    background-color: #45a049;
}

.reject-share, .remove-share {
    background-color: #ff4444;
    color: white;
}

.reject-share:hover, .remove-share:hover {
    background-color: #cc0000;
}

.pending-requests, .active-shared-lists {
    margin-bottom: 20px;
}

.shared-profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    flex: 1;
}

.user-name {
    display: block;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* PROFILE PAGE */
/* Profile Picture */
.profile-picture {
    position: relative;
    display: inline-block;
    width: 150px; /* Default size for larger screens */
    height: 150px;
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Upload Icon inside the Avatar */
.upload-icon {
    width: 40px !important;  /* Smaller icon */
    height: 40px !important; /* Smaller icon */
    position: absolute;
    bottom: -40px;
    right: 0px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.upload-icon:hover {
    transform: scale(1.2); /* Make it slightly bigger on hover */
}

/* Shared Lists */
.shared-lists {
    width: 100%;
    max-width: 400px;
    margin-top: 20px;
    text-align: left;
}

/* Buttons */
.profile-actions button,.shared-list-entry button {
    width: 90%;
    max-width: 300px;
    padding: 10px;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    background-color: #007BFF;
    color: white;
    cursor: pointer;
    margin-top: 10px;
}

/* Exception for remove-share button */
.shared-list-entry .remove-share {
    width: auto;
    max-width: none;
    padding: 5px;
    background: none;
    margin-top: 0;
}

.profile-actions button:hover,.shared-list-entry button:hover {
    background-color: #0056b3;
}

/* Recipe Sections */
.recipe-sections {
    margin-top: 30px;
}

.my-recipes, .favorite-recipes {
    margin-bottom: 30px;
}

.my-recipes h3, .favorite-recipes h3 {
    color: var(--dark-blue);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.recipe-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.recipe-title {
    padding: 8px;
    font-size: 0.8rem;
    color: var(--dark-blue);
    text-align: center;
}

.recipe-title_profile {
    padding: 8px;
    font-size: 0.8rem;
    color: var(--dark-blue);
    text-align: center;
}

/* Burger Menu Styles */
.burger-menu {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    padding: 0;
    background: none;
    border: none;
    transition: all 0.3s ease;
}

.burger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--dark-blue);
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Burger menu animation when active */
.burger-menu.active .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Burger Menu Overlay */
.burger-overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 70, 139, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999;
    transition: left 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.burger-overlay.active {
    left: 0;
}

.burger-nav {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.burger-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.burger-menu-item {
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.3s ease;
}

.burger-overlay.active .burger-menu-item {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger animation for menu items */
.burger-overlay.active .burger-menu-item:nth-child(1) {
    transition-delay: 0.1s;
}

.burger-overlay.active .burger-menu-item:nth-child(2) {
    transition-delay: 0.2s;
}

.burger-overlay.active .burger-menu-item:nth-child(3) {
    transition-delay: 0.3s;
}

.burger-overlay.active .burger-menu-item:nth-child(4) {
    transition-delay: 0.4s;
}

.burger-menu-link {
    display: block;
    color: white;
    text-decoration: none;
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    font-weight: 400;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.burger-menu-link:hover {
    color: var(--beige-white);
    padding-left: 1rem;
    border-bottom-color: var(--beige-white);
}

.burger-menu-text {
    display: block;
}

/* Prevent body scroll when menu is open */
body.burger-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .burger-overlay {
        backdrop-filter: blur(5px);
    }
    
    .burger-menu-link {
        font-size: 1.3rem;
        padding: 0.8rem 0;
    }
    
    .burger-nav {
        padding: 1.5rem;
    }
    
    .burger-menu-item {
        margin-bottom: 1.5rem;
    }
}

/* Desktop specific adjustments */
@media (min-width: 769px) {
    .burger-overlay {
        width: 400px;
        left: -400px;
    }
    
    .burger-overlay.active {
        left: 0;
    }
    
    .burger-menu-link {
        font-size: 1.2rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .burger-menu,
    .burger-line,
    .burger-overlay,
    .burger-menu-item,
    .burger-menu-link {
        transition: none;
    }
}

/* Focus styles for accessibility */
.burger-menu:focus {
    outline: 2px solid var(--dark-blue);
    outline-offset: 2px;
}

.burger-menu-link:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}


/* Mobile Optimization */
@media (max-width: 430px) { /* iPhone 11 and newer */
    .profile-picture {
        width: 120px;
        height: 120px;
    }
    
    .upload-icon {
        width: 15px;  /* Even smaller icon for mobile */
        height: 15px; /* Even smaller icon for mobile */
    }
    
    .profile-actions button {
        font-size: 14px;
    }
    .recipe-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .recipe-title {
        font-size: 0.7rem;
        padding: 6px;
    }
}

.footer-attribution {
    background-color: none;
    padding: 10px 15px;
    text-align: center;
}

.data-credit {
    font-size: 0.8em;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.data-credit a {
    color: #007bff;
    text-decoration: none;
}

.data-credit a:hover {
    text-decoration: underline;
}

/** SUB MENUS TO THE SIDE PANEL **/
.has-submenu {
    position: relative;
}

.submenu {
    max-height: 0;
    overflow: hidden;
    padding-left: 20px;
    transition: max-height 0.3s ease-in-out;
    list-style: none;
}

.submenu.active {
    max-height: 500px; /* Adjust based on your content */
}

.submenu-toggle {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submenu-arrow {
    transition: transform 0.3s ease;
    font-size: 1.5rem;
    margin-left: 10px;
}

.submenu-toggle.active .submenu-arrow {
    transform: rotate(90deg);
}

/* Adjust submenu links */
.submenu .burger-menu-link {
    font-size: 1.1rem;
    padding: 0.8rem 0;
    opacity: 0.9;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .data-credit {
        font-size: 0.75em;
        padding: 0 5px;
    }
}
