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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #1a202c;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    gap: 30px;
}

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

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.logo-text h1 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
}

.logo-text p {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Search Section */
.search-section {
    background: white;
    padding: 25px 0;
    border-bottom: 1px solid #e2e8f0;
}

.search-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 15px;
    align-items: center;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="text"]::placeholder {
    color: #a0aec0;
}

/* Main Content */
main {
    padding: 40px 0;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    justify-content: center;
    margin: 0 auto;
    max-width: 1200px;
}

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

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    border-color: #667eea;
}

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

.recipe-category {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
    gap: 12px;
}

.recipe-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.3;
}

.rating {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.star {
    color: #fbbf24;
    font-size: 16px;
}

.star.empty {
    color: #e2e8f0;
}

.recipe-meta {
    font-size: 13px;
    color: #718096;
    margin-bottom: 12px;
}

.recipe-notes {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #f7fafc;
    color: #4a5568;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    overflow-y: auto;
    padding: 40px 20px;
}

.modal-content {
    background: white;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
}

.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.close {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 28px;
    cursor: pointer;
    color: #a0aec0;
    line-height: 1;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #1a202c;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

input[type="url"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

input[type="url"]:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.rating-input {
    display: flex;
    gap: 8px;
    font-size: 28px;
}

.rating-input span {
    cursor: pointer;
    color: #e2e8f0;
    transition: all 0.2s;
}

.rating-input span:hover,
.rating-input span.active {
    color: #fbbf24;
    transform: scale(1.1);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
}

.btn-danger {
    background: #fc8181;
    color: white;
}

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

.empty-state {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h2 {
    font-size: 24px;
    color: #2d3748;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: #718096;
}

.recipe-detail-notes {
    background: #fffbeb;
    border-left: 4px solid #fbbf24;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.recipe-detail-notes strong {
    color: #92400e;
    display: block;
    margin-bottom: 8px;
}

.recipe-detail-source {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.recipe-detail-source a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.recipe-detail-source a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .header-actions {
        width: 100%;
        justify-content: stretch;
    }

    .header-actions .btn {
        flex: 1;
    }

    .search-controls {
        grid-template-columns: 1fr;
    }

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

    .logo-text h1 {
        font-size: 20px;
    }
}