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

html {
    height: 100%;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
    height: 100vh;
    transition: opacity .3s ease-in-out;
    opacity: 1;
}

.container {
    margin: 0 auto;
    height: 100%;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2.5rem;
}

/* ========== ROW STATUS STYLES ========== */
tr.expired {
    background-color: #f8d7da !important;
    border-left: 4px solid #dc3545;
}

tr.expired td {
    color: #721c24;
    font-weight: bold;
}

tr.expired:hover {
    background-color: #f1b0b7 !important;
}

tr.safe {
    background-color: #d4edda !important;
    border-left: 4px solid #28a745;
}

tr.safe td {
    color: #155724;
}

tr.safe:hover {
    background-color: #c3e6cb !important;
}

tr.warning {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
}

tr.warning td {
    color: #856404;
    font-weight: 500;
}

tr.warning:hover {
    background-color: #ffeaa7 !important;
}

tr.discarded {
    background-color: #d1ecf1 !important;
    border-left: 4px solid #0c5460;
    opacity: 0.8;
}

tr.discarded td {
    color: #0c5460;
    font-style: italic;
}

tr.discarded:hover {
    background-color: #bee5eb !important;
}

/* Time indicators - shared base styles */
tr td small {
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-wrap-mode: nowrap;
}

/* Expired time indicator - urgent red with pulse */
tr.expired td small {
    color: #ffffff;
    background: #dc3545;
    animation: pulse 2s infinite;
}

/* Warning time indicator - pink highlight */
tr.warning td small {
    color: #d63384;
    background: rgba(214, 51, 132, 0.1);
}

/* Violation time indicator - red background for late discards */
tr.discarded td small {
    font-weight: 700;
    color: #ffffff;
    background: #dc3545;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.pizza-grid-container-container {
    overflow-y: scroll;
    height: 100%;
}

.data-grid {
    overflow-y: scroll;
    height: 100%;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
    height: 100vh;
    transition: opacity .3s ease-in-out;
    opacity: 1;
}

.container {
    margin: 0 auto;
    height: 100%;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2.5rem;
}

.pizza-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.pizza-item {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: relative;
    cursor: pointer;
}

.pizza-item:hover {
    transform: translateY(-5px);
}

.pizza-image {
    width: 100%;
    height: 100px;
    background-size: cover;
    background-position: center;
    background-color: #ddd;
    position: relative;
}

.price-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #d32f2f;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
}

.pizza-content {
    padding: 5px;
}

.pizza-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.pizza-description {
    color: #666;
    line-height: 1.4;
    font-size: 0.9rem;
}

/* Data Grid Styles */
.data-grid-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
    max-width: 50%;
}

.data-grid-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    overflow-y: hidden;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.data-table td:first-child {
    text-align: left;
}

.data-table td:last-child {
    text-align: end;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.data-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

/* Status indicators */
.status-fresh {
    color: #28a745;
    font-weight: bold;
}

.status-caution {
    color: #ffc107;
    font-weight: bold;
}

.status-discard {
    color: #dc3545;
    font-weight: bold;
}

.temp-safe {
    color: #28a745;
}

.temp-warning {
    color: #ffc107;
}

.temp-danger {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    height: 100%;
    overflow: hidden;
}

/* Main layout container */
.main-layout {
    display: flex;
    gap: 30px;
    align-items: center;
    height: 100%;
}

.pizza-grid-container {
    width: 100%;
    flex: 1;
    min-width: 0;
    height: 100%;
    margin-top: 0;
    padding: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Adjust pizza grid for smaller containers */
.pizza-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (max-width: 1200px) {
    .main-layout {
        flex-direction: column-reverse;
        gap: 20px;
        justify-content: flex-end;
    }

.modal-overlay {}

.modal-overlay {
    padding-bottom: 50%;
}

    .data-grid-container {
        max-width: 100%;
        width: 100%;
        padding: 0px;
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .pizza-grid {
        /* grid-template-columns: 1fr; */
        gap: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 4px;
    }

    thead th:last-child {
        width: auto !important;
    }

    .pizza-grid-container-container {
        overflow-y: unset;
    }

    .data-grid {
        overflow-y: unset;
    }

}


td button.discard {
    /* padding: 4px 8px; */
    /* font-size: 0.8rem; */
    /* border: none; */
    /* border-radius: 4px; */
    background: #dc3545;
    /* color: white; */
    /* cursor: pointer; */
}

td button {
    padding: 4px 8px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    /* background: #dc3545; */
    color: white;
    cursor: pointer;
}

td button.undiscard-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    background: #28a745;
    color: white;
    cursor: pointer;
    margin-left: 5px;
}

td button.undiscard-btn:hover {
    background: #218838;
}

td button.delete-btn {
    /* padding: 4px 8px; */
    /* font-size: 0.8rem; */
    /* border: none; */
    /* border-radius: 4px; */
    background: #6c757d;
    /* color: white; */
    /* cursor: pointer; */
    margin-left: 5px;
    margin-top: 5px;
}

td button.delete-btn:hover {
    background: #5a6268;
}

/* Make discard button red with hover effect */
td button.discard:hover {
    background: #c82333;
}

/* Toggle button (Show All Logs / Show Discarded Logs) */
.toggle-logs-btn {
    background: linear-gradient(135deg, #e79230 0%, #ff3434 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    /* box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); */
    transition: all 0.3s ease;
}

.toggle-logs-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ========== MODULAR MODAL STYLES ========== */
.modal-overlay,
.datetime-overlay {
    position: fixed;
    top: 0px;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
    /* padding-bottom: 50%; */
}

.modal,
.datetime-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header,
.datetime-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #e79230 0%, #ff3434 100%);
    color: white;
}

.modal-header h3,
.datetime-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close,
.datetime-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.modal-close:hover,
.datetime-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body,
.datetime-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer,
.datetime-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.modal-btn,
.datetime-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.cancel,
.datetime-btn.datetime-cancel {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e0e0e0;
}

.modal-btn.cancel:hover,
.datetime-btn.datetime-cancel:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.modal-btn.confirm,
.datetime-btn.datetime-confirm {
    background: linear-gradient(135deg, #e79230 0%, #ff3434 100%);
    color: white;
}

.modal-btn.confirm:hover,
.datetime-btn.datetime-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.datetime-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.datetime-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.datetime-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.datetime-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.datetime-tab:hover {
    background-color: #f8f9fa;
}

/* Date Picker Styles */
.date-picker-container {
    min-width: 300px;
}

.month-year-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.nav-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #495057;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.month-year-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    min-width: 100px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-top: 10px;
}

.day-header {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    background: #f8f9fa;
}

.day-cell {
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.day-cell:hover {
    background: #e9ecef;
}

.day-cell.empty {
    cursor: default;
}

.day-cell.today {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.day-cell.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.day-cell.selected:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Time Picker Styles */
.time-picker-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    min-width: 250px;
    padding: 20px 0;
}

.time-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.time-selector label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.time-input {
    width: 80px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    font-weight: 600;
    transition: border-color 0.3s;
}

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

/* Combined DateTime Picker */
.datetime-picker-container {
    min-width: 350px;
}

.datetime-tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer Styles */
.datetime-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.datetime-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.datetime-cancel {
    background: #6c757d;
    color: white;
}

.datetime-cancel:hover {
    background: #5a6268;
}

.datetime-confirm {
    background: linear-gradient(135deg, #e79230 0%, #ff3434 100%);
    color: white;
}

.datetime-confirm:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Clickable cells in table */
.clickable-cell {
    cursor: pointer;
    position: relative;
    /* transition: background-color 0.2s; */
}

.clickable-cell:hover {
    background-color: #e3f2fd !important;
}

.clickable-cell:hover::after {
    content: '✎';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #1976d2;
}

/* Native date/time input styles */
.native-datetime-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 300px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

.input-group input[type="date"],
.input-group input[type="time"] {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
}

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

/* Custom styling for webkit browsers */
.input-group input[type="date"]::-webkit-calendar-picker-indicator,
.input-group input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.6);
    transition: filter 0.2s;
}

.input-group input[type="date"]::-webkit-calendar-picker-indicator:hover,
.input-group input[type="time"]::-webkit-calendar-picker-indicator:hover {
    filter: invert(0.4);
}

/* Responsive Design */
@media (max-width: 600px) {
    .datetime-modal {
        min-width: 90vw;
        margin: 20px;
    }

    .time-picker-container {
        flex-direction: column;
        gap: 15px;
    }

    .datetime-picker-container {
        min-width: auto;
    }
}

/* Temperature Modal Specific Styles */
.temperature-input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.temperature-input-group label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

.temperature-input-group input[type="number"] {
    width: 150px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    font-weight: 600;
    transition: border-color 0.3s;
}

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

.temperature-unit {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
}

.temperature-range-info {
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
    margin-top: 10px;
}

thead th:last-child {
    width: 210px;
}

/* ========== TOAST NOTIFICATION STYLES ========== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.fade-out {
    opacity: 0;
    transform: translateX(100%);
}

/* Toast type variants */
.toast.toast-error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-left: 4px solid #a71e2a;
}

.toast.toast-fatal {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
    border-left: 5px solid #FF0000;
    animation: toastSlideIn 0.3s ease-out, fatalPulse 1s infinite;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(220, 20, 60, 0.5);
}

@keyframes fatalPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }

    50% {
        opacity: 0.85;
        transform: scale(1.02) translateX(0);
    }
}

.toast.toast-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    border-left: 4px solid #d39e00;
}

.toast.toast-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border-left: 4px solid #155724;
}

.toast.toast-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border-left: 4px solid #0c5460;
}

/* Close button for persistent toasts */
.toast-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.toast-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Stack multiple toasts */
.toast:nth-of-type(2) {
    top: 80px;
}

.toast:nth-of-type(3) {
    top: 140px;
}

.toast:nth-of-type(4) {
    top: 200px;
}

.toast:nth-of-type(5) {
    top: 260px;
}

/* Responsive toast design */
@media (max-width: 600px) {
    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 13px;
    }
}