/* ==========================================
   GLOBAL TYPOGRAPHY & BASE
   ========================================== */
.font-header { font-family: 'Poppins', sans-serif; font-weight: 700; }
.font-body { font-family: 'Inter', sans-serif; font-weight: 400; }
.font-btn { font-family: 'Poppins', sans-serif; font-weight: 600; }

body, html { height: 100%; margin: 0; }

/* ==========================================
   BRAND COLORS & GLOBAL BUTTONS
   ========================================== */
.bg-red-main { background-color: #d4090d; color: white; }

.btn-tertiary { 
    background-color: #e27b7d; 
    color: white; 
    border: none; 
    transition: all 0.2s ease-in-out; /* Makes the animation smooth */
}

.btn-tertiary:hover { 
    background-color: #c96b6d !important; /* Slightly darker pink */
    color: white !important; 
    transform: translateY(-2px); /* Matches the premium lift of the red button */
    box-shadow: 0 4px 10px rgba(226, 123, 125, 0.4) !important; /* Custom pink shadow */
}

.text-link { color: white; text-decoration: underline; font-family: 'Poppins', sans-serif; font-size: 0.8rem; }
.text-link:hover { color: #ffeded; }

/* ==========================================
   GLOBAL FORM ELEMENTS
   ========================================== */
.form-label { 
    font-family: 'Poppins', sans-serif; 
    font-weight: 500; 
    font-size: 0.9rem; 
    color: white; /* Note: If you have white backgrounds on other pages, you may need to override this later! */
}

.form-control { 
    font-family: 'Inter', sans-serif; 
    font-weight: 500; 
    padding: 0.75rem; 
    border-radius: 0px; 
    border: 2px solid #000; 
    box-shadow: 2px 3px 6px rgba(0,0,0,0.25); 
}

.form-control::placeholder { color: #a0a0a0; font-weight: 500; }
.form-control:focus {
    border-color: #000;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.4);
}

/* ==========================================
   VALIDATION OVERRIDES (For Red Background)
   ========================================== */
/* 1. Stop checkbox labels from turning dark red when invalid (Keep them white) */
.was-validated .form-check-input:invalid ~ .form-check-label,
.was-validated .form-check-input:valid ~ .form-check-label {
    color: white !important;
}

/* 2. Make the invalid input border that bright orange/yellow */
.was-validated .form-control:invalid {
    border-color: #ffc421 !important; 
    /* Optional: Add a slight glow so it pops even more */
    box-shadow: 0 0 5px rgba(255, 196, 33, 0.5) !important;
}

/* 3. Make ALL error text (invalid-feedback) the bright orange/yellow */
.was-validated .invalid-feedback {
    color: #ffc421 !important;
    font-weight: 500; /* Makes the error text a bit bolder for readability */
}

/* 4. Keep the valid input border a bright green/white so successful fields pop */
.was-validated .form-control:valid {
    border-color: #00ff88 !important;
}

/* ==========================================
   GLOBAL LAYOUT & BACKGROUND
   ========================================== */
body.cookloop-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #ffebeb; /* Boom! Global light pink background! */
}

main.flex-grow-1 {
    flex-grow: 1;
}

/* ==========================================
   GLOBAL HERO BANNER
   ========================================== */
.page-hero {
    position: relative;
    width: 100%;
    height: 40vh; 
    min-height: 250px;
    /* background-image: url('/img/recipe_hero_bg.jpg'); */ /* Default image */
    background-size: cover;
    background-position: center;
}

/* The Red Overlay */
.page-hero::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background-color: rgba(212, 9, 13, 0.65); /* Red with 65% opacity */
    z-index: 1;
}

.page-hero-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: white;
    font-family: 'Fredoka', sans-serif;
    font-size: 4.5rem;
    letter-spacing: 2px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}

/* ==========================================
   HEADER & NAVBAR
   ========================================== */
.top-logo-bar {
    background-color: #d4090d;
    padding: 10px 0;
    text-align: center;
}

.top-logo-bar img {
    height: 120px; /* Adjust based on your logo size */
}

.cookloop-nav {
    background-color: #ffebeb; /* Light pink background */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1030; /* Ensures it stays above the carousel when sticky */
    transition: transform 0.3s ease-in-out;
    min-height: 85px; /* Forces the navbar to stay roomy even without the search bar! */
}

.nav-link {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #333 !important;
    position: relative;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #d4090d !important;
}

/* The "Chef Hat" Active State */
.nav-link.active {
    color: #d4090d !important;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 3px;
    background-color: #d4090d;
    border-radius: 2px;
}

.nav-link.active::before {
    /* Changed width and height from 16px to 24px inside the SVG */
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23d4090d" width="24px" height="24px"><path d="M12 2C9.24 2 7 4.24 7 7c0 .54.09 1.06.24 1.56C5.39 9.39 4 11.04 4 13c0 2.21 1.79 4 4 4h8c2.21 0 4-1.79 4-4 0-1.96-1.39-3.61-3.24-4.44.15-.5.24-1.02.24-1.56 0-2.76-2.24-5-5-5zm0 2c1.66 0 3 1.34 3 3 0 .28-.05.54-.12.79l-.2.68.64.29c1.3.59 2.18 1.86 2.18 3.24 0 1.65-1.35 3-3 3H8c-1.65 0-3-1.35-3-3 0-1.38.88-2.65 2.18-3.24l.64-.29-.2-.68C7.55 7.54 7.5 7.28 7.5 7c0-1.66 1.34-3 3-3z"/></svg>');
    position: absolute;
    /* Pushed this up from -12px to -20px to make room for the bigger hat */
    top: -10px; 
    left: 50%;
    transform: translateX(-50%);
}

/* Search Bar & Icons */
.nav-search-bar {
    border-radius: 20px;
    border: 1px solid #d4090d;
    padding-left: 15px;
}

/* ==========================================
   SEARCH BAR FIX (Hide native webkit clear button)
   ========================================== */
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

/* ==========================================
   NAVBAR ICONS (Cart & Profile)
   ========================================== */
.nav-icons a {
    color: #000;
    font-size: 1.6rem; /* Increased size from 1.3rem */
    margin-left: 25px; /* Added more breathing room between icons */
    position: relative;
    transition: color 0.2s ease;
}

/* This CSS trick adds a 1px stroke to the icons, making them visibly thicker! */
.nav-icons i {
    -webkit-text-stroke: 1px black; 
}

/* Add a nice red hover effect so it feels interactive */
.nav-icons a:hover {
    color: #d4090d;
}

.nav-icons a:hover i {
    -webkit-text-stroke: 1px #d4090d;
}

/* ==========================================
   FOOTER
   ========================================== */
.cookloop-footer {
    background-color: #d4090d;
    color: white;
    /* Reduced top padding to 2rem, bottom padding to 0.5rem */
    padding: 2rem 0 0.5rem 0; 
    font-family: 'Inter', sans-serif;
}

.footer-heading {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.cookloop-footer a {
    color: white;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.cookloop-footer a:hover {
    text-decoration: underline;
}

/* New Social Image Circles */
.social-circle {
    display: inline-block;
    width: 38px;  /* Adjust size if you want them bigger/smaller */
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.social-circle:hover {
    transform: scale(1.1); /* Adds a nice little pop when hovered */
}

.social-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================
   GLOBAL RED BUTTON HOVER FIX
   ========================================== */
.btn.bg-red-main {
    transition: all 0.2s ease-in-out;
}

.btn.bg-red-main:hover {
    background-color: #a8070a !important; /* Darker red */
    color: white !important;
    transform: translateY(-2px); /* Slight lift */
    box-shadow: 0 4px 10px rgba(212, 9, 13, 0.3) !important;
}

/* ==========================================
   GLOBAL ICON THICKNESS FIXES
   ========================================== */
.clock-thick {
    -webkit-text-stroke: 0.5px currentColor;
}

/* ==========================================
   DYNAMIC NAVBAR CART ICON
   ========================================== */
.nav-cart-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: black;
    transition: all 0.2s ease;
    font-size: 1.3rem;
}

.nav-cart-link:hover i {
    color: #d4090d;
    transform: scale(1.1);
}

.nav-cart-link.active-cart i {
    color: #d4090d;
    -webkit-text-stroke: 1px #d4090d;
    filter: drop-shadow(0 2px 4px rgba(212, 9, 13, 0.3));
}

/* ==========================================
   DYNAMIC NAVBAR PROFILE PICTURE
   ========================================== */
.profile-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-left: 25px; /* Matches the cart spacing */
}

.nav-profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

/* Hover effect for the image */
.profile-icon-link:hover .nav-profile-img {
    transform: scale(1.1);
    border-color: #d4090d;
}

/* The Active State (when on profile.php) */
.profile-icon-link.active-profile .nav-profile-img {
    border-color: #d4090d;
    box-shadow: 0 0 8px rgba(212, 9, 13, 0.4);
}

.profile-icon-link.active-profile i {
    color: #d4090d;
    -webkit-text-stroke: 1px #d4090d;
}

/* ==========================================
   OTP BUTTON HOVER FIX
   ========================================== */
/* Forces the muted text to turn white when the dark button is hovered */
.btn-outline-dark:hover .text-muted {
    color: rgba(255, 255, 255, 0.85) !important; /* Slightly faded white for a premium look */
    transition: color 0.2s ease-in-out;
}

/* ===================================================
   SIDEBAR & SEARCH LAYOUT (RECIPE & INGREDIENTS PAGE)
   =================================================== */
#recipe-content {
    scroll-margin-top: 120px; 
}

.sticky-sidebar {
    position: sticky;
    top: 20px; 
    z-index: 10;
}

.sticky-search-pocket {
    position: sticky;
    top: 0;
    background-color: #ffebeb;
    z-index: 10;
    padding-top: 20px;
    padding-bottom: 20px;
}

.category-sidebar {
    background-color: #d4090d;
    border-radius: 16px;
    padding: 1.5rem 1rem;
}

.category-sidebar a {
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    display: block;
    padding: 12px 20px;
    margin-bottom: 5px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-sidebar a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.category-sidebar a.active {
    background-color: #ffebeb;
    color: #000;
    font-weight: 600;
}

.recipe-search-input {
    border-radius: 50px;
    border: 2px solid #d4090d;
    padding: 0.8rem 1.5rem;
    padding-left: 2.5rem; 
    box-shadow: none !important; 
    -webkit-box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: white !important; 
    background-clip: padding-box;
}

.recipe-search-input:focus {
    outline: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    border-color: #d4090d !important; 
}

.recipe-search-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #d4090d;
    font-size: 1.2rem;
}