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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #fef3c7 0%, #fee2e2 50%, #fce7f3 100%);
    min-height: 100vh;
}

/* Header Styles */
header {
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo span {
    font-size: 40px;
}

.logo h1 {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 28px;
    font-weight: 700;
}

.logo p {
    color: #6b7280;
    font-size: 14px;
    margin-top: 5px;
}

.recipe-count {
    text-align: right;
}

.recipe-count p {
    color: #6b7280;
    font-size: 14px;
}

/* Header Buttons */
.header-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-container {
    position: relative;
    flex: 1;
}

.search-container input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-container input:focus {
    outline: none;
    border-color: #ea580c;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 12px;
    color: #9ca3af;
    font-size: 18px;
}

.add-recipe-btn {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.add-recipe-btn:hover {
    opacity: 0.9;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

/* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.recipe-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.recipe-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.recipe-image {
    background: linear-gradient(135deg, #fb923c 0%, #f87171 100%);
    padding: 40px;
    font-size: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 200px;
}

.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: white;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.favorite-btn:hover {
    transform: scale(1.1);
}

.recipe-content {
    padding: 20px;
}

.recipe-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 5px;
}

.recipe-category {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 600;
    margin-bottom: 12px;
}

.recipe-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #6b7280;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.view-btn:hover {
    opacity: 0.9;
}

/* Detail View */
.detail-view {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.detail-header {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: white;
    padding: 40px;
    position: relative;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.detail-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.detail-image {
    font-size: 80px;
    margin-bottom: 15px;
}

.detail-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-header p {
    opacity: 0.9;
}

.detail-fav {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    transition: background 0.3s;
}

.detail-fav:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 30px 40px;
    border-bottom: 1px solid #e5e7eb;
}

.stat-box {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
}

.stat-box.time {
    background: #fed7aa;
}

.stat-box.servings {
    background: #fecaca;
}

.stat-box.calories {
    background: #fbcfe8;
}

.stat-label {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

.stat-box.time .stat-value {
    color: #92400e;
}

.stat-box.servings .stat-value {
    color: #991b1b;
}

.stat-box.calories .stat-value {
    color: #831843;
}

/* Ingredients & Instructions */
.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

.detail-section h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

.ingredients-list {
    list-style: none;
}

.ingredients-list li {
    padding: 12px 0;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ingredients-list li::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #ea580c;
    border-radius: 50%;
    flex-shrink: 0;
}

.instructions-list {
    list-style: none;
    counter-reset: step;
}

.instructions-list li {
    margin-bottom: 15px;
    color: #374151;
    display: flex;
    gap: 12px;
}

.instructions-list li::before {
    content: counter(step);
    counter-increment: step;
    font-weight: 700;
    color: #ea580c;
    min-width: 25px;
}

/* Add Recipe Form */
.form-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-width: 700px;
    margin: 0 auto;
    overflow: hidden;
}

.form-header {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ea580c;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.cancel-btn,
.submit-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.cancel-btn {
    background: #e5e7eb;
    color: #1f2937;
}

.cancel-btn:hover {
    opacity: 0.8;
}

.submit-btn {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: white;
}

.submit-btn:hover {
    opacity: 0.9;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

/* Footer */
footer {
    background: #1f2937;
    color: white;
    text-align: center;
    padding: 30px;
    margin-top: 40px;
}

footer p {
    margin: 5px 0;
}

footer .footer-credit {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 10px;
}

/* Hidden Class */
.hidden {
    display: none;
}

/* Modal Overlay */
#addRecipeView {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
}

#addRecipeView.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-buttons {
        flex-direction: column;
        width: 100%;
    }

    .search-container {
        width: 100%;
    }

    .add-recipe-btn {
        width: 100%;
        text-align: center;
    }

    .recipe-count {
        text-align: left;
        margin-top: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .detail-content {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .detail-header {
        padding: 30px 20px;
    }

    .detail-header h1 {
        font-size: 28px;
    }

    .form-container {
        max-width: 100%;
    }

    form {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
