/* Complete FoodSaver 2.0 CSS - Enhanced with Categories - CONFLICTS RESOLVED */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    position: relative;
}

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

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}





@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes urgentPulse {
    0%, 100% {
        transform: scale(1);
        background: #ff6b35;
    }
    50% {
        transform: scale(1.2);
        background: #e53e3e;
    }
}

/* Sections */
section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form styles with proper inline labels - CONFLICTS RESOLVED */
.form-group {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

.form-group.photo-group {
    display: block;
    clear: both;
    margin-bottom: 12px;
}

.form-group.photo-group label {
    display: block;
    margin-bottom: 10px;
    width: auto;
}

/* Food name + quantity inline layout */
.form-group.food-name-quantity-group .food-name-row,
.form-group.food-name-quantity-group .quantity-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 6px;
}

.form-group.food-name-quantity-group .quantity-row {
    margin-bottom: 0;
}

.food-name-row label {
    width: 140px;
}

.food-name-row input {
    flex: 1;
}

.quantity-row label {
    width: 140px;
}

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 0;
}

.qty-stepper input[type="number"] {
    width: 56px;
    text-align: center;
    border-radius: 0;
    flex: none;
}

.qty-btn {
    width: 40px;
    height: 100%;
    background: #667eea;
    color: white;
    border: 2px solid #667eea;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: background 0.2s;
    flex-shrink: 0;
}

#qtyMinus {
    border-radius: 8px 0 0 8px;
}

#qtyPlus {
    border-radius: 0 8px 8px 0;
}

.qty-btn:hover {
    background: #5a67d8;
    border-color: #5a67d8;
}

.qty-btn:active {
    background: #4c51bf;
    border-color: #4c51bf;
}

/* Desktop: Show quantity on same line as food name */
@media (min-width: 769px) {
    .form-group.food-name-quantity-group {
        display: flex !important;
        align-items: flex-start !important;
        gap: 20px;
    }

    .form-group.food-name-quantity-group .food-name-row {
        flex: 1;
        margin-bottom: 0;
    }

    .form-group.food-name-quantity-group .quantity-row {
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .quantity-row label {
        width: 80px;
    }
}

/* Mobile: Stack on separate lines */
@media (max-width: 768px) {
    .food-name-row label,
    .quantity-row label {
        width: 110px;
    }
}

label {
    flex-shrink: 0;
    width: 140px; /* Consistent width */
    margin: 0;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

input[type="text"],
input[type="file"],
input[type="date"],
input[type="number"] {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

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

input[type="text"]:hover,
input[type="file"]:hover,
input[type="date"]:hover,
input[type="number"]:hover {
    border-color: #cbd5e0;
}

/* ===== CATEGORY SELECT STYLES ===== */
.category-select {
    flex: 1;
    min-height: 48px;
    max-height: 120px;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: white;
    transition: border-color 0.3s ease;
    overflow-y: auto;
    cursor: pointer;
}

.form-group.categories-group .category-select {
    flex: 1;
    min-width: 0; /* Allow it to shrink */
    max-width: none; /* Remove width constraints */
    min-height: 44px; /* Slightly smaller to match other inputs */
    max-height: 80px; /* Reduce height for inline layout */
}

/* MOBILE ADJUSTMENTS */
@media (max-width: 768px) {
    .form-group.categories-group .category-select {
        min-height: 40px;
        max-height: 60px;
        font-size: 14px;
    }
}

.category-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.category-select:hover {
    border-color: #cbd5e0;
}

.category-select option {
    padding: 8px 12px;
    font-size: 16px;
    color: #4a5568;
    background: white;
    border: none;
}

.category-select option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.category-select option:hover {
    background: rgba(102, 126, 234, 0.1);
}

small {
    display: block;
    margin-top: 5px;
    margin-left: 155px; /* Align with input field */
    color: #718096;
    font-size: 14px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

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





.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}


/* Inventory stats */










/* Inventory grid */


.inventory-item {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.inventory-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}


.inventory-item.filtered-out {
    display: none;
}













.days-remaining {
    font-weight: 600;
    font-size: 16px !important;
}

.days-remaining.expiring {
    color: #c53030;
}

.days-remaining.expired {
    color: #9b2c2c;
}



/* ===== EDIT FUNCTIONALITY STYLES ===== */

/* Edit container for inline editing */
.edit-container {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
}

.edit-buttons {
    display: flex !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
}

.edit-save-btn,
.edit-cancel-btn {
    width: 24px !important;
    height: 24px !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
}

.edit-save-btn {
    background: #48bb78 !important;
    color: white !important;
}

.edit-save-btn:hover {
    background: #38a169 !important;
    transform: scale(1.1) !important;
}

.edit-cancel-btn {
    background: #e53e3e !important;
    color: white !important;
}

.edit-cancel-btn:hover {
    background: #c53030 !important;
    transform: scale(1.1) !important;
}

/* Edit input styles */
.edit-input {
    flex: 1 !important;
    padding: 4px 8px !important;
    border: 2px solid #667eea !important;
    border-radius: 4px !important;
    background: white !important;
    outline: none !important;
    min-width: 0 !important;
}

.edit-input[type="date"] {
    /* Reset to browser defaults for date inputs */
    flex: 1 !important;
    border: 2px solid #667eea !important;
    background: white !important;
    outline: none !important;
    min-width: 0 !important;
    /* Remove all other styling that might interfere */
    padding: revert !important;
    font-size: revert !important;
    font-family: revert !important;
    border-radius: revert !important;
}

.edit-input[type="number"] {
    width: 80px !important;
    text-align: center !important;
}

.edit-select {
    flex: 1 !important;
    padding: 4px 8px !important;
    border: 2px solid #667eea !important;
    border-radius: 4px !important;
    background: white !important;
    outline: none !important;
    min-width: 0 !important;
}


.edit-input:focus,
.edit-select:focus {
    border-color: #5a67d8 !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

/* Editable elements styling */


















/* Status messages */
.status-message {
    margin-top: 15px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading::before {
    content: "⏳";
    animation: spin 2s linear infinite;
}

.success {
    background: #c6f6d5;
    color: #22543d;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #9ae6b4;
    animation: slideInSuccess 0.5s ease;
}

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

.error {
    background: #fed7d7;
    color: #742a2a;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #fc8181;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

@keyframes editSuccess {
    0% {
        background: rgba(72, 187, 120, 0.2);
    }
    100% {
        background: transparent;
    }
}

@keyframes editError {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: rgba(229, 62, 62, 0.2);
    }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state p:first-child {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 300px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.notification.loading {
    background: linear-gradient(135deg, #3182ce 0%, #2d3748 100%) !important;
    color: white !important;
    opacity: 1 !important;
}

.notification.success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.notification.error {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.help-content {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ff6b35;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.help-content strong {
    color: #d69e2e;
    font-weight: 600;
}

/* Photo upload styles */
.photo-upload-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.photo-btn {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #667eea;
    border-radius: 12px;
    background: white;
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 60px;
}

.photo-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.photo-btn:active {
    transform: translateY(0);
}

.camera-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-color: #48bb78;
    color: white;
}

.camera-btn:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    border-color: #38a169;
}

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

.gallery-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    border-color: #5a67d8;
}

.photo-preview {
    margin-top: 8px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f7fafc;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.photo-preview img {
    max-width: 260px;
    max-height: 350px;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.photo-action-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    align-self: flex-start;
}

#submitBtnPhoto {
    padding: 8px 14px;
    font-size: 13px;
}

.remove-photo-btn {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: fit-content;
    flex-shrink: 0;
}

.remove-photo-btn:hover {
    background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.remove-photo-btn:active {
    transform: translateY(0);
}

/* Responsive design - MOBILE RULES CLEANED UP */
/* Mobile responsive design - UPDATED WITH SPACING FIXES + CATEGORY SUPPORT */
@media (max-width: 768px) {
    .photo-upload-options + br {
        display: none !important;
    }

    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    section {
        padding: 20px;
    }

    /* MOBILE FORM FIXES */
    .form-group.photo-group {
        margin-bottom: 10px !important; /* REDUCED: Less space on mobile */
    }

    .form-group:not(.categories-group) {
        display: flex !important;
        align-items: center !important;
        gap: 10px;
        flex-wrap: wrap !important;
    }

    /* Add specific mobile rules for categories */
    .form-group.categories-group {
        display: flex !important;
        align-items: center !important;
        gap: 10px;
        flex-wrap: nowrap !important; /* Keep categories inline on mobile */
    }

    .form-group.categories-group label {
        width: 110px !important; /* Smaller on mobile like other labels */
    }

    .form-group.photo-group {
        display: block !important; /* Keep photo section stacked */
    }

    .form-group.photo-group label {
        width: auto !important; /* ADDED: Let photo label use full width */
    }

    label {
        width: 110px !important; /* Smaller on mobile */
        font-size: 14px;
        flex-shrink: 0;
    }

    input[type="text"],
    input[type="file"],
    input[type="date"],
    input[type="number"] {
        padding: 10px;
        flex: 1;
        min-width: 0;
    }

    /* MOBILE CATEGORY SELECT */
    .category-select {
        padding: 8px 10px;
        min-height: 44px;
        max-height: 100px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    small {
        flex-basis: 100% !important; /* CHANGED: Take full width on new line */
        margin-left: 0 !important; /* CHANGED: Remove left margin */
        margin-top: 5px !important; /* CHANGED: Add top margin */
        font-size: 13px;
    }

    /* MOBILE EDIT BUTTON ADJUSTMENTS */
    .edit-save-btn,
    .edit-cancel-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 16px !important;
    }

    

    .edit-input,
    .edit-select {
        padding: 6px 10px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 32px;
    }

    



    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }

.photo-preview {
    padding: 12px;
    margin-top: 12px;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 12px;
}
    
    .photo-preview img {
        max-height: 200px;
        max-width: calc(100vw - 200px);
    }

    .remove-photo-btn {
        padding: 12px;
    }

    
}

@media (max-width: 480px) {
    

    

    .photo-preview {
        padding: 10px;
    margin-top: 12px;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
        gap: 10px;
    }
    
    .photo-preview img {
        max-height: 150px;
        max-width: calc(100vw - 60px);
    }
    
.remove-photo-btn {
    width: auto;
    padding: 8px 12px;
    flex-shrink: 0;
    height: fit-content;
}

    /* Very small screen category adjustments */
    .category-select {
        font-size: 14px;
        max-height: 80px;
    }

}

/* Category Management Modal */
.category-management-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.category-management-content {
    background: white;
    border-radius: 15px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.category-management-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px 15px 0 0;
    text-align: center;
    position: relative;
}

.category-management-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

.category-management-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.category-management-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.category-management-body {
    padding: 25px;
}

.category-management-section {
    margin-bottom: 30px;
}

.category-management-section:last-child {
    margin-bottom: 0;
}

.category-management-section h4 {
    margin: 0 0 10px 0;
    color: #4a5568;
    font-size: 1.1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.category-help-text {
    margin: 0 0 15px 0;
    color: #718096;
    font-size: 14px;
    line-height: 1.4;
}

.default-categories-grid,
.custom-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    padding: 3px 15px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: white;
    transition: all 0.2s ease;
}

.category-item.default-category {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.category-item.custom-category {
    background: #fff5f5;
    border-color: #fed7d7;
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-emoji {
    font-size: 18px;
    margin-right: 8px;
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.category-type {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #718096;
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 10px;
}

.category-actions {
    display: flex;
    gap: 5px;
    margin-left: 8px;
}

.category-edit-btn,
.category-delete-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-edit-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.category-delete-btn:hover {
    background: rgba(229, 62, 62, 0.1);
}

.no-custom-categories {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 20px;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
}

.category-management-actions {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.category-management-actions .btn {
    margin: 0 10px;
    min-width: 150px;
}

/* Category Edit Modal */
.category-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.category-edit-content {
    background: white;
    border-radius: 15px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease;
}

.category-edit-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    text-align: center;
    position: relative;
}

.category-edit-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.category-edit-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.category-edit-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.category-edit-body {
    padding: 20px;
}

.edit-form-group {
    margin-bottom: 20px;
}

.edit-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
}

.edit-form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.edit-form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.category-edit-actions {
    text-align: center;
    margin-top: 20px;
}

.category-edit-actions .btn {
    margin: 0 5px;
    min-width: 120px;
}

/* Mobile responsive for category management */
@media (max-width: 768px) {
    .category-management-content {
        margin: 10px;
        max-height: 95vh;
    }

    .category-management-header {
        padding: 20px;
    }

    .category-management-body {
        padding: 20px;
    }

    .default-categories-grid,
    .custom-categories-grid {
        grid-template-columns: 1fr;
    }

    .category-management-actions .btn {
        width: 100%;
        margin: 5px 0;
    }

    .category-edit-content {
        margin: 10px;
    }

    .category-edit-actions .btn {
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .category-item {
        padding: 10px 12px;
    }

    .category-name {
        font-size: 13px;
    }

    .category-emoji {
        font-size: 16px;
    }
}

/* ===== REPORTS SYSTEM CSS ===== */

/* ===== ENHANCED REPORTS SYSTEM CSS ===== */

/* Reports Modal */
.reports-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.reports-content {
    background: white;
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.reports-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.reports-header h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.reports-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.reports-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.reports-body {
    padding: 40px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
}

/* Reports as a tab (not modal) */
.reports-tab {
    padding: 20px;
    max-width: 800px;
}

.reports-tab-title {
    margin: 0 0 20px 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3748;
}

/* Enhanced Report Options */
.report-options {
    margin-bottom: 40px;
}









/* Enhanced Filter Selects */
.filter-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: white;
    color: #4a5568;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.filter-select:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Enhanced Checkbox Option */










/* Enhanced Reports Actions */
.reports-actions {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.reports-actions .btn {
    margin: 0 12px;
    min-width: 160px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reports-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.reports-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

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

.reports-actions .btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

/* Enhanced Report Status */
.report-status {
    margin-top: 25px;
    min-height: 50px;
    border-radius: 12px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-status .loading {
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f3ff 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.report-status .error {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 1px solid #fc8181;
    color: #c53030;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
}

/* ===== REPORT DISPLAY MODAL ENHANCEMENTS ===== */

.report-display-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(6px);
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.report-display-content {
    background: white;
    border-radius: 20px;
    width: 95%;
    max-width: 1300px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.report-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 35px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.report-title h2 {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.report-subtitle {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
    font-weight: 400;
}

.report-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.print-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
    color: white !important;
    padding: 12px 20px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4) !important;
}

.print-btn:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.5) !important;
}

/* Enhanced Report Content */
.report-content {
    padding: 35px;
    background: linear-gradient(135deg, #fafbff 0%, #ffffff 100%);
}

.report-filters {
    background: linear-gradient(135deg, #f8f9ff 0%, #edf2ff 100%);
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 35px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
}

.report-filters h4 {
    margin: 0 0 16px 0;
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-filters ul {
    margin: 0;
    padding-left: 25px;
    list-style-type: none;
    position: relative;
}

.report-filters li {
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 15px;
    font-weight: 500;
    position: relative;
    padding-left: 20px;
}

.report-filters li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
    font-size: 18px;
}

.report-filters strong {
    color: #667eea;
    font-weight: 700;
}

/* Enhanced Report Sections */
.report-section {
    margin-bottom: 5px;
    background: white;
    border-radius: 16px;
    padding: 3px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #667eea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: -0.3px;
}

.item-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Enhanced Report Table */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.report-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 12px;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    border: none;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.report-table td {
    padding: 3px 3px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    vertical-align: top;
    transition: background 0.2s ease;
}

.report-table tr:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f7ff 100%);
}

.report-table tr:last-child td {
    border-bottom: none;
}

/* Enhanced Row Status Colors */
.report-row.expired {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 20%);
}

.report-row.expired:hover {
    background: linear-gradient(135deg, #fed7d7 0%, #fbb6ce 100%);
}

.report-row.expiring {
    background: linear-gradient(135deg, #fffbf0 0%, #fef3c7 20%);
}

.report-row.expiring:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.report-row.fresh {
    background: linear-gradient(135deg, #f0fff4 0%, #dcfce7 20%);
}

.report-row.fresh:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

/* Enhanced Table Column Styling */
.item-name {
    font-weight: 700;
    color: #2d3748;
    width: 25%;
    font-size: 15px;
}

.categories {
    width: 20%;
    font-size: 12px;
    color: #4a5568;
    line-height: 1.4;
}

.added-date,
.use-by-date {
    width: 15%;
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}









.no-items {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 50px 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    margin-top: 20px;
    font-size: 16px;
}

/* ===== MOBILE RESPONSIVE ENHANCEMENTS ===== */
@media (max-width: 768px) {
    .reports-content {
        margin: 10px;
        max-height: 95vh;
        border-radius: 16px;
    }

    .reports-header {
        padding: 25px;
        border-radius: 16px 16px 0 0;
    }

    .reports-header h3 {
        font-size: 1.4rem;
    }

    .reports-body {
        padding: 25px;
    }

    

    

    

    .reports-actions .btn {
        width: 100%;
        margin: 8px 0;
        min-width: auto;
    }

    .report-display-content {
        width: 98%;
        margin: 10px;
        max-height: 95vh;
        border-radius: 16px;
    }

    .report-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        border-radius: 16px 16px 0 0;
    }

    .report-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .report-content {
        padding: 25px;
    }

    .report-table {
        font-size: 12px;
    }

    .report-table th,
    .report-table td {
        padding: 10px 6px;
    }

    .section-title {
        font-size: 1.2rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .report-section {
        padding: 20px;
        margin-bottom: 30px;
    }
}

@media (max-width: 480px) {
    .report-table th,
    .report-table td {
        padding: 8px 4px;
        font-size: 11px;
    }

    .item-name {
        width: 30%;
        font-size: 12px;
    }

    .categories {
        width: 18%;
        font-size: 10px;
    }

    .added-date,
    .use-by-date {
        width: 12%;
        font-size: 10px;
    }



    .reports-actions {
        flex-direction: column;
        gap: 12px;
    }

    .reports-actions .btn {
        width: 100%;
    }

    

    

    
}

/* Add this CSS to your style.css file - Compact Reports Modal Styling */

/* Compact Report Options Layout */
.report-options-compact {
    margin-bottom: 30px;
}

.option-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.option-label {
    flex-shrink: 0;
    width: 140px;
    margin: 0;
    font-weight: 700;
    color: #2d3748;
    font-size: 14px;
}

.option-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Inline Radio Buttons */
.radio-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    margin: 0;
}

.radio-inline input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

/* Compact Filter Selects */
.filter-select-compact {
    flex: 1;
    max-width: 300px;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #4a5568;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-select-compact:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-select-compact:hover {
    border-color: #cbd5e0;
}

/* Inline Checkbox */
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    margin: 0;
}

.checkbox-inline input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

/* Responsive adjustments for compact layout */
@media (max-width: 768px) {
    .option-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }

    .option-label {
        width: auto;
        margin-bottom: 5px;
    }

    .option-content {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .radio-inline {
        width: 100%;
    }

    .filter-select-compact {
        width: 100%;
        max-width: none;
    }

    .checkbox-inline {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .option-row {
        padding: 10px;
        margin-bottom: 15px;
    }

    .option-label {
        font-size: 13px;
    }

    .radio-inline,
    .checkbox-inline {
        font-size: 13px;
    }

    .filter-select-compact {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* Date rows */
.added-date,
.use-by-date {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    width: 100%;
}

.added-date::before {
    content: "Added:";
    font-weight: 600;
    color: #4a5568;
    min-width: 50px;
    flex-shrink: 0;
}

.use-by-date::before {
    content: "Use by:";
    font-weight: 600;
    color: #4a5568;
    min-width: 50px;
    flex-shrink: 0;
}

.added-date::before,
.use-by-date::before {
    display: inline-block;
}


/* Make categories inline like other form elements */
.form-group.categories-group {
    display: flex !important;
    align-items: center !important;
    gap: 15px;
    flex-wrap: nowrap !important;
}

.form-group.categories-group label {
    flex-shrink: 0;
    width: 140px; /* Same as other labels */
    margin: 0;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

.form-group.categories-group .category-select {
    flex: 1;
    min-width: 0;
}

/* Mobile override to keep stacked on small screens */
@media (max-width: 768px) {
    .form-group.categories-group {
        display: flex !important;
        align-items: center !important;
        gap: 10px;
        flex-wrap: wrap !important;
    }

    .form-group.categories-group label {
        width: 110px !important; /* Smaller on mobile like other labels */
    }
}

/* Force any multiple select (categories) to be inline */
.form-group:has(select[multiple]) {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex-wrap: nowrap !important;
}

.form-group:has(select[multiple]) label {
    width: 140px !important;
    flex-shrink: 0 !important;
}

.form-group:has(select[multiple]) select {
    flex: 1 !important;
    min-width: 0 !important;
    max-height: 80px !important;
}


/* TRY THIS MORE SPECIFIC TARGET FOR THE HIGHLIGHT CHECKBOX */
@media (max-width: 768px) {
    /* Target the specific checkbox container */
    

    /* Make sure checkbox doesn't shrink */
    .inventory-controls input[type="checkbox"],
    #showExpiring {
        flex-shrink: 0 !important;
        margin-top: 2px !important;
        width: 18px !important;
        height: 18px !important;
    }

    /* Force text to take remaining width */
    

    /* Alternative: Target the inventory controls container */
    .inventory-controls {
        width: 100% !important;
    }

    
}

/* Fix reports modal checkbox text width - ALL screen sizes */
.reports-modal .checkbox-inline{
    width: 100% !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
}

/* Keep checkbox normal size */
.reports-modal .checkbox-inline input[type="checkbox"]{
    flex-shrink: 0 !important;
    margin-top: 2px !important;
    width: 18px !important;
    height: 18px !important;
}

/* Text takes full available width */
.reports-modal .checkbox-inline span{
    flex: 1 !important;
    word-wrap: break-word !important;
    line-height: 1.4 !important;
    text-align: left !important;
}

/* Make sure containers are full width */
.reports-modal .option-content,
.reports-modal .option-row {
    width: 100% !important;
}

/* =====================================
   Standard Table Font Sizing
   ===================================== */
.report-table td,
.report-table th {
    font-size: 13px;
}

/* =====================================
   Clean Status Column Styling (Text Style)
   ===================================== */
.report-table td.status {
    vertical-align: top;
    padding: 3px 3px;
    font-weight: 600;
    font-size: 13px;
    white-space: normal;
    word-break: break-word;
    text-align: left;
}

/* =====================================
   Status Color Variants
   ===================================== */
.report-table td.status.fresh {
    color: #1b7f48;
    background-color: #e6f7ec;
}

.report-table td.status.expiring {
    color: #996600;
    background-color: #fff9db;
}

.report-table td.status.expired {
    color: #a94442;
    background-color: #fbeaea;
}


/* Used item container styling */




/* Used overlay badge on photo */




/* Used date display */


/* Muted styling for used item text */










/* Used items in grayed out photo */




/* Different button styling for used items */




/* Special styling for "Delete Record" button */




/* Mobile adjustments */


/* Print styles for used items */


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

.star {
    cursor: pointer;
    color: #e2e8f0; /* light gray when unselected */
    transition: all 0.2s ease;
    user-select: none;
}

.star.selected {
    color: #f59e0b; /* gold/orange when selected */
}

.star:hover {
    transform: scale(1.2);
}

/* Item Rating Display Styles */






/* Used item rating styling */




/* Mobile responsive rating styles */


/* Rating in reports */




/* Print styles for ratings */


/* Unmark as Used button styling */




/* Specific styling for unmark button */




/* Enhanced delete button for used items */




/* Mobile responsive adjustments for used item actions */




/* Enhanced CSS for Notes Display in Used Items */

/* Item Notes Styling */






/* Expandable Notes Styling */








/* Enhanced Rating Display for Used Items */






/* Used Date Enhanced Styling */




/* Enhanced Button Styling for Used Items */




/* Enhanced Delete Button for Used Items */




/* Used Item Actions Enhanced Layout */




/* Mobile Responsive Adjustments for Notes */




/* Print Styles for Notes */


/* Accessibility Enhancements */


/* High Contrast Mode Support */


/* Reduced Motion Support */


/* Enhanced Report Table Styles with Notes Support */

/* Report table enhancements for notes and ratings */
.report-table th.rating,
.report-table th.notes {
    min-width: 80px;
    text-align: center;
}

.report-table td.rating {
    text-align: center;
    vertical-align: middle;
    padding: 8px 6px;
    font-size: 12px;
}

.report-table td.notes {
    max-width: 200px;
    vertical-align: top;
    padding: 8px 6px;
    word-wrap: break-word;
    font-size: 11px;
    line-height: 1.3;
}

.report-table .rating-stars {
    font-size: 14px;
    color: #ffd700;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.report-notes {
    color: #2d3748;
    line-height: 1.4;
    font-size: 11px;
    max-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.report-notes:hover {
    background: rgba(102, 126, 234, 0.05);
    cursor: help;
}

/* Used row styling enhancements */
.report-row.used {
    background: linear-gradient(135deg, #f0fff4 0%, #dcfce7 100%);
    border-left: 3px solid #48bb78;
}

.report-row.used:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.report-row.used .item-name {
    color: #2d3748;
    font-weight: 600;
}

.report-row.used .status {
    color: #16a34a;
    font-weight: 600;
    background: rgba(72, 187, 120, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Enhanced column widths for reports with notes */
















/* Mobile responsive adjustments for enhanced reports */
@media (max-width: 768px) {
    .report-table {
        font-size: 10px;
    }

    .report-table td.notes {
        max-width: 120px;
        font-size: 9px;
    }

    .report-table td.rating {
        font-size: 10px;
    }

    .report-table .rating-stars {
        font-size: 11px;
    }

    .report-notes {
        font-size: 9px;
        max-height: 40px;
        -webkit-line-clamp: 3;
    }

    /* Stack columns on very small screens */
    

    /* Show notes in a separate row on mobile */
    
}

@media (max-width: 480px) {
    .report-table th,
    .report-table td {
        padding: 4px 2px;
        font-size: 9px;
    }

    .report-table td.notes,
    .report-table td.rating {
        display: none;
    }

    .report-notes {
        display: none;
    }

    /* Show essential columns only on very small screens */
    

    

    

    
}

/* Print styles for reports with notes */
@media print {
    .report-table td.notes {
        max-width: none;
        font-size: 8px;
        line-height: 1.2;
    }

    .report-notes {
        max-height: none;
        overflow: visible;
        -webkit-line-clamp: none;
        display: block;
    }

    .report-table .rating-stars {
        color: #333 !important;
        text-shadow: none !important;
    }

    .report-row.used {
        background: #f5f5f5 !important;
        border-left: 2px solid #999 !important;
    }

    .report-row.used .status {
        background: #e5e5e5 !important;
        color: #333 !important;
    }

    /* Ensure notes are readable in print */
    .report-table td.notes {
        page-break-inside: avoid;
    }
}

/* Accessibility enhancements for reports with notes */
.report-notes:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support for reports */
@media (prefers-contrast: high) {
    .report-row.used {
        background: #fff !important;
        border-left: 3px solid #000 !important;
    }

    .report-row.used .status {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }

    .report-table .rating-stars {
        color: #000 !important;
        text-shadow: none !important;
    }

    .report-notes {
        color: #000 !important;
    }
}

/* Image Modal Styles - Add to style.css */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    animation: zoomIn 0.3s ease-out;
}

.modal-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-title {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

/* Loading state */
.modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    text-align: center;
}

.modal-loading::after {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    margin: 10px auto;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Mobile adjustments */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }

    .modal-close {
        top: -35px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .modal-title {
        bottom: -45px;
        font-size: 16px;
        padding: 8px 15px;
    }
}

/* Inventory card image cursor change */









/* Storage selection modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.storage-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.storage-option-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.cancel-split {
    background: #e2e8f0;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 8px;
}


/* ================================
   Inventory Card — BASE (desktop & mobile)
   ================================ */
/* wrapper + title */
.inventory-item .item-details {
  padding: 0px 10px;
}
.inventory-item .item-details h3 {
  margin: 0 0 4px 0;
}

/* every row line (Quantity, Storage, Categories, Added, Use by) */
.inventory-item .item-details p, .inventory-item .storage-type, .inventory-item .added-date, .inventory-item .use-by-date{
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  line-height: 0.5;
  min-height: 0; /* remove any floors */
  overflow: hidden;
}

/* keep icons/emojis from inflating line height */
.inventory-item .item-details p img,
.inventory-item .item-details p svg {
  width: 16px;
  height: 6px;
  vertical-align: middle;
}

/* Quantity label (this is a <strong>) */
.inventory-item .item-details .quantity > strong {
  font-weight: 600;
  font-size: 14px;
  color: #475569; /* slate-600 */
  line-height: 0.5;
  margin-right: 4px;
}

/* Storage label (pseudo for consistency) */
.storage-type::before {
  content: "Storage:";
  font-weight: 600;
  font-size: 14px;
  color: #475569;
  line-height: 1.05;
  margin-right: 4px;
}

/* Categories row + label + chips */




/* Dates + labels */
.added-date::before {
  content: "Added:";
  font-weight: 600;
  font-size: 14px;
  color: #475569;
  line-height: 1.05;
  margin-right: 4px;
}
.use-by-date::before {
  content: "Use by:";
  font-weight: 600;
  font-size: 14px;
  color: #475569;
  line-height: 1.05;
  margin-right: 4px;
}

/* "days remaining" text */
.inventory-item .days-remaining {
  margin-top: 4px;
}

/* ================================
   Inventory Card — MOBILE ONLY
   ================================ */
@media (max-width: 768px) {

  /* collapse tall editable spans that were forcing 32px height */
  

  
  
  /* make labels shrink, never fixed-width on phone */
  .added-date::before, .use-by-date::before, .storage-type::before{
    min-width: 0;
    width: auto;
    font-size: 14px;
    margin-right: 4px;
    line-height: 1.75;
  }

/* Normalize all inline editable fields */
.inventory-item .item-details [class^="editable-"] {
  min-height: 0;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
}
}

/* Make the Quantity label match the others */


/* Ensure the four ::before labels use the same style */
.storage-type::before, .added-date::before, .use-by-date::before{
  font-weight: 600;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin-right: 4px;
}



/* === Card === */
.inventory-item.inv-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Image */


/* Body */


/* Title row */
.inv-card .inv-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: none;
  margin-bottom: 6px;
}



/* Meta list */




.inv-card .badge {
  font-size: .75rem;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  background: #edf2f7;
  color: #2d3748;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Footer actions */
.inv-card .inv-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
}

/* Match sort direction button to the height of the select */
.inv-sort-dir {
    padding: 6px 10px;
    height: 38px;              /* matches the .title-select height */
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: #edf2f7;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inv-card .btn {
  appearance: none;
  border: 1px solid #cbd5e0;
  background: #f8fafc;
  color: #1f2937;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}

.inv-card .btn:disabled { opacity: .6; cursor: default; }

.inv-card .btn-success {
  border-color: #16a34a;
  background: #22c55e;
  color: #fff;
}

.inv-card .btn-ghost {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #111827;
}

/* “100 days remaining” style */


/* Controls row */



.btn-ghost { border:1px solid #e2e8f0; background:#f1f5f9; border-radius:8px; padding:6px 10px; cursor:pointer; }

/* Stat pills */
.stat-row { display:flex; gap:10px; margin:10px 0 12px; flex-wrap:wrap; }
.pill { display:inline-block; padding:6px 10px; border-radius:999px; background:#eef2ff; color:#1e40af; font-weight:600; }
.pill-warn { background:#fff7ed; color:#c2410c; }
.pill-danger { background:#fee2e2; color:#b91c1c; }

/* Category headers (when grouped) */
.cat-header { grid-column: 1 / -1; margin:14px 4px 6px; font-size:1.05rem; font-weight:700; color:#0f172a; }
.cat-count { font-weight:600; color:#475569; }

/* Highlight states */
/* ---------- Expiring Soon (7 days) ---------- */
.inv-card.expiring-soon {
    border: 10px solid #ffb100 !important;    /* vivid amber border */
    box-shadow: 0 0 15px rgba(255, 176, 0, 0.5) !important; 
    background: linear-gradient(
        135deg,
        #fff7d1 0%,
        #fff2b1 100%
    ) !important;
}

/* Grid remains 1 / 2 / 3 across */
#inventoryList { display:grid; grid-template-columns:1fr; gap:16px; }
@media (min-width:640px){ #inventoryList{ grid-template-columns:repeat(2,1fr);} }
@media (min-width:1024px){ #inventoryList{ grid-template-columns:repeat(3,1fr);} }

/* Inline edit rows (view <-> edit) */
.ie-row { display:flex; gap:8px; align-items:center; margin:6px 0; }
.ie-row .label { min-width:80px; font-weight:600; color:#475569; }
.ie-row .view { display:flex; align-items:center; gap:6px; cursor:pointer; }
.ie-row .hint { font-size:.85rem; color:#64748b; opacity:0; transition:opacity .15s; }
.ie-row:hover .hint { opacity:1; }

.ie-row .edit { display:none; gap:6px; align-items:center; }
.ie-row.show-edit .view   { display:none; }
.ie-row.show-edit .edit   { display:flex; }

.ie-row,
.ie-row .label,
.ie-row input,
.ie-row select,
.ie-row textarea {
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
}
.ie-row input[type="text"],
.ie-row input[type="number"],
.ie-row input[type="date"],
.ie-row textarea {
  padding:6px 8px; border:1px solid #cbd5e0; border-radius:8px;
}
.ie-row textarea { width:100%; max-width:280px; height:60px; }

.btn.small { padding:6px 10px; font-weight:600; border-radius:8px; border:1px solid #cbd5e0; background:#f8fafc; cursor:pointer; }
.btn.small.ghost { background:#f1f5f9; }

/* Qty spinner (+/- buttons, inventory cards) */
.qty-spinner { display:flex; align-items:center; gap:4px; }
.ie-row .qty-btn { display:none; align-items:center; justify-content:center; width:32px; height:32px; border-radius:50%; border:1px solid #cbd5e0; background:#f8fafc; color:#334155; font-size:1.2rem; font-weight:700; cursor:pointer; padding:0; line-height:1; flex-shrink:0; }
@media (max-width:640px) { .ie-row .qty-btn { display:flex; } }
.split-hidden { display:none !important; }

/* ===== Inventory toolbar ===== */
.inv-toolbar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  padding: 12px 14px;
  margin: 8px 0 12px;
}

.inv-toolbar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Title + location select */
.inv-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #0f172a;            /* dark slate */
  font-size: 1.25rem;        /* consistent, readable */
}
.inv-title .title-select {
  padding: 8px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  font-size: 1rem;
}

/* Sort block */





/* Toggles (checkboxes) */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-weight: 600;
  margin-left: 6px;
}
.toggle input { transform: translateY(1px); }

/* Phone-only tweaks for simple inventory toolbar */
/* Phone-only tweaks for simple inventory toolbar */
@media (max-width: 768px) {

    /* Stack title + controls instead of one long row */
    .inv-toolbar-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Title + location: text above, dropdown below, full width */
    .inv-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        font-size: 1.1rem;
    }

    .inv-title .title-select {
        width: 100%;        /* ⬅ full width so you see “(52)” etc. */
        max-width: 100%;
        font-size: 1rem;
        font-weight: normal;
    }

    /* Sort row: label + select + arrow in a neat row */
    

    

    

    /* Checkboxes: one line each, no wrapping */
    .toggle {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: 0;
        font-size: 0.9rem;
        white-space: nowrap;      /* keep label on one line */
    }

    .toggle input {
        flex-shrink: 0;
        margin-top: 0;
    }

    .toggle span {
        flex: 1 1 auto;
        white-space: nowrap;      /* prevent “Highlight expiring…” from breaking */
        line-height: 1.3;
    }
}



/* Stat pills (more contrast) */
.stat-row {
  display: flex;
  gap: 10px;
  margin: 10px 0 0;
  flex-wrap: wrap;
}
.pill       { background:#eef2ff; color:#1e40af; }
.pill-warn  { background:#fff7ed; color:#9a3412; }
.pill-danger{ background:#fee2e2; color:#991b1b; }
.pill {
  display:inline-block; padding:6px 12px; border-radius:999px;
  font-weight:700; font-size:.95rem;
}

.stars { font-size: 1rem; color: #f59e0b; } /* gold-ish stars */

/* =========================================
   Main Tabs (Add / Inventory / Settings)
========================================= */
.main-tabs {
    display: flex;
    gap: 4px;
    margin: 4px 0 8px;
    border-bottom: 1px solid #e2e8f0;
}

.main-tab {
  flex: 1;
  text-align: center;
  border: none;
  background: transparent;
  padding: 8px 0;
  cursor: pointer;
  border-radius: 999px 999px 0 0;
  font-size: 20px;
  color: #ffffff;
  font-weight: 700;
}

.main-tab:hover {
  background: #edf2f7;
    background-color: gainsboro;
  color: lightgray;
/**/  color: #1a202c;           /* ensure black on hover */
}

.main-tab.active {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-bottom-color: #ffffff;
  color: #1a202c;
  box-shadow: 0 -1px 0 #ffffff inset;
  font-weight: 900;         /* slightly bolder for visibility */
}

/* Generic tab panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Small tweak for mobile so tabs don’t feel cramped */
@media (max-width: 768px) {
  .main-tab {
    padding: 6px 0;
    font-size: 13px;
  }
}

/* Make Add, Inventory, and Settings panels line up horizontally */
.upload-section{
    margin: 8px auto 0;
    width: 100%;
}

.upload-section .upload-title, h2.upload-title{
    font-size: 1.75rem;   /* or whatever size you like */
    font-weight: 700;
    line-height: 1.2;
}


/* Prevent horizontal shift between tabs due to scrollbars */
html {
    overflow-y: scroll;
}

/* Settings header spacing */
.settings-header h2.upload-title {
    margin-bottom: 20px;
}

/* Base Settings Button */
.settings-btn {
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

/* Gray / Neutral Button */


/* Primary Blue Button */
.settings-btn--primary {
    background: #667eea;
    color: white;
    font-weight: 600;
}

/* Slight Hover Effects */


.settings-btn--primary:hover {
    background: #5a67d8;
}















/* =====================================
   Storage Locations modal layout
   ===================================== */

/* Keep the modal itself a bit narrower */


/* ===========================
   Storage Locations Manager
   =========================== */



/* Save button row at bottom of modal */




/* Make inventory item rows more compact */
.inventory-item.inv-card .ie-row {
  margin: 2px 0;        /* was 6px 0 */
  gap: 4px;             /* was 8px, optional but helps tighten */
}

.inventory-item.inv-card .ie-row .label {
  line-height: 1.0;     /* keep labels from adding extra height */
}

/* Add a little padding below the action buttons in each inventory card */
.inventory-item.inv-card .inv-actions {
    padding-bottom: 8px;      /* adjust 6–12px as desired */
}

/* Also reduce gap BETWEEN rows but keep spacing above buttons readable */
.inventory-item.inv-card {
    padding-bottom: 6px;      /* maintains card breathing room */
}

/* Crop inventory photos to a uniform height */
.inventory-item.inv-card img.thumb {
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: center center;
    border-radius: 8px 8px 0 0;
}

/* Expired cards: soft pink background + red frame */
.inventory-item.inv-card.expired {
    background-color: #fff0f3  !important;   /* light pink, not purple */
    border-color: #e53e3e;
    box-shadow: inset 0 0 0 3px #b91c1c;
}

/* Let content inherit the card background */
.inventory-item.inv-card.expired .item-details {
    background-color: transparent !important;
}

/* Days remaining line when expired/negative */
.inv-card .ie-row.dr-expired,
.inv-card .ie-row.dr-expired .view,
.inv-card .ie-row.dr-expired .view *,
.inv-card .ie-row.dr-expired * {
    color: #d80000 !important;
    font-weight: 700;
}

/* ======================================
   Base styles for simple-inventory filters
   ====================================== */
.inv-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inv-toggle {
    font-size: 1rem;
    font-weight: 500;       /* normal-ish, not bold */
    color: #334155;         /* same as other text */
    white-space: nowrap;    /* keep on one line */
}
.inv-toggle span {
    white-space: nowrap;    /* prevent wrapping */
}

/* ================================
   Phone-only fixes for filter layout
   ================================ */
@media (max-width: 768px) {

    /* Keep labels and dropdowns side-by-side */
    .inv-filter-row, .inv-title{
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        width: 100%;
    }

    /* Make the dropdowns narrower and consistent */
    select.title-select, .inv-filter-row select{
        width: auto;
        max-width: 75%;
        /*font-size: 1rem;       normal weight */
        font-size: 16px;      /* normal weight */
        font-weight: normal;  /* remove bold */
    }

    /* Prevent them from stretching full width */
    .inv-filter-row select {
        flex: 0 1 75%;
    }

    /* Reduce label size slightly to match dropdowns */
    .inv-label, .inv-title-text{
        font-size: 1rem;
        font-weight: Bold;
        white-space: nowrap;
    }

    /* Reduce visual dominance on phone */
    .inv-title-text {
        margin-bottom: 4px;
    }
}

/* =========================================
   FINAL phone-only fixes for inventory toolbar
   ========================================= */
@media (max-width: 768px) {

  /* Stack header content vertically */
  .inv-toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* Put the text on one line and the select below it,
     both taking full card width */
  .inv-title {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .inv-title > span {
    font-size: 1rem;
    font-weight: 600;
  }

  .inv-title form {
    width: 100%;
  }

  /* 🔹 LOCATION DROPDOWN: full screen width on phone */
  .inv-title .title-select {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.95rem;
    font-weight: normal;
  }

  /* 🔹 SORT ROW: "Sort" + dropdown + arrow aligned in one line */
  

  

  

  

  /* 🔹 CHECKBOXES: single line each, no wrapping */
  

  

  
}

/* Keep Sort select + direction arrow on the same line */
.inv-sort-controls {
    display: inline-flex;      /* stay together */
    flex-direction: row;
    align-items: center;
    gap: 6px;
    white-space: nowrap;       /* prevents wrapping */
}

/* Make the select shrink instead of pushing the arrow down */
.inv-sort-controls select {
    width: auto;
    max-width: 100%;
    flex: 0 1 auto;            /* prevent full-width expansion */
}

/* Ensure the arrow button matches height & stays inline */
.inv-sort-dir {
    height: 38px;              /* match select height */
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    background: #edf2f7;
    font-size: 1rem;
    color: black;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Show only the active tab panel */
.container [data-tab-panel].active {
    display: block !important;
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 1 !important;
}