/**
 * Withdrawal Request Frontend Styles
 *
 * @package WC_Withdrawal_Request
 */

/* Withdrawal Button */
.wc-withdrawal-button-wrapper {
    margin: 30px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.wc-withdrawal-button-wrapper h2 {
    margin-top: 0;
    color: #333;
}

.wc-withdrawal-button-wrapper p {
    margin-bottom: 15px;
    color: #666;
}

button.wc-withdrawal-open-form {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button.wc-withdrawal-open-form:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Withdrawal Form */
.wc-withdrawal-form-wrapper {
    margin: 30px 0;
    padding: 30px;
    background-color: #fff;
    border: 2px solid #dee2e6;
    border-radius: 4px;
}

.wc-withdrawal-form-wrapper h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
    color: #333;
}

.wc-withdrawal-form-wrapper h3:first-of-type {
    margin-top: 0;
}

.wc-withdrawal-order-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.wc-withdrawal-order-info p {
    margin: 8px 0;
}

/* Items Table */
.wc-withdrawal-items {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.wc-withdrawal-items th,
.wc-withdrawal-items td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.wc-withdrawal-items th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

/* Form Fields */
.wc-withdrawal-form-wrapper .form-row {
    margin-bottom: 20px;
}

.wc-withdrawal-form-wrapper label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.wc-withdrawal-form-wrapper input[type="text"],
.wc-withdrawal-form-wrapper input[type="email"],
.wc-withdrawal-form-wrapper input[type="tel"],
.wc-withdrawal-form-wrapper select,
.wc-withdrawal-form-wrapper textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.wc-withdrawal-form-wrapper input[type="text"]:focus,
.wc-withdrawal-form-wrapper input[type="email"]:focus,
.wc-withdrawal-form-wrapper input[type="tel"]:focus,
.wc-withdrawal-form-wrapper select:focus,
.wc-withdrawal-form-wrapper textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.wc-withdrawal-form-wrapper .required {
    color: #dc3545;
}

.wc-withdrawal-form-wrapper .form-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

/* File Upload */
.wc-withdrawal-upload-wrapper {
    margin: 20px 0;
}

.wc-withdrawal-upload-wrapper input[type="file"] {
    padding: 10px;
    border: 2px dashed #ced4da;
    border-radius: 4px;
    width: 100%;
}

.wc-withdrawal-upload-wrapper .help-text {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

#photo-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.photo-preview-item {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.photo-preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.photo-preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background-color 0.3s ease;
}

.photo-preview-remove:hover {
    background-color: #c82333;
}

/* Consent Checkboxes */
.wc-withdrawal-consent {
    margin: 30px 0;
    padding: 20px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.wc-withdrawal-consent label {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
}

.wc-withdrawal-consent input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    flex-shrink: 0;
}

/* Buttons */
.wc-withdrawal-form-wrapper button[type="submit"] {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.wc-withdrawal-form-wrapper button[type="submit"]:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.wc-withdrawal-form-wrapper button.wc-withdrawal-cancel {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wc-withdrawal-form-wrapper button.wc-withdrawal-cancel:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Messages */
.wc-withdrawal-messages {
    margin-top: 20px;
}

.wc-withdrawal-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.wc-withdrawal-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wc-withdrawal-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.wc-withdrawal-message.info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Existing Request Status */
.wc-withdrawal-existing-request {
    margin: 30px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.wc-withdrawal-status-box {
    padding: 20px;
    border-radius: 4px;
    margin-top: 15px;
}

.wc-withdrawal-status-pending {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.wc-withdrawal-status-approved {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
}

.wc-withdrawal-status-rejected {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
}

.wc-withdrawal-status-completed {
    background-color: #d1ecf1;
    border-left: 4px solid #17a2b8;
}

.wc-withdrawal-status-refunded {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
}

/* My Account Section */
.wc-withdrawal-my-requests {
    margin: 30px 0;
}

.wc-withdrawal-my-requests h2 {
    margin-bottom: 20px;
    color: #333;
}

.woocommerce-table--withdrawal-requests {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-table--withdrawal-requests th,
.woocommerce-table--withdrawal-requests td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.woocommerce-table--withdrawal-requests th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* Loading Spinner */
.wc-withdrawal-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Orders List Withdrawal Button */
.woocommerce-orders-table__cell-order-actions .button.withdrawal {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff !important;
}

.woocommerce-orders-table__cell-order-actions .button.withdrawal:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.woocommerce-orders-table__cell-order-actions .button.withdrawal_status {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529 !important;
    font-size: 12px;
    padding: 6px 10px;
}

.woocommerce-orders-table__cell-order-actions .button.withdrawal_expired {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff !important;
    font-size: 11px;
    padding: 6px 10px;
    cursor: default;
    pointer-events: none;
}

/* Guest Withdrawal Page */
.wc-withdrawal-guest-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.wc-withdrawal-guest-page h1 {
    margin-bottom: 20px;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-withdrawal-form-wrapper {
        padding: 20px;
    }

    .wc-withdrawal-form-wrapper .form-row-first,
    .wc-withdrawal-form-wrapper .form-row-last {
        width: 100%;
        float: none;
        margin-right: 0;
    }

    #photo-preview-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .woocommerce-table--withdrawal-requests {
        font-size: 14px;
    }

    .woocommerce-table--withdrawal-requests th,
    .woocommerce-table--withdrawal-requests td {
        padding: 8px;
    }
}
