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

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --danger-color: #ff4757;
    --light-bg: #f7f8f9;
    --border-color: #e0e0e0;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #e8d2b3;
    min-height: 100vh;
    color: var(--text-dark);
    padding: 20px;
    overflow-y: auto;
}

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

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: slideDown 0.6s ease-out;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.banner {
    margin: 0 auto 30px;
    max-width: 900px;
}

.banner img {
    width: 100%;
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
    display: block;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Search Section */
.search-section {
    margin-bottom: 30px;
    animation: slideUp 0.6s ease-out 0.1s backwards;
}

.search-bar {
    width: 100%;
    padding: 15px 20px;
    font-size: 1em;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

.search-bar:focus {
    outline: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
    animation: slideUp 0.6s ease-out 0.15s backwards;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.filter-select {
    padding: 10px 15px;
    font-size: 0.95em;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.filter-select:hover {
    border-color: var(--primary-color);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* Responsive filter controls */
@media (max-width: 600px) {
    .filter-controls {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }
}

/* Action Section */
.action-section {
    margin-bottom: 30px;
    text-align: center;
    animation: slideUp 0.6s ease-out 0.2s backwards;
}

/* Buttons */
.btn,
.btn:link,
.btn:visited {
    padding: 12px 24px;
    font-size: 1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-section a.btn {
    text-decoration: none;
}

.btn-primary {
    background: #ff9b3d;
    color: white;
}

.btn-primary:hover {
    background: #ff8521;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 155, 61, 0.3);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #ff3838;
}

/* Recipes Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    grid-auto-flow: row;
    gap: 20px;
    animation: slideUp 0.6s ease-out 0.3s backwards;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    padding-right: 8px;
}

.recipe-card {
    background: #fffdf4;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

.recipe-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    background: linear-gradient(135deg, #ff9e5d, #ffc28d);
    color: white;
    padding: 24px;
}

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

.photo-preview {
    margin-top: 12px;
}

.photo-preview img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.detail-photo img {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 20px;
}

.recipe-card-title-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recipe-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recipe-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    color: white;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    font-size: 0.9em;
    letter-spacing: 0.02em;
}

.recipe-type-badge {
    margin-top: 8px;
    background: rgba(78, 205, 196, 0.24);
    color: #1f6c60;
    font-weight: 700;
}

.recipe-section {
    margin-bottom: 36px;
}

.recipe-section h2 {
    margin-bottom: 20px;
    font-size: 1.5em;
    color: var(--text-dark);
}

.recipe-card-header h3 {
    font-size: 1.6em;
    margin: 0;
}

.recipe-status {
    font-size: 1.9em;
    padding: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.recipe-status.vegetarian {
    color: #1f7a44;
}

.recipe-status.non-vegetarian {
    color: #d9322f;
}

.recipe-difficulty {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    font-size: 0.9em;
    font-weight: 700;
    color: white;
}

.recipe-card-body {
    padding: 24px;
}

.recipe-info {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
    font-size: 0.95em;
    color: #5b6c78;
    background: #fff8e7;
    border-radius: 16px;
    padding: 18px;
}

.recipe-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recipe-description {
    color: #3e3e3e;
    line-height: 1.75;
    margin-bottom: 18px;
    min-height: 90px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}


.recipe-card-footer {
    padding: 0;
    text-align: center;
}

.btn-view {
    width: 100%;
    background: #ffb568;
    color: white;
    border-radius: 999px;
    border: none;
    box-shadow: 0 12px 24px rgba(255, 181, 104, 0.25);
}

.btn-view:hover {
    background: #ff9d3f;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: white;
    font-size: 1.2em;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--light-bg);
    padding-bottom: 15px;
}

.modal-header h2 {
    font-size: 1.8em;
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-dark);
}

/* Form */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

input,
textarea,
select {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-error {
    display: none;
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #ffe7d1;
    color: #a44a0f;
    border: 1px solid #ffcc9c;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
}

/* Detail Content */
.detail-content {
    margin-bottom: 25px;
    line-height: 1.8;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.2em;
}

.detail-section p {
    color: var(--text-dark);
    white-space: pre-wrap;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-info-box {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.detail-info-box strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.detail-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 2px solid var(--light-bg);
    padding-top: 20px;
}

.detail-actions button {
    flex: 1;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

    .modal-content {
        padding: 20px;
    }

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

    .detail-actions,
    .form-actions {
        flex-direction: column;
    }

    .detail-actions button,
    .form-actions button {
        width: 100%;
    }

    .recipe-info {
        flex-wrap: wrap;
    }
}
