/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #374151;
    background: linear-gradient(135deg, #fef7ed 0%, #fef2f2 100%);
    min-height: 100vh;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.header-icon {
    font-size: 2rem;
    color: #fed7aa;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.header-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin: 0;
}

/* Main Content */
.main {
    padding: 2rem 0;
}

/* Controls */
.controls {
    margin-bottom: 2rem;
}

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

.controls-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

/* Search Section */
.search-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-bar {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

/* Sort Controls */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sort-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-right: 0.5rem;
}

.sort-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-btn:hover {
    background: #f3f4f6;
}

.sort-btn.active {
    background: #fed7aa;
    color: #9a3412;
    border-color: #fdba74;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #ea580c;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: #dc2626;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

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

.btn-secondary.active {
    background: #ea580c;
    color: white;
    border-color: #ea580c;
}

.btn-icon {
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    justify-content: center;
}

/* Food List */
.food-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Food Card */
.food-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    transition: all 0.3s;
}

.food-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.food-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.food-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
    margin-right: 1rem;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #d1d5db;
    transition: all 0.2s;
}

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

.favorite-btn.active {
    color: #dc2626;
}

.food-card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.info-item.temperature {
    background: #fef3c7;
}

.info-item.time {
    background: #dbeafe;
}

.info-item.mode {
    background: #f0fdf4;
}


.info-item i {
    font-size: 1.25rem;
}

.info-item.temperature i {
    color: #d97706;
}

.info-item.time i {
    color: #2563eb;
}

.info-content p:first-child {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.info-content p:last-child {
    font-weight: 600;
    margin: 0;
}

.info-item.temperature .info-content p:last-child {
    color: #92400e;
}

.info-item.time .info-content p:last-child {
    color: #1e40af;
}

.food-category {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 1rem;
    /* margin-bottom: 1rem; */
}

.category-meat {
    background: #fecaca;
    color: #991b1b;
}

.category-petit_dej {
    background: #ffccae;
    color: #af451e;
}

.category-fish {
    background: #bfdbfe;
    color: #1e40af;
}

.category-vegetables {
    background: #bbf7d0;
    color: #166534;
}

.category-frozen {
    background: #e9d5ff;
    color: #7c2d12;
}

.category-other {
    background: #f3f4f6;
    color: #374151;
}

.food-notes {
    background: #fef3c7;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.food-notes p {
    font-size: 0.875rem;
    color: #92400e;
    margin: 0;
}

.food-actions {
    display: flex;
    gap: 0.5rem;
}

.food-actions .btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-edit {
    background: #f3f4f6;
    color: #374151;
}

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

.btn-delete {
    background: #fecaca;
    color: #991b1b;
}

.btn-delete:hover {
    background: #fca5a5;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-message {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.empty-submessage {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* 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;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.modal-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.modal-body {
    padding: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}


.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

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

.btn-logout {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.5rem 1.2rem;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 614px) {
    .container {
        padding: 0 0.75rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header-subtitle {
        font-size: 1rem;
    }

    .search-bar {
        min-width: auto;
    }

    .sort-controls {
        justify-content: center;
    }

    .food-list {
        grid-template-columns: 1fr;
    }

    .food-card-info {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .form-row {
        gap: 0.2rem;
    }

    .info-item {
        padding: 0.75rem 0.3rem;
    }

    .btn-text {
        display: none;
    }
}

@media (max-width: 480px) {
    .btn-logout {
        position: absolute;
        top: 1rem;
        right: 1rem;
        padding: 0.25rem 0.6rem;
        font-size: 1rem;
    }

    .main {
        padding: 1rem 0;
    }

    .food-card {
        padding: 1rem;
    }

    .modal-content {
        margin: 0.5rem;
    }

    .modal-header,
    .modal-body {
        padding: 1rem;
    }
}