.fridge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #1f2937;
}

.subtitle {
    color: #6b7280;
    margin: 0;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
}

.stat-card.stat-warning {
    border-color: #fbbf24;
    background: #fef3c7;
}

.stat-card.stat-danger {
    border-color: #ef4444;
    background: #fee2e2;
}

.stat-icon {
    font-size: 2rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.main-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    border-radius: 0.75rem;
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-action.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-action.btn-secondary {
    background: white;
    color: #1f2937;
    border: 2px solid #e5e7eb;
}

.btn-action.btn-secondary:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.tabs-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
}

.tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}

.tab:hover {
    color: #1f2937;
}

.tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

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

.product-image {
    position: relative;
    width: 100%;
    height: 180px;
    background: #f3f4f6;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.badge-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-expired {
    background: #ef4444;
    color: white;
}

.badge-warning {
    background: #fbbf24;
    color: #78350f;
}

.product-body {
    padding: 1rem;
}

.product-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #1f2937;
}

.product-brand {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0;
}

.product-qty {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0;
}

.nutriscore {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0.5rem 0;
}

.nutriscore-a { background: #038141; color: white; }
.nutriscore-b { background: #85bb2f; color: white; }
.nutriscore-c { background: #fecb02; color: #333; }
.nutriscore-d { background: #ee8100; color: white; }
.nutriscore-e { background: #e63e11; color: white; }

.allergens-badge {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-dates {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.product-dates small {
    display: block;
    color: #6b7280;
    font-size: 0.75rem;
    margin: 0.25rem 0;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.btn-icon {
    flex: 1;
    padding: 0.5rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-icon.btn-success:hover {
    background: #d1fae5;
    border-color: #10b981;
}

.btn-icon.btn-danger:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 2rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.modal-dialog {
    background: white;
    border-radius: 0.75rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-dialog.modal-lg {
    max-width: 900px;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.btn-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scroll iOS */
    max-height: calc(100vh - 200px); /* Laisser place pour header et footer */
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.scanner-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #000;
    border-radius: 0.5rem;
    overflow: hidden;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scanner-line {
    width: 80%;
    height: 2px;
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00;
    animation: scanLine 2s linear infinite;
}

@keyframes scanLine {
    0%, 100% {
        transform: translateY(-100px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

.scanner-result {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.scanner-help {
    text-align: center;
    color: #6b7280;
    margin-top: 1rem;
}

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

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

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

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

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

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

@media (max-width: 1024px) {
    .fridge-header {
        flex-direction: column;
    }
    
    .stats-container {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-actions {
        flex-direction: column;
    }
    
    .tabs-container {
        overflow-x: auto;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========== PHOTO UPLOAD STYLES ========== */
.photo-upload-area {
    border: 2px dashed #ccc;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.photo-upload-area:hover {
    border-color: #007bff;
    background: #e7f1ff;
}

.photo-upload-area i {
    font-size: 2.5rem;
    color: #007bff;
    display: block;
    margin-bottom: 0.5rem;
}

.photo-upload-area p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

#photoPreview {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
}

#photoPreview img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========== AUTOCOMPLETE DROPDOWN ========== */
.autocomplete-dropdown {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-item:hover {
    background: #f5f5f5;
}

.autocomplete-item-name {
    font-weight: 500;
    color: #333;
}

.autocomplete-item-nutrition {
    font-size: 0.75rem;
    color: #999;
}

.autocomplete-item-match {
    font-size: 0.75rem;
    background: #e7f1ff;
    color: #007bff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* ========== FORM GROUP RELATIVE ========== */
.form-group {
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .photo-upload-area {
        padding: 1.5rem;
    }

    .photo-upload-area i {
        font-size: 2rem;
    }

    .autocomplete-dropdown {
        max-height: 200px !important;
    }
}
