* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #2b1d0f;
    color: #fff;
    margin-top: 0;
    padding-top: 100px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo i {
    font-size: 32px;
    color: #ffa500;
    filter: drop-shadow(0 2px 4px rgba(255, 165, 0, 0.3));
}

header nav {
    background: linear-gradient(135deg, #3b2c1c 0%, #4b3b2b 100%);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #ffa500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    gap: 16px;
}

header nav h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

header nav form {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 560px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

form input[type="text"] {
    flex-grow: 1;
    margin-right: 10px;
    padding: 12px 15px;
    border: 2px solid #ffa500;
    border-radius: 8px;
    font-size: 15px;
    background-color: #fff;
    color: #333;
    transition: all 0.3s ease;
}

form input[type="text"]:focus {
    outline: none;
    border-color: #ff8c00;
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.3);
}

form input[type="text"],
button[type="submit"] {
    padding: 12px 15px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
}

button[type="submit"] {
    background: linear-gradient(135deg, #ffa500 0%, #ff8c00 100%);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}

button[type="submit"]:hover,
.recipe .view-recipe-btn:hover {
    background: linear-gradient(135deg, #ff8c00 0%, #ff7700 100%);
    box-shadow: 0 6px 16px rgba(255, 165, 0, 0.4);
    transform: scale(1.05);
}

.theme-toggle {
    background: transparent;
    border: 2px solid #ffa500;
    color: #ffa500;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.theme-toggle:hover {
    background-color: rgba(255, 165, 0, 0.15);
}

.favorites-toggle {
    background: linear-gradient(135deg, #ffa500 0%, #ff8c00 100%);
    border: none;
    color: #fff;
    height: 44px;
    border-radius: 8px;
    padding: 0 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}

.favorites-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 140, 0, 0.35);
}

.favorites-count {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 800;
}

.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    list-style: none;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
    z-index: 1200;
    display: none;
}

.suggestions-dropdown li {
    color: #2b1d0f;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.suggestions-dropdown li:last-child {
    border-bottom: none;
}

.suggestions-dropdown li:hover {
    background-color: #fff4e5;
}

.hero {
    background: linear-gradient(135deg, #4b3b2b 0%, #6b5b4b 100%);
    text-align: center;
    padding: 80px 40px;
    margin: 40px auto;
    max-width: 900px;
    border-radius: 15px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border: 2px solid #ffa500;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.hero h1 i {
    font-size: 52px;
    color: #ffa500;
    filter: drop-shadow(0 3px 6px rgba(255, 165, 0, 0.4));
}

.hero p {
    font-size: 18px;
    line-height: 1.8;
    color: #f0e6d2;
    margin-bottom: 0;
    font-weight: 500;
}

.special-recipe-heading {
    text-align: center;
    font-size: 36px;
    background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 50px 0 35px 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.recipe-container {
    text-align: center;
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    grid-gap: 35px;
    width: 95%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
    place-items: center;
}

.recipe {
    background-color: #fff;
    display: flex;
    flex-direction: column;
    color: #000;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    max-width: 350px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.recipe:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(255, 215, 0, 0.25);
}

.recipe img {
    height: 300px;
    object-fit: cover;
    width: 100%;
}

.recipe h2 {
    font-size: 22px;
    margin: 16px 12px 8px 12px;
    color: #2b1d0f;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.recipe span {
    font-weight: 700;
    color: #ffa500;
    font-size: 15px;
}

.recipe p {
    font-size: 15px;
    color: #555;
    margin: 8px 12px;
    line-height: 1.4;
}

.recipe button {
    font-size: 16px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    margin: 16px auto;
    background: linear-gradient(135deg, #ffa500 0%, #ff8c00 100%);
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
    width: 85%;
}

.recipe .recipe-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 85%;
    margin: 16px auto;
}

.recipe .view-recipe-btn {
    flex: 1;
    width: auto;
    margin: 0;
}

.recipe .favorite-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    color: #9c9c9c;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    margin: 0;
    flex-shrink: 0;
}

.recipe .favorite-btn:hover {
    color: #ff4d6d;
    transform: scale(1.08);
}

.recipe .favorite-btn.active {
    color: #ff2d55;
    background: #fff0f3;
}

.fade-in-card {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 6px 0 20px 0;
}

.pagination button {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #ffa500 0%, #ff8c00 100%);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    color: #ffd28a;
    font-weight: 600;
}

#favorites-section {
    margin-top: 24px;
}

.recipe-details {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

.recipe-detials-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #3b2c1c 0%, #2b1d0f 100%);
    color: #fff;
    border-radius: 15px;
    width: 90%;
    max-width: 550px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border: 2px solid #ffa500;
}

.recipe-detials-content .recipe-popup .recipeName {
    color: #ffd700;
    font-size: 32px;
    margin-bottom: 20px;
    font-weight: 700;
    border-bottom: 2px solid #ffa500;
    padding-bottom: 15px;
}

.recipe-content {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.recipe-section h3 {
    color: #ffa500;
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 700;
}

.recipe-ingredients {
    flex: 1 1 280px;
}

.recipe-instructions {
    flex: 2 1 320px;
}

.ingredientList {
    list-style: none;
    margin-left: 0;
}

.ingredientList li {
    padding: 8px 0;
    color: #e0d0b0;
    border-bottom: 1px solid rgba(255, 165, 0, 0.2);
}

.ingredientList li:before {
    content: "✓ ";
    color: #ffa500;
    font-weight: bold;
    margin-right: 8px;
}

.recipeInstructions {
    line-height: 1.8;
    white-space: pre-wrap;
    color: #e0d0b0;
    font-size: 15px;
}

.recipe-closeBtn {
    position: absolute;
    top: calc(50% - 35vh);
    right: calc(50% - 275px - 12px);
    background: #e4e0e0;
    color: #090909;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    z-index: 1010;
    transition: background-color 0.2s ease;
}

.recipe-closeBtn:hover {
    background: #f0f0f0;
}

footer {
    background: linear-gradient(135deg, #2b1d0f 0%, #1a1109 100%);
    color: #fff;
    margin-top: 60px;
    padding: 40px 20px 20px 20px;
    border-top: 3px solid #ffa500;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 30px;
}

.footer-section h3 {
    font-size: 20px;
    color: #ffd700;
    margin-bottom: 15px;
    font-weight: 700;
}

.footer-section p {
    font-size: 14px;
    color: #d0d0d0;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #d0d0d0;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #ffa500;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 165, 0, 0.2);
    border-radius: 50%;
    color: #ffa500;
    transition: all 0.3s ease;
    font-size: 20px;
}

.social-links a:hover {
    background-color: #ffa500;
    color: #fff;
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 165, 0, 0.3);
    color: #a0a0a0;
    font-size: 14px;
}

body.light-mode {
    background-color: #f9f4ec;
    color: #2b1d0f;
}

body.light-mode header nav {
    background: linear-gradient(135deg, #ffe4bf 0%, #ffd7a0 100%);
    border-bottom-color: #c07000;
}

body.light-mode header nav h1,
body.light-mode .hero h1,
body.light-mode .special-recipe-heading {
    background: linear-gradient(135deg, #8a4b00 0%, #b35c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode .hero h1 i {
    color: #b35c00;
}

body.light-mode .hero {
    background: linear-gradient(135deg, #fff2dd 0%, #ffe8cc 100%);
    border-color: #df8c2f;
}

body.light-mode .hero p {
    color: #5a4328;
}

body.light-mode .recipe {
    background-color: #fffdf9;
    color: #2b1d0f;
}

body.light-mode .recipe p {
    color: #4e4337;
}

body.light-mode .recipe span,
body.light-mode .pagination span {
    color: #9a4e00;
}

body.light-mode .recipe-detials-content {
    background: linear-gradient(135deg, #fff4e4 0%, #ffe7c8 100%);
    color: #2b1d0f;
    border-color: #c07000;
}

body.light-mode .ingredientList li,
body.light-mode .recipeInstructions {
    color: #4e4337;
}

body.light-mode .recipe-closeBtn {
    background: #2b1d0f;
    color: #fff;
}

body.light-mode footer {
    background: linear-gradient(135deg, #f0d7b8 0%, #e4c39a 100%);
    color: #2b1d0f;
}

body.light-mode .footer-section p,
body.light-mode .footer-bottom,
body.light-mode .footer-section ul li a {
    color: #5a4328;
}

body.light-mode .suggestions-dropdown {
    border: 1px solid #efcc9f;
}

body.light-mode .theme-toggle {
    border-color: #9a4e00;
    color: #9a4e00;
}

body.light-mode .favorites-toggle {
    background: linear-gradient(135deg, #b35c00 0%, #8a4b00 100%);
}

body.light-mode .favorites-count {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .hero {
        padding: 50px 20px;
        margin: 20px auto;
    }

    .hero h1 {
        font-size: 36px;
    }

    .recipe-detials-content {
        padding: 20px;
        width: 95%;
        max-width: 95%;
    }

    .recipe-detials-content .recipeName {
        font-size: 26px;
    }

    .recipe-content {
        flex-direction: column;
        gap: 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    header nav {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 12px;
    }

    .logo {
        justify-content: center;
    }

    header nav h1 {
        font-size: 24px;
    }

    header nav form {
        width: 100%;
        max-width: none;
        flex-direction: row;
        gap: 8px;
    }

    form input[type="text"] {
        width: auto;
        flex: 1;
        margin-right: 0;
        min-width: 0;
    }

    header nav .searchBtn {
        width: auto;
        flex-shrink: 0;
        padding: 12px 14px;
        font-size: 15px;
    }

    .nav-actions {
        width: 100%;
        margin-left: 0;
    }

    .theme-toggle {
        width: 46px;
        min-width: 46px;
        height: 46px;
        border-radius: 10px;
    }

    .favorites-toggle {
        flex: 1;
        height: 46px;
        justify-content: center;
    }

    .special-recipe-heading {
        font-size: 28px;
        margin: 30px 0 20px 0;
    }

    .recipe-container {
        grid-template-columns: 1fr;
        width: 100%;
        padding: 10px;
    }

    .recipe {
        max-width: 90%;
    }

    .footer-section h3 {
        margin-top: 20px;
    }
}
