/* Customer Dashboard Styles */

/* Hide invalid order error message globally */
.woocommerce-error li:has(a[href*="my-account"]) {
    display: none !important;
}

ul.woocommerce-error:empty {
    display: none !important;
}

.woocommerce-notices-wrapper .woocommerce-error:has(li:only-child a[href*="my-account"]) {
    display: none !important;
}

/* Hide any error in woocommerce-error ul */
.woocommerce-MyAccount-content .woocommerce-error li {
    display: none !important;
}

.woocommerce-MyAccount-content .woocommerce-error:not(:has(li:not(:empty))) {
    display: none !important;
}

.lwc-customer-dashboard {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #f7f3fa;
}

.lwc-orders-header {
    margin-bottom: 30px;
}

.lwc-orders-header h1 {
    font-size: 32px;
    color: #666;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.lwc-orders-count {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Orders Table */
.lwc-orders-table-wrapper {
    overflow-x: auto;
    margin-bottom: 0;
    width: 100%;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 8px;
    box-sizing: border-box;
}

.lwc-orders-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.lwc-orders-table thead {
    background: #f8f9fa;
}

.lwc-orders-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.lwc-orders-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    background: #fff;
}

.lwc-orders-table tbody tr:hover {
    background: #f8f9fa;
}

.lwc-orders-table tbody tr:last-child td {
    border-bottom: none;
}

.lwc-orders-table a {
    color: #007bff;
    text-decoration: none;
}

.lwc-orders-table a:hover {
    text-decoration: underline;
}

/* Payment Status */
.payment-status-paid {
    color: #28a745;
    font-weight: 600;
}

.payment-status-unpaid {
    color: #dc3545;
    font-weight: 600;
}

.payment-status-refunded,
.payment-status-partially-refunded {
    color: #ffc107;
    font-weight: 600;
}

/* Order Status */
.order-status-processing,
.order-status-completed {
    color: #007bff;
    font-weight: 500;
}

.order-status-pending,
.order-status-on-hold {
    color: #ffc107;
    font-weight: 500;
}

.order-status-cancelled,
.order-status-refunded {
    color: #dc3545;
    font-weight: 500;
}

/* Pagination */
.lwc-pagination {
    text-align: center;
    margin-top: 0;
    padding-top: 20px;
}

.lwc-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    text-decoration: none;
    border: 1px solid #dee2e6;
    color: #007bff;
    border-radius: 4px;
}

.lwc-pagination .page-numbers.current {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.lwc-pagination .page-numbers:hover {
    background: #f8f9fa;
}

/* Order Details Page */
.lwc-order-details {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.lwc-order-header {
    margin-bottom: 30px;
}

.lwc-back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: #007bff;
    text-decoration: none;
}

.lwc-back-link:hover {
    text-decoration: underline;
}

.lwc-order-header h1 {
    font-size: 18px;
    color: #333;
    margin: 0 0 20px 0;
    font-weight: normal;
    line-height: 1.5;
}

.lwc-order-header h1 strong {
    font-weight: bold;
}

.lwc-order-date {
    color: #6c757d;
    margin: 0;
}

/* Cancellation Banner */
.lwc-cancellation-banner {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 30px;
    color: #721c24;
}

.lwc-cancellation-banner strong {
    display: block;
    margin-bottom: 5px;
}

/* Order Content */
.lwc-order-content {
    background: #fff;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 4px;
}

.lwc-order-items,
.lwc-order-summary,
.lwc-registrant-details {
    margin-bottom: 30px;
}

.lwc-order-items h2,
.lwc-order-summary h2,
.lwc-registrant-details h2 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
}

/* Order Items Table */
.lwc-order-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.lwc-order-items-table th {
    background: transparent;
    padding: 12px 0;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    color: #333;
}

.lwc-order-items-table th.text-right {
    text-align: right;
}

.lwc-order-items-table td {
    padding: 15px 0;
    border-bottom: 1px solid #dee2e6;
}

.lwc-order-items-table td.text-right {
    text-align: right;
}

.product-name {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.product-name strong {
    font-weight: 600;
    color: #333;
}

.product-quantity {
    color: #666;
    font-size: 14px;
}

.product-provider {
    color: #666;
    font-size: 14px;
}

.product-description {
    margin-top: 5px;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

/* Order Summary */
.lwc-order-summary-table {
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-top: 10px;
    border-collapse: collapse;
}

.lwc-order-summary-table thead th {
    padding: 10px 12px;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: #495057;
    background: #f8f9fa;
}

.lwc-order-summary-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
}

.lwc-order-summary-table tfoot td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
}

.lwc-order-summary-table td.text-right,
.lwc-order-summary-table th.text-right {
    text-align: right;
}

.lwc-order-summary-table td.text-center,
.lwc-order-summary-table th.text-center {
    text-align: center;
}

.lwc-payment-method {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.lwc-payment-method p {
    margin: 0;
    color: #333;
}

/* Billing Address */
.lwc-billing-address {
    margin-top: 30px;
}

.lwc-billing-address h2 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.billing-details p {
    margin: 8px 0;
    color: #333;
    line-height: 1.6;
}

.phone-icon,
.email-icon {
    margin-right: 8px;
}

.lwc-order-summary-table tfoot .refund-row {
    color: #ffc107;
}

.lwc-order-summary-table tfoot .total-row {
    border-top: 2px solid #dee2e6;
    border-bottom: none;
    font-size: 16px;
}

.lwc-order-summary-table tfoot .total-row td {
    padding-top: 12px;
    padding-bottom: 8px;
    font-weight: 600;
}

/* Registrant Details - Unique Classes */
.lwd-order-registrant-details-section {
    background: #fff !important;
    padding: 30px !important;
    border-radius: 10px !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08) !important;
    margin-bottom: 30px !important;
}

.lwd-registrant-section-title {
    font-size: 24px !important;
    color: #2c3e50 !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 3px solid #73ab8a !important;
    font-weight: 600 !important;
}

.lwd-order-registrants-data-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-top: 20px !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #fff !important;
}

.lwd-registrant-table-header-row {
    background: linear-gradient(135deg, #73ab8a 0%, #8B5FBF 100%) !important;
}

.lwd-registrant-table-header-cell {
    background: transparent !important;
    padding: 18px 20px !important;
    text-align: left !important;
    font-weight: 700 !important;
    color: #fff !important;
    border-bottom: none !important;
    border-right: 1px solid rgba(255,255,255,0.2) !important;
    font-size: 15px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.lwd-registrant-table-header-cell:last-child {
    border-right: none !important;
}

.lwd-registrant-table-body {
    background: #fff !important;
}

.lwd-registrant-table-data-row {
    transition: all 0.3s ease !important;
    background: #fff !important;
}

.lwd-registrant-table-data-row:nth-child(even) {
    background: #f8f9fa !important;
}

.lwd-registrant-table-data-row:hover {
    background: #e9f5ef !important;
    transform: scale(1.01) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

.lwd-registrant-table-data-cell {
    padding: 18px 20px !important;
    border-bottom: 1px solid #e0e0e0 !important;
    border-right: 1px solid #f0f0f0 !important;
    color: #2c3e50 !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    vertical-align: middle !important;
}

.lwd-registrant-table-data-cell:last-child {
    border-right: none !important;
}

.lwd-registrant-table-data-cell a {
    color: #73ab8a !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.lwd-registrant-table-data-cell a:hover {
    color: #8B5FBF !important;
    text-decoration: underline !important;
}

.lwd-registrant-table-data-row:last-child .lwd-registrant-table-data-cell {
    border-bottom: none !important;
}

.lwd-registrant-product-item {
    margin-bottom: 30px !important;
}

.lwd-registrant-product-title {
    font-size: 18px !important;
    margin-bottom: 15px !important;
    color: #495057 !important;
    font-weight: 600 !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #e9ecef !important;
}

.lwd-registrant-product-item p {
    margin: 10px 0 !important;
    color: #6c757d !important;
    line-height: 1.8 !important;
    font-size: 14px !important;
}

.lwd-registrant-product-item p strong {
    color: #2c3e50 !important;
    margin-right: 10px !important;
    font-weight: 600 !important;
}

/* Cancel Order Button */
.lwc-order-actions {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.lwc-cancel-order-btn {
    background: linear-gradient(90deg, #73ab89 0%, #a877de 100%);
    color: #fff;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lwc-cancel-order-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Popup Styles */
.lwc-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lwc-popup-content {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.lwc-popup-question {
    margin-bottom: 12px;
    margin-top: 0;
}

.lwc-question-text {
    color: #dc3545;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.lwc-order-number {
    font-size: 14px;
    color: #333;
    margin: 0;
}

.lwc-refund-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #007bff;
}

.lwc-refund-info p {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.lwc-popup-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.lwc-btn-mistake,
.lwc-btn-yes {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.lwc-btn-mistake {
    background: linear-gradient(90deg, #73ab89 0%, #a877de 100%);
    color: #fff;
    font-weight: 600;
}

.lwc-btn-mistake:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.lwc-btn-yes {
    background: linear-gradient(90deg, #a877de 0%, #73ab89 100%);
    color: #fff;
    font-weight: 600;
}

.lwc-btn-yes:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.lwc-cancel-reasons {
    margin-top: 15px;
}

.lwc-reason-heading {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.lwc-reason-box {
    border: 2px solid #007bff;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
    background: #f8f9fa;
}

.lwc-reason-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lwc-reason-list li {
    margin-bottom: 8px;
}

.lwc-reason-list li:last-child {
    margin-bottom: 0;
}

.lwc-reason-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background 0.2s;
    margin: 0;
}

.lwc-reason-list label:hover {
    background: #e9ecef;
}

.lwc-reason-list input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.lwc-reason-list input[type="checkbox"]:checked + span {
    font-weight: 500;
}

.lwc-reason-list input[type="checkbox"]:checked + span {
    color: #a877de;
}

/* Highlight selected checkbox label */
.lwc-reason-list label:has(input[type="checkbox"]:checked) {
    background: #e9d5ff;
}

/* Fallback for browsers that don't support :has() */
.lwc-reason-list input[type="checkbox"]:checked {
    accent-color: #a877de;
}

.lwc-reason-list label.lwc-reason-selected {
    background: #e9d5ff;
}

.lwc-reason-list span {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.lwc-policy-checkbox {
    display: flex;
    align-items: flex-start;
    margin: 12px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    gap: 8px;
}

.lwc-policy-checkbox input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.lwc-policy-checkbox span {
    font-size: 14px;
    line-height: 1.5;
}

.lwc-policy-checkbox a {
    color: #007bff;
    text-decoration: underline;
}

.lwc-policy-checkbox input[type="checkbox"] {
    margin-right: 10px;
}

.lwc-popup-submit {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.lwc-btn-cancel-popup,
.lwc-btn-submit-cancel {
    flex: 1;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.lwc-btn-cancel-popup {
    background: #fff;
    color: #28a745;
    border: 1px solid #28a745;
}

.lwc-btn-cancel-popup:hover {
    background: #f8f9fa;
    border-color: #218838;
    color: #218838;
}

.lwc-btn-submit-cancel {
    background: linear-gradient(90deg, #a877de 0%, #73ab89 100%);
    color: #fff;
}

.lwc-btn-submit-cancel:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.lwc-btn-submit-cancel:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .lwc-orders-table {
        font-size: 14px;
    }
    
    .lwc-orders-table th,
    .lwc-orders-table td {
        padding: 10px 8px;
    }
    
    .lwc-order-content {
        padding: 20px;
    }
    
    .lwc-popup-content {
        padding: 20px;
    }
    
    .lwc-order-items-table,
    .lwd-order-registrants-data-table {
        font-size: 13px !important;
    }
    
    .lwc-order-items-table th,
    .lwc-order-items-table td {
        padding: 12px 10px;
    }
    
    .lwd-registrant-table-header-cell,
    .lwd-registrant-table-data-cell {
        padding: 14px 12px !important;
        font-size: 13px !important;
    }
    
    .lwd-order-registrant-details-section {
        padding: 20px 15px !important;
    }
    
    .lwd-registrant-product-item {
        margin-bottom: 20px !important;
    }
    
    .lwd-registrant-section-title {
        font-size: 20px !important;
    }
}

/* No Orders Message */
.lwc-no-orders {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lwc-no-orders p {
    font-size: 18px;
    color: #6c757d;
    margin: 0;
}
