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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(to bottom right, #fff5f0, #ffe5e5, #fffae5);
    min-height: 100vh;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: 2px solid #e35640;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

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

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: #e35640;
}

.header-title h1 {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
}

.header-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
}

.btn-admin {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e5e7eb;
    color: #374151;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-admin:hover {
    background: #d1d5db;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    padding-bottom: 120px;
}

/* Counter Box */
.counter-box {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.counter-number {
    font-size: 2rem;
    font-weight: bold;
    color: #e35640;
}

.counter-text {
    color: #6b7280;
}

.counter-hint {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* Category Section */
.category-section {
    margin-bottom: 1.5rem;
}

.category-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.category-box {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 1rem;
}

.ingredients-grid {
    display: grid;
    gap: 0.5rem;
}

/* Ingredient Item */
.ingredient-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
    cursor: pointer;
}

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

.checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    cursor: pointer;
}

.checkbox.checked {
    background: #e35640;
    border-color: #e35640;
}

.checkbox.disabled {
    background: #e5e7eb;
    border-color: #d1d5db;
    cursor: not-allowed;
}

.checkbox svg {
    width: 16px;
    height: 16px;
    color: white;
    display: none;
}

.checkbox.checked svg {
    display: block;
}

.ingredient-name {
    flex: 1;
    font-size: 1rem;
    color: #374151;
    user-select: none;
}

.ingredient-name.selected {
    font-weight: 600;
    color: #1f2937;
}

.ingredient-name.unwanted {
    color: #9ca3af;
    text-decoration: line-through;
}

.ingredient-name.disabled {
    color: #9ca3af;
}

.btn-unwanted {
    padding: 0.25rem 0.75rem;
    border: 2px solid transparent;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #f3f4f6;
    color: #6b7280;
    flex-shrink: 0;
}

.btn-unwanted.active {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.btn-unwanted:hover {
    background: #e5e7eb;
}

.btn-unwanted.active:hover {
    background: #fecaca;
}

/* Fixed Bottom Bar */
.fixed-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    border-top: 2px solid #e35640;
    padding: 1rem;
    z-index: 50;
}

.fixed-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
}

.btn-search {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-search.active {
    background: linear-gradient(to right, #e35640, #c94a35);
    color: white;
}

.btn-search.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 86, 64, 0.4);
}

.btn-search.disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Results Page */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e35640;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

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

.results-section {
    margin-bottom: 2rem;
}

.results-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-title svg {
    width: 24px;
    height: 24px;
}

.results-grid {
    display: grid;
    gap: 0.75rem;
}

.recipe-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.recipe-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.recipe-card.exact {
    border-left: 4px solid #10b981;
}

.recipe-card.partial {
    border-left: 4px solid #e35640;
}

.recipe-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.recipe-ingredients {
    margin-top: 0.5rem;
}

.ingredients-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ingredients-label.has {
    color: #059669;
}

.ingredients-label.missing {
    color: #dc2626;
}

.ingredients-text {
    font-size: 0.875rem;
    color: #4b5563;
}

.ingredients-text.missing {
    font-weight: 500;
}

.no-results {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 2rem;
    text-align: center;
}

.no-results svg {
    width: 64px;
    height: 64px;
    color: #e35640;
    margin: 0 auto 1rem;
}

.no-results h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: #6b7280;
}

/* Modal */
.modal-overlay {
    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;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 100%;
    padding: 2rem;
}

.modal h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: #e35640;
    box-shadow: 0 0 0 3px rgba(227, 86, 64, 0.1);
}

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.modal-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.btn-primary {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: #e35640;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

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

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: #e5e7eb;
    color: #374151;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

.modal-hint {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    margin-top: 1rem;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #e35640;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
    }
    
    .counter-number {
        font-size: 1.75rem;
    }
    
    .category-title {
        font-size: 1.125rem;
    }
    
    .results-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0.75rem 1rem;
    }
    
    .header-title h1 {
        font-size: 1.25rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .btn-search {
        font-size: 1rem;
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}
