/**
 * Shared Table Styles
 * Used by both customers_page and daily_schedule_page
 */

/* Common table structure */
.customers-table,
.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #E0E0E0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.customers-table thead,
.schedule-table thead {
    background: #f8f9fa;
}

.customers-table th,
.schedule-table th {
    padding: 1rem 0.5rem;
    background: var(--Brand-Colors-Primary-500, #00463A);
    color: #FFF;
    overflow: hidden;
    text-overflow: ellipsis;

    /* small text */
    font-family: Poppins;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.225rem;
    /* 140% */
    cursor: pointer;

    position: relative;
    text-align: left;
    transition: background-color 200ms ease-in-out;
}

.customers-table th:hover,
.schedule-table th:hover {
    background: #002821;
}

.customers-table th.sortable::after,
.schedule-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
}

.customers-table th.sort-asc::after,
.schedule-table th.sort-asc::after {
    content: '↑';
    opacity: 1;
}

.customers-table th.sort-desc::after,
.schedule-table th.sort-desc::after {
    content: '↓';
    opacity: 1;
}

.customers-table td,
.schedule-table td {
    padding: 0.75rem 0.5rem;

    overflow: hidden;
    color: var(--Neutral-Dark-500, #2F3735);
    text-overflow: ellipsis;

    /* small text */
    font-family: Poppins;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.225rem;
    /* 140% */
    max-width: 120px;
    word-wrap: break-word;
    white-space: normal;
}

.customers-table tbody tr:hover,
.schedule-table tbody tr:hover {
    background: #f8f9fa;
    transition: background-color 150ms ease-in-out;
}

.customers-table tbody tr.odd-row,
.schedule-table tbody tr.odd-row {
    background: #F5F5F5;
    transition: background-color 150ms ease-in-out;
}

.customers-table tbody tr.even-row,
.schedule-table tbody tr.even-row {
    background: #ffffff;
    transition: background-color 150ms ease-in-out;
}

.customers-table tbody tr.odd-row:hover,
.customers-table tbody tr.even-row:hover,
.schedule-table tbody tr.odd-row:hover,
.schedule-table tbody tr.even-row:hover {
    background: #f8f9fa;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    padding: 0.5rem 0.75rem;
    justify-content: center;
    align-items: center;
    border-radius: 0.5rem;
    background: #FDE9E7;

    overflow: hidden;
    color: var(--Status-Error-500, #DD2D01);
    text-overflow: ellipsis;

    /* small text */
    font-family: Poppins;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.225rem;
    /* 140% */
}

/* Order status badges */
.status-active {
    background: rgba(194, 231, 188, 1);
    color: rgba(54, 120, 43, 1);
}

.status-inactive {
    background: rgba(253, 233, 231, 1);
    color: rgba(221, 45, 1, 1);
}

.status-cancelled {
    background: rgba(238, 238, 238, 1);
    color: rgba(100, 104, 103, 1);
}

/* Order day status badges */
.status-not-started {
    background: rgba(255, 243, 224, 1);
    color: rgba(217, 119, 6, 1);
}

.status-prepared {
    background: rgba(224, 242, 254, 1);
    color: rgba(3, 105, 161, 1);
}

.status-delivered {
    background: rgba(194, 231, 188, 1);
    color: rgba(54, 120, 43, 1);
}

/* Payment status badges */
.status-unpaid {
    background: rgba(253, 233, 231, 1);
    color: rgba(221, 45, 1, 1);
}

.status-paid {
    background: rgba(194, 231, 188, 1);
    color: rgba(54, 120, 43, 1);
}

.status-partial {
    background: rgba(209, 236, 241, 1);
    color: rgba(12, 84, 96, 1);
}

/* Badge styles for order headers and summaries */
.badge {
    display: inline-flex;
    padding: 0.5rem 0.75rem;
    justify-content: center;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0.5rem;

    font-family: Poppins;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.225rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pagination */
.pagination-info {
    color: rgb(47, 55, 53);
    font-family: 'Poppins';
    display: inline-flex;
    align-items: center;
}

.pagination-info-text {
    margin-top: 4px;
}

.pagination-controls {
    display: flex;
    gap: 5px;
}

.pagination-btn {
    display: flex;
    text-wrap: nowrap;
    height: 2.8125rem;
    padding: 0.5rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    aspect-ratio: 1/1;
    border-radius: 0.5rem;
    background: var(--Neutral-Gray-300, #F5F5F5);
    transition: background-color 200ms ease-in-out, transform 150ms ease-in-out;
}

.pagination-btn:hover:not(:disabled) {
    background: #00463a;
    color: #FFF;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--Brand-Colors-Primary-500, #00463A);
    color: #FFF;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Text styles */
.name-text {
    overflow: hidden;
    color: var(--Brand-Colors-Primary-500, #00463A);
    text-overflow: ellipsis;

    /* small text bold */
    font-family: Poppins;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1.225rem;
    /* 140% */
    max-width: 120px;
    word-wrap: break-word;
    white-space: normal;
    display: block;
}

.email-text {
    color: rgb(0, 52, 0);
    font-size: 13px;
    max-width: 120px;
    word-wrap: break-word;
    white-space: normal;
    display: block;
}

/* Filter reset button */
#reset-filters-btn:hover {
    background: #bdbdbd;
    transition: background-color 200ms ease-in-out;
}

/* Tooltip Styles - Shared between daily schedule and customer detail pages */
.tooltip-container,
.custom-tooltip {
    position: fixed;
    z-index: 10000;
    background: white;
    border: 1px solid #D4D4D4;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    max-width: 320px;
    pointer-events: none;
    font-family: 'Poppins', sans-serif;
}

.tooltip-container .tooltip-content,
.custom-tooltip .tooltip-content {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #2F3735;
}

/* Price cells that trigger tooltips, no hover, there is hover for row already */
.price-cell {
    cursor: help;
    position: relative;
}

.tooltip-container .tooltip-title,
.custom-tooltip .tooltip-title {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #00463A;
    margin-bottom: 12px;
    border-bottom: 2px solid #00C896;
    padding-bottom: 8px;
}

.tooltip-container .tooltip-section,
.custom-tooltip .tooltip-section {
    margin-bottom: 12px;
}

.tooltip-container .tooltip-section:last-child,
.custom-tooltip .tooltip-section:last-child {
    margin-bottom: 0;
}

.tooltip-container .tooltip-row,
.custom-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
}

.tooltip-container .tooltip-label,
.custom-tooltip .tooltip-label {
    color: #5A6462;
    font-size: 0.8125rem;
}

.tooltip-container .tooltip-value,
.custom-tooltip .tooltip-value {
    font-weight: 700;
    color: #00463A;
    white-space: nowrap;
}

.tooltip-container .tooltip-subsection,
.custom-tooltip .tooltip-subsection {
    margin-left: 16px;
    margin-top: 4px;
    padding-left: 12px;
    border-left: 2px solid #E5E5E5;
}

.tooltip-container .tooltip-discount,
.custom-tooltip .tooltip-discount {
    background: #FFF7ED;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 8px 0;
    border-left: 3px solid #00C896;
}

.tooltip-container .tooltip-note,
.custom-tooltip .tooltip-note {
    font-size: 0.75rem;
    color: #7D8987;
    font-style: italic;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #E5E5E5;
}

.tooltip-container .tooltip-total,
.custom-tooltip .tooltip-total {
    font-size: 1rem;
    font-weight: 700;
    color: #00463A;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #00C896;
}

.tooltip-container .tooltip-extras-item,
.custom-tooltip .tooltip-extras-item {
    font-size: 0.8125rem;
    color: #2F3735;
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.tooltip-container .badge,
.custom-tooltip .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 8px;
}

.tooltip-container .badge-discount,
.custom-tooltip .badge-discount,
.badge-discount {
    background: #FFF7ED;
    color: #F59E0B;
}

.tooltip-container .badge-free,
.custom-tooltip .badge-free,
.badge-free {
    background: #D1FAE5;
    color: #059669;
}

/* Order total row styling */
.customers-table tr.order-total-row,
.schedule-table tr.order-total-row {
    background: #FFF7ED !important;
    border-top: 2px solid #F59E0B;
}

.customers-table tr.order-total-row td,
.schedule-table tr.order-total-row td {
    padding: 0.75rem 0.5rem;
    font-weight: 700;
    color: #00463A;
    background: #FFF7ED;
}

.customers-table tr.order-total-row:hover,
.schedule-table tr.order-total-row:hover {
    background: #FFF7ED !important;
}