/**
 * Delivery Admin Styles
 *
 * @package WooCheckoutToolkit
 */

/* Dashboard Layout */
.marwchto-delivery-dashboard {
    max-width: 100%;
}

.marwchto-delivery-tabs {
    margin-bottom: 20px;
}

.marwchto-delivery-content {
    background: #fff;
    padding: 20px;
    border: 1px solid #c3c4c7;
    border-top: none;
}

/* Status Badges */
.marwchto-delivery-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

/* Status Dropdown */
.marwchto-delivery-status-select {
    margin-left: 8px;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 3px;
}

.marwchto-status-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Delivery Column in Orders */
.marwchto-delivery-column {
    line-height: 1.4;
}

.marwchto-delivery-date {
    font-weight: 500;
}

/* List Table */
.marwchto-delivery-dashboard .wp-list-table {
    margin-top: 0;
}

/* Date Badges */
.marwchto-date-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 5px;
}

.marwchto-date-badge.today {
    background: #0073aa;
    color: #fff;
}

.marwchto-date-badge.tomorrow {
    background: #00a32a;
    color: #fff;
}

.marwchto-date-badge.past {
    background: #d63638;
    color: #fff;
}

.marwchto-date-past {
    color: #d63638;
}

.marwchto-date-today {
    font-weight: 600;
}

/* Calendar Styles */
.marwchto-calendar-wrapper {
    max-width: 900px;
}

.marwchto-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.marwchto-calendar-title {
    margin: 0;
    font-size: 1.5em;
}

.marwchto-calendar-nav {
    text-decoration: none;
    color: #2271b1;
    font-weight: 500;
}

.marwchto-calendar-nav:hover {
    color: #135e96;
}

.marwchto-calendar {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.marwchto-calendar th {
    background: #f0f0f1;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #c3c4c7;
}

.marwchto-calendar td {
    border: 1px solid #c3c4c7;
    padding: 8px;
    vertical-align: top;
    height: 100px;
    background: #fff;
}

.marwchto-calendar td.marwchto-calendar-empty {
    background: #f6f7f7;
}

.marwchto-calendar td.today {
    background: #e7f5ff;
}

.marwchto-calendar td.past {
    background: #f6f7f7;
    opacity: 0.7;
}

.marwchto-calendar td.has-deliveries {
    cursor: pointer;
}

.marwchto-calendar .day-number {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #1d2327;
}

.marwchto-calendar td.today .day-number {
    color: #0073aa;
}

.marwchto-calendar td.past .day-number {
    color: #8c8f94;
}

.marwchto-calendar-count {
    display: block;
    text-decoration: none;
    padding: 5px 8px;
    background: #2271b1;
    color: #fff;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 5px;
}

.marwchto-calendar-count:hover {
    background: #135e96;
    color: #fff;
}

.marwchto-calendar-count .count {
    display: block;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.marwchto-calendar-count .label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
}

.marwchto-calendar-statuses {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.marwchto-calendar-statuses .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: help;
}

.marwchto-calendar-legend {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 10px;
    background: #f6f7f7;
    border-radius: 4px;
    flex-wrap: wrap;
}

.marwchto-calendar-legend .legend-title {
    font-weight: 600;
    color: #1d2327;
}

.marwchto-calendar-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #646970;
}

.marwchto-calendar-legend .legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Filter Actions */
.marwchto-delivery-dashboard .tablenav .actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.marwchto-delivery-dashboard .tablenav select {
    max-width: 200px;
}

/* Quick Status Update */
.marwchto-quick-status-updating {
    opacity: 0.5;
    pointer-events: none;
}

/* Order Meta Box */
.marwchto-order-delivery-meta {
    padding: 10px 0;
}

.marwchto-order-delivery-meta .delivery-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

.marwchto-order-delivery-meta .delivery-row:last-child {
    border-bottom: none;
}

.marwchto-order-delivery-meta .delivery-label {
    font-weight: 500;
    color: #1d2327;
}

.marwchto-order-delivery-meta .delivery-value {
    color: #646970;
}

.marwchto-delivery-history {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #c3c4c7;
}

.marwchto-delivery-history h4 {
    margin: 0 0 10px;
    font-size: 13px;
    color: #1d2327;
}

.marwchto-delivery-history ul {
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}

.marwchto-delivery-history li {
    padding: 5px 0;
    font-size: 12px;
    color: #646970;
    border-bottom: 1px dashed #f0f0f1;
}

.marwchto-delivery-history li:last-child {
    border-bottom: none;
}

.marwchto-delivery-history .history-status {
    font-weight: 500;
}

.marwchto-delivery-history .history-date {
    color: #8c8f94;
    font-size: 11px;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .marwchto-calendar td {
        height: auto;
        min-height: 60px;
        padding: 5px;
    }

    .marwchto-calendar-count .count {
        font-size: 14px;
    }

    .marwchto-calendar-count .label {
        display: none;
    }

    .marwchto-calendar-header {
        flex-direction: column;
        gap: 10px;
    }

    .marwchto-delivery-dashboard .tablenav .actions {
        flex-wrap: wrap;
    }
}
