/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #083f2c;
    --secondary-color: #db582d;
    --accent-color: #e8b23b;
    --btn-color: #007ec3;
    --btn-hover-color: #00517c;
    --background: #f5f5e5;
    --card-background: #ffffff;
    --text-dark: #083f2c;
    --text-light: #7f8c8d;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', sans-serif;
}

/* Header */
header {
    background: linear-gradient(135deg, rgba(8, 63, 44, 0.85), rgba(8, 63, 44, 0.95)), url('images/banner.jpg') center/cover;
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Recipe Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Recipe Card */
.recipe-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recipe-card:hover .card-image img {
    transform: scale(1.1);
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.card-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.chef-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chef-badge img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.chef-badge span {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.time-badge {
    background: #ecf0f1;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Recipe Detail Page */
.back-btn {
    background: var(--btn-color);
    color: white;
    border: 0px;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.back-btn:hover {
    background: var(--btn-hover-color);
    transform: translateX(-4px);
}

.recipe-detail {
    max-width: 900px;
}

.recipe-hero {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

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

.recipe-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 3px solid var(--accent-color);
}

.chef-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chef-info img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.chef-info .label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.chef-info h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.time-info .label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.time-info p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.recipe-description {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.recipe-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

/* Ingredients Section */
.ingredients-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: fit-content;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.ingredient-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.scale-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--background);
    padding: 0.5rem;
    border-radius: 8px;
}

.control-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--accent-color);
    background: white;
    color: var(--accent-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: var(--accent-color);
    color: white;
}

#scale-display {
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.toggle-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn:hover {
    background: var(--btn-hover-color);
    transform: scale(1.05);
}

.ingredients-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ingredient-group h4 {
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    margin-top: -10px;
    background: var(--background);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.ingredient-item:hover {
    background: #e8eef1;
}

.ingredient-amount {
    font-weight: 700;
    color: var(--accent-color);
    min-width: 80px;
}

.ingredient-name {
    flex: 1;
    color: var(--text-dark);
}

/* Directions Section */
.directions-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.directions-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.directions-text p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.directions-text p:last-child {
    margin-bottom: 0;
}

/* Related Recipe Section */
.related-recipe {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 2rem;
    text-align: center;
}

.related-recipe h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.related-recipe-btn {
    background: var(--btn-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.related-recipe-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    background: var(--btn-hover-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .recipe-content {
        grid-template-columns: 1fr;
    }

    .recipe-hero img {
        height: 250px;
    }

    .recipe-meta {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .ingredient-controls {
        width: 100%;
    }

    .scale-controls,
    .toggle-btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .container {
        padding: 1rem 0.5rem;
    }

    .card-content h3 {
        font-size: 1.2rem;
    }

    .ingredient-controls {
        flex-direction: column;
    }
}