/**
 * Revoker for WooCommerce - Frontend Styles
 *
 * @package Revoker_For_WooCommerce
 */

/* ==========================================================================
   Withdrawal Section
   ========================================================================== */

.revoker-withdrawal-section {
    margin: 2em 0;
    padding: 1.5em;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.revoker-withdrawal-section .revoker-withdrawal-info {
    margin-bottom: 1.25em;
}

.revoker-withdrawal-info h3 {
    margin: 0 0 0.5em;
    font-size: 1.2em;
    color: #333;
}

.revoker-withdrawal-info p {
    margin: 0 0 0.75em;
    color: #666;
}

.revoker-withdrawal-info p:last-child {
    margin-bottom: 0;
}

/* Deadline text within withdrawal section (inline style) */
.revoker-withdrawal-info .revoker-deadline {
    display: block;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    color: #555;
    margin-top: 0.5em;
}

/* Standalone deadline notice (box style) */
.revoker-deadline-notice .revoker-deadline,
.revoker-modal-body .revoker-deadline {
    padding: 0.75em 1em;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
}

/* Urgent deadline styling (red) */
.revoker-deadline-today,
.revoker-withdrawal-info .revoker-deadline-today {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75em 1em;
    border-radius: 4px;
    color: #721c24;
}

/* ==========================================================================
   Withdrawal Button
   ========================================================================== */

.revoker-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.revoker-button-default {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
}

.revoker-button-default:hover {
    background: #005d8c;
    color: #fff;
}

.revoker-button-prominent {
    background: #d32f2f;
    color: #fff;
    border: 2px solid #d32f2f;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.revoker-button-prominent:hover {
    background: #b71c1c;
    border-color: #b71c1c;
    color: #fff;
}

.revoker-button-minimal {
    background: transparent;
    color: #0073aa;
    border: 1px solid #0073aa;
    border-radius: 4px;
}

.revoker-button-minimal:hover {
    background: #0073aa;
    color: #fff;
}

.revoker-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.revoker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.revoker-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.revoker-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.revoker-modal-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.revoker-modal.is-active .revoker-modal-container {
    transform: translateY(0);
}

.revoker-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25em 1.5em;
    border-bottom: 1px solid #e5e5e5;
}

.revoker-modal-header h2 {
    margin: 0;
    font-size: 1.3em;
    color: #333;
}

.revoker-modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

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

.revoker-modal-body {
    padding: 1.5em;
    overflow-y: auto;
    flex: 1;
}

.revoker-modal-footer {
    display: flex;
    gap: 1em;
    justify-content: flex-end;
    padding: 1.25em 1.5em;
    border-top: 1px solid #e5e5e5;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* ==========================================================================
   Modal Content
   ========================================================================== */

.revoker-notice {
    padding: 1em;
    border-radius: 4px;
    margin-bottom: 1.5em;
}

.revoker-notice-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.revoker-notice p {
    margin: 0;
}

.revoker-notice p + p {
    margin-top: 0.5em;
}

.revoker-order-details h3,
.revoker-order-details h4 {
    margin: 0 0 0.75em;
    color: #333;
}

.revoker-order-details h4 {
    margin-top: 1.5em;
}

.revoker-order-table {
    width: 100%;
    margin-bottom: 1em;
}

.revoker-order-table th {
    text-align: left;
    padding: 0.5em 0;
    color: #666;
    font-weight: 500;
    width: 40%;
}

.revoker-order-table td {
    padding: 0.5em 0;
    color: #333;
}

.revoker-order-items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.revoker-order-items li {
    padding: 0.5em 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.revoker-order-items li:last-child {
    border-bottom: none;
}

.revoker-reason-field {
    margin: 1.5em 0;
}

.revoker-reason-field label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 500;
    color: #333;
}

.revoker-reason-field textarea {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

.revoker-reason-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.revoker-legal-notice {
    background: #f8f9fa;
    padding: 1em;
    border-radius: 4px;
    font-size: 0.9em;
}

.revoker-legal-notice p {
    margin: 0 0 0.5em;
    font-weight: 500;
}

.revoker-legal-notice ul {
    margin: 0;
    padding-left: 1.25em;
}

.revoker-legal-notice li {
    margin-bottom: 0.25em;
    color: #666;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.revoker-btn {
    padding: 0.75em 1.5em;
    font-size: 1em;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.revoker-btn-primary {
    background: #0073aa;
    color: #fff;
}

.revoker-btn-primary:hover {
    background: #005d8c;
}

.revoker-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.revoker-btn-secondary:hover {
    background: #e0e0e0;
}

.revoker-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Success & Error States
   ========================================================================== */

.revoker-step-success,
.revoker-success-container {
    text-align: center;
    padding: 2em;
}

.revoker-success-icon,
.revoker-error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5em;
}

.revoker-success-icon svg,
.revoker-error-icon svg {
    width: 100%;
    height: 100%;
}

.revoker-step-success h3,
.revoker-success-container h3 {
    color: #4caf50;
    margin: 0 0 1em;
}

.revoker-success-details {
    background: #f8f9fa;
    padding: 1em;
    border-radius: 4px;
    margin: 1.5em 0;
}

.revoker-success-details p {
    margin: 0.25em 0;
}

.revoker-next-steps,
.revoker-email-notice {
    color: #666;
    font-size: 0.95em;
}

.revoker-error h3 {
    color: #f44336;
}

.revoker-error-container {
    margin-top: 1.5em;
}

.revoker-error-notice {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1em;
    border-radius: 4px;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.revoker-loading {
    text-align: center;
    padding: 3em;
}

.revoker-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1em;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: revoker-spin 1s linear infinite;
}

@keyframes revoker-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Form Container (Standalone Page)
   ========================================================================== */

.revoker-form-container {
    max-width: 800px;
    margin: 0 auto;
}

.revoker-form-header {
    margin-bottom: 2em;
}

.revoker-form-header h2 {
    margin: 0 0 0.5em;
    color: #333;
}

.revoker-form-intro {
    color: #666;
    font-size: 1.1em;
}

.revoker-deadline-notice {
    padding: 1em;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    margin-bottom: 2em;
}

.revoker-deadline-notice p {
    margin: 0;
}

.revoker-deadline-urgent {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.revoker-deadline-urgent .revoker-urgent {
    color: #721c24;
}

.revoker-order-summary {
    background: #f8f9fa;
    padding: 1.5em;
    border-radius: 4px;
    margin-bottom: 2em;
}

.revoker-order-summary h3,
.revoker-order-summary h4 {
    margin: 0 0 1em;
    color: #333;
}

.revoker-order-summary h4 {
    margin-top: 1.5em;
}

.revoker-order-info-table {
    width: 100%;
    margin-bottom: 1em;
}

.revoker-order-info-table th {
    text-align: left;
    padding: 0.5em 0;
    width: 40%;
    color: #666;
}

.revoker-order-info-table td {
    padding: 0.5em 0;
}

.revoker-items-table {
    width: 100%;
    border-collapse: collapse;
}

.revoker-items-table th,
.revoker-items-table td {
    padding: 0.75em;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.revoker-items-table th {
    background: #fff;
    font-weight: 600;
}

.revoker-items-table td:last-child {
    text-align: right;
}

/* ==========================================================================
   Item Selection (Partial Withdrawal)
   ========================================================================== */

.revoker-items-hint {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 1em;
}

.revoker-select-all-wrapper {
    margin-bottom: 1em;
    padding: 0.75em 1em;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.revoker-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
    font-weight: 500;
}

.revoker-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.revoker-items-selectable .revoker-col-select {
    width: 40px;
    text-align: center;
}

.revoker-items-selectable .revoker-item-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.revoker-item-row {
    transition: background-color 0.2s;
}

.revoker-item-row:has(.revoker-item-checkbox:not(:checked)) {
    opacity: 0.5;
}

.revoker-item-row:has(.revoker-item-checkbox:not(:checked)) td {
    text-decoration: line-through;
    color: #999;
}

.revoker-withdrawal-total-row {
    background: #f0f0f0;
    font-weight: 600;
}

.revoker-withdrawal-total-row td {
    border-bottom: none;
}

.revoker-total-label {
    text-align: right;
    padding-right: 1em;
}

.revoker-total-amount {
    font-size: 1.1em;
}

.revoker-no-items-warning {
    padding: 1em;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    margin-top: 1em;
}

.revoker-no-items-warning p {
    margin: 0;
}

.revoker-form-section {
    margin-bottom: 2em;
}

.revoker-form-section h3 {
    margin: 0 0 1em;
    color: #333;
}

.revoker-declaration {
    background: #e8f4fd;
    padding: 1em;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
    margin-bottom: 1.5em;
}

.revoker-declaration p {
    margin: 0;
    font-style: italic;
}

.revoker-reason-section {
    margin-top: 1.5em;
}

.revoker-reason-section > label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 500;
}

.revoker-reason-hint {
    margin: 0 0 1em;
    font-size: 0.9em;
    color: #666;
}

.revoker-reason-select {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 1em;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75em center;
    background-size: 12px;
}

.revoker-reason-select:focus {
    outline: none;
    border-color: #7f54b3;
    box-shadow: 0 0 0 2px rgba(127, 84, 179, 0.2);
}

.revoker-reason-other-wrapper {
    margin-top: 1em;
    padding: 1em;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
}

.revoker-reason-other-wrapper label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 500;
    font-size: 0.9em;
}

.revoker-reason-section textarea {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.revoker-info-section {
    margin-bottom: 2em;
}

.revoker-info-section h3 {
    margin: 0 0 1em;
}

.revoker-info-box {
    background: #f8f9fa;
    padding: 1.5em;
    border-radius: 4px;
    margin-bottom: 1.5em;
}

.revoker-info-box h4 {
    margin: 0 0 0.75em;
}

.revoker-info-box ul {
    margin: 0;
    padding-left: 1.25em;
}

.revoker-info-box li {
    margin-bottom: 0.5em;
    color: #666;
}

.revoker-return-address {
    background: #fff;
    padding: 1.5em;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.revoker-return-address h4 {
    margin: 0 0 0.75em;
}

.revoker-return-address address {
    font-style: normal;
    line-height: 1.6;
}

.revoker-form-actions {
    border-top: 1px solid #e5e5e5;
    padding-top: 2em;
}

.revoker-warning-notice {
    background: #fff3cd;
    padding: 1em;
    border-radius: 4px;
    margin-bottom: 1.5em;
}

.revoker-warning-notice p {
    margin: 0;
    color: #856404;
}

.revoker-submit-btn {
    padding: 1em 2em;
    font-size: 1.1em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .revoker-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .revoker-modal-footer {
        flex-direction: column-reverse;
    }

    .revoker-modal-footer .revoker-btn {
        width: 100%;
    }

    .revoker-order-table th,
    .revoker-order-info-table th {
        width: 50%;
    }

    .revoker-items-table {
        font-size: 0.9em;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .revoker-modal,
    .revoker-button,
    .revoker-submit-btn,
    .revoker-form-actions {
        display: none !important;
    }

    .revoker-form-container {
        max-width: 100%;
    }
}

/* ==========================================================================
   Search Form (Guest Checkout)
   ========================================================================== */

.revoker-search-container {
    max-width: 600px;
    margin: 0 auto;
}

.revoker-search-header {
    margin-bottom: 2em;
}

.revoker-search-header h2 {
    margin: 0 0 0.5em;
    color: #333;
}

.revoker-search-intro {
    color: #666;
    font-size: 1.05em;
    line-height: 1.6;
}

.revoker-search-form-wrapper {
    background: #fff;
    padding: 2em;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 2em;
}

.revoker-search-field {
    margin-bottom: 1.5em;
}

.revoker-search-field:last-of-type {
    margin-bottom: 0;
}

.revoker-search-field label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #333;
}

.revoker-search-field label .required {
    color: #d32f2f;
}

.revoker-search-field input {
    width: 100%;
    padding: 0.875em 1em;
    font-size: 1em;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.revoker-search-field input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.revoker-field-hint {
    display: block;
    margin-top: 0.5em;
    font-size: 0.875em;
    color: #888;
}

.revoker-search-actions {
    margin-top: 2em;
}

.revoker-search-btn {
    width: 100%;
    padding: 1em 1.5em;
    font-size: 1.1em;
}

.revoker-search-info {
    background: #f8f9fa;
    padding: 1.5em;
    border-radius: 8px;
    margin-top: 2em;
}

.revoker-search-info h3 {
    margin: 0 0 1em;
    font-size: 1.1em;
    color: #333;
}

.revoker-search-info ul {
    margin: 0;
    padding-left: 1.25em;
}

.revoker-search-info li {
    margin-bottom: 0.5em;
    color: #666;
    line-height: 1.5;
}

.revoker-search-info li:last-child {
    margin-bottom: 0;
}

.revoker-search-error {
    margin-bottom: 1.5em;
}

.revoker-search-result {
    margin-bottom: 2em;
}

/* ==========================================================================
   Responsive Search Form
   ========================================================================== */

@media (max-width: 768px) {
    .revoker-search-form-wrapper {
        padding: 1.5em;
    }

    .revoker-search-field input {
        padding: 0.75em;
    }

    .revoker-search-btn {
        padding: 0.875em 1.25em;
    }
}
