/**
 * 마이 어카운트 주문 목록 버튼 스타일
 * WP PopCon Booking Plugin
 */

/* 주문 액션 버튼 컨테이너 */
.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions {
    text-align: center;
}

.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button {
    display: inline-block;
    margin: 2px 4px;
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.4;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
    text-align: center;
}

/* 기본 버튼 스타일 */
.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.view {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #ffffff;
}

.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.view:hover {
    background-color: #005a87;
    border-color: #005a87;
    color: #ffffff;
}

/* 결제 버튼 */
.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.pay {
    background-color: #28a745;
    border-color: #28a745;
    color: #ffffff;
}

.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.pay:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: #ffffff;
}

/* 취소 버튼 */
.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.cancel,
.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.cancel-order-btn {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.cancel:hover,
.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.cancel-order-btn:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: #ffffff;
}

/* 환불 버튼 */
.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.refund {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.refund:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
}

/* 부분 환불 버튼 */
.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.partial-refund {
    background-color: #fd7e14;
    border-color: #fd7e14;
    color: #ffffff;
}

.woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button.partial-refund:hover {
    background-color: #e8690b;
    border-color: #e8690b;
    color: #ffffff;
}

/* 예약 취소 버튼 스타일 */
.booking-cancel-btn {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
    margin-left: 5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

.booking-cancel-btn:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.booking-cancel-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(220, 53, 69, 0.3);
}

/* 취소 모달 스타일 */
.booking-cancel-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.booking-cancel-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 25px;
    border: none;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.booking-cancel-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.booking-cancel-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.booking-cancel-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.booking-cancel-modal-close:hover {
    color: #333;
}

.booking-cancel-form {
    margin-bottom: 20px;
}

.booking-cancel-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.booking-cancel-form textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}

.booking-cancel-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.booking-cancel-form textarea::placeholder {
    color: #999;
}

.booking-cancel-buttons {
    text-align: right;
    margin-top: 20px;
}

.booking-cancel-buttons .button {
    margin-left: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.booking-cancel-buttons .cancel-modal-cancel {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #ffffff;
}

.booking-cancel-buttons .cancel-modal-cancel:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: #ffffff;
}

.booking-cancel-buttons .confirm-cancel {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.booking-cancel-buttons .confirm-cancel:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: #ffffff;
}

.booking-cancel-buttons .confirm-cancel:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #ffffff;
    cursor: not-allowed;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .booking-cancel-modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 20px;
    }
    
    .booking-cancel-modal-header h3 {
        font-size: 16px;
    }
    
    .booking-cancel-form textarea {
        height: 100px;
    }
    
    .booking-cancel-buttons {
        text-align: center;
    }
    
    .booking-cancel-buttons .button {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}

/* 로딩 상태 */
.booking-cancel-buttons .confirm-cancel:disabled {
    position: relative;
}

.booking-cancel-buttons .confirm-cancel:disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 기존 환불 관련 스타일 */
.refund-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.refund-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
}

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

.refund-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.refund-modal-close:hover {
    color: #000;
}

.refund-form {
    margin-bottom: 20px;
}

.refund-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.refund-form input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.refund-form textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.refund-confirmation-buttons {
    text-align: right;
}

.refund-confirmation-buttons .button {
    margin-left: 10px;
}

.refund-confirmation-buttons .button.confirm {
    background-color: #dc3545;
    color: #ffffff;
}

.refund-confirmation-buttons .button.confirm:hover {
    background-color: #c82333;
}

.refund-confirmation-buttons .button.cancel {
    background-color: #6c757d;
    color: #ffffff;
}

.refund-confirmation-buttons .button.cancel:hover {
    background-color: #5a6268;
}

/* 환불 금액 표시 툴팁 */
.refund-amount-tooltip {
    position: relative;
    display: inline-block;
}

.refund-amount-tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.3;
}

.refund-amount-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 상태 설명 메시지 */
.order-status-notice {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #6c757d;
    line-height: 1.3;
    max-width: 200px;
    text-align: center;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .woocommerce-orders-table__row .woocommerce-orders-table__cell-order-actions .button {
        display: block;
        margin: 3px 0;
        width: 100%;
        max-width: 120px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .refund-amount-tooltip .tooltip-text {
        width: 150px;
        margin-left: -75px;
        font-size: 11px;
    }
}

/* 로딩 상태 */
.button.loading {
    position: relative;
    color: transparent !important;
}

.button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 확인 다이얼로그 스타일 */
.refund-confirmation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.refund-confirmation-dialog.show {
    display: flex;
}

.refund-confirmation-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.refund-confirmation-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.refund-confirmation-content p {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.5;
}

.refund-confirmation-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.refund-confirmation-buttons .button {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.refund-confirmation-buttons .button.confirm {
    background-color: #dc3545;
    color: #ffffff;
}

.refund-confirmation-buttons .button.confirm:hover {
    background-color: #c82333;
}

.refund-confirmation-buttons .button.cancel {
    background-color: #6c757d;
    color: #ffffff;
}

.refund-confirmation-buttons .button.cancel:hover {
    background-color: #5a6268;
}

/* 환불 내역 스타일 */
.refund-history {
    margin-top: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.refund-item {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
}

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

.refund-item .refund-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.refund-item .refund-amount {
    font-weight: 600;
    color: #28a745;
    font-size: 14px;
}

.refund-item .refund-date {
    color: #6c757d;
    font-size: 12px;
}

.refund-item .refund-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: #6c757d;
}

.refund-item .refund-processor {
    color: #495057;
    font-weight: 500;
}

.refund-item .refund-reason {
    color: #6c757d;
    font-style: italic;
}

.total-refunded {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 2px solid #dee2e6;
    text-align: right;
    color: #28a745;
    font-weight: 600;
}

/* 환불 내역 없음 스타일 */
.no-refunds {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
    color: #6c757d;
    font-size: 13px;
}

.no-refunds .dashicons {
    margin-right: 5px;
    color: #6c757d;
}