/**
 * Yangze Ecommerce Enhancements - Frontend Styles
 */

/* Shipment Tracking on Order Details */
.yee-tracking-timeline {
    margin: 20px 0;
}

.yee-timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.yee-timeline-list::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.yee-timeline-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 20px;
}

.yee-timeline-item:last-child {
    padding-bottom: 0;
}

.yee-timeline-item::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    width: 16px;
    height: 16px;
    background: #ccc;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #ccc;
}

.yee-timeline-item.latest::before {
    background: #2271b1;
    box-shadow: 0 0 0 2px #2271b1;
}

.yee-timeline-item.latest .yee-timeline-time {
    color: #2271b1;
    font-weight: 600;
}

.yee-timeline-item.latest .yee-timeline-desc {
    color: #1d2327;
    font-weight: 500;
}

.yee-timeline-time {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.yee-timeline-desc {
    color: #444;
    line-height: 1.5;
}

/* Status badges for frontend */
.yee-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
}

.yee-status-badge.pending {
    background: #fcf9e8;
    color: #b35900;
}

.yee-status-badge.shipped {
    background: #c5d9ed;
    color: #1d2327;
}

.yee-status-badge.in_transit {
    background: #c5d9ed;
    color: #135e96;
}

.yee-status-badge.out_for_delivery {
    background: #d1f7d1;
    color: #0a4d0a;
}

.yee-status-badge.delivered {
    background: #edfaef;
    color: #00a32a;
}

.yee-status-badge.exception {
    background: #fcf0f1;
    color: #d63638;
}

.yee-status-badge.returned {
    background: #f0c33c;
    color: #1d2327;
}

/* Shipment details table */
.woocommerce-table--shipment-details {
    margin-bottom: 30px;
}

.woocommerce-table--shipment-details th {
    width: 30%;
    font-weight: 600;
}

.woocommerce-table--shipment-details td {
    width: 70%;
}

/* Tracking link button */
.shipment_details a.button {
    display: inline-block;
    padding: 6px 12px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 13px;
    margin-right: 5px;
}

.shipment_details a.button:hover {
    background: #135e96;
    color: #fff;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .yee-timeline-list::before {
        left: 10px;
    }

    .yee-timeline-item {
        padding-left: 30px;
    }

    .yee-timeline-item::before {
        left: 3px;
        width: 14px;
        height: 14px;
    }

    .woocommerce-table--shipment-details th,
    .woocommerce-table--shipment-details td {
        display: block;
        width: 100%;
    }

    .woocommerce-table--shipment-details th {
        padding-bottom: 0;
    }
}

/* ============================================
   My Account Notifications - 站内信样式
   ============================================ */

/* Notification badge in menu */
.yee-notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #d63638;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    margin-left: 6px;
    line-height: 1;
}

/* Notifications page container */
.yee-notifications-page {
    margin-top: 20px;
}

.yee-notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.yee-notifications-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.yee-notifications-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

.yee-notifications-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.yee-notifications-stats .unread-count {
    color: #d63638;
    font-weight: 600;
}

/* Empty state */
.yee-notifications-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.yee-notifications-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.yee-notifications-empty h3 {
    margin: 0 0 10px;
    color: #333;
}

.yee-notifications-empty p {
    margin: 0;
    color: #888;
}

/* Notification list */
.yee-notification-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.yee-notification-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    position: relative;
}

.yee-notification-item:last-child {
    border-bottom: none;
}

.yee-notification-item:hover {
    background-color: #f9f9f9;
}

.yee-notification-item.unread {
    background-color: #f0f7ff;
}

.yee-notification-item.unread:hover {
    background-color: #e8f2ff;
}

/* Unread indicator */
.yee-notification-unread-indicator {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #2271b1;
    border-radius: 50%;
}

.yee-notification-item.read .yee-notification-unread-indicator {
    display: none;
}

/* Icon */
.yee-notification-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 20px;
}

.yee-notification-icon.type-order {
    background: #e8f5e9;
    color: #2e7d32;
}

.yee-notification-icon.type-system {
    background: #e3f2fd;
    color: #1976d2;
}

.yee-notification-icon.type-promotion {
    background: #fff3e0;
    color: #e65100;
}

.yee-notification-icon.type-template {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Content */
.yee-notification-content {
    flex: 1;
    min-width: 0;
}

.yee-notification-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 8px;
    line-height: 1.4;
}

.yee-notification-item.unread .yee-notification-title {
    color: #2271b1;
}

.yee-notification-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yee-notification-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

.yee-notification-meta .type-label {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.yee-notification-meta .type-label.type-order {
    background: #e8f5e9;
    color: #2e7d32;
}

.yee-notification-meta .type-label.type-system {
    background: #e3f2fd;
    color: #1976d2;
}

.yee-notification-meta .type-label.type-promotion {
    background: #fff3e0;
    color: #e65100;
}

.yee-notification-meta .type-label.type-template {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Actions */
.yee-notification-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

.yee-notification-actions .button {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 80px;
    text-align: center;
}

.yee-notification-actions .button.mark-read {
    background: #2271b1;
    color: #fff;
}

.yee-notification-actions .button.mark-read:hover {
    background: #135e96;
}

.yee-notification-actions .button.delete {
    background: transparent;
    color: #d63638;
    border: 1px solid #d63638;
}

.yee-notification-actions .button.delete:hover {
    background: #fcf0f1;
}

/* Pagination */
.yee-notifications-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.yee-notifications-pagination .page-numbers {
    display: inline-flex;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #2271b1;
    font-size: 14px;
    transition: all 0.2s;
}

.yee-notifications-pagination .page-numbers:hover {
    background: #f0f0f0;
}

.yee-notifications-pagination .page-numbers.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.yee-notifications-pagination .page-numbers.dots {
    border-color: transparent;
}

/* Detail view */
.yee-notification-detail {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 30px;
}

.yee-notification-detail-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.yee-notification-detail-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px;
}

.yee-notification-detail-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.yee-notification-detail-content {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.yee-notification-detail-content p {
    margin: 0 0 15px;
}

.yee-notification-detail-content p:last-child {
    margin-bottom: 0;
}

.yee-notification-detail-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .yee-notification-item {
        flex-wrap: wrap;
        padding-left: 25px;
    }

    .yee-notification-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .yee-notification-actions {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        margin-top: 10px;
    }

    .yee-notifications-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .yee-notifications-stats {
        width: 100%;
        justify-content: space-between;
    }
}
