/**
 * WooCommerce Claims - Zendesk Inspired Design
 */

:root {
    --zd-primary: #1f73b7;
    --zd-primary-hover: #144a75;
    --zd-primary-light: #edf7ff;
    --zd-success: #038153;
    --zd-success-light: #edfcf6;
    --zd-error: #cc3340;
    --zd-error-light: #fff0f1;
    --zd-warning: #ad5e18;
    --zd-border: #d8dcde;
    --zd-border-focus: #1f73b7;
    --zd-bg: #f8f9f9;
    --zd-bg-hover: #f3f4f5;
    --zd-text: #2f3941;
    --zd-text-muted: #68737d;
    --zd-text-light: #87929d;
    --zd-white: #ffffff;
    --zd-radius: 8px;
    --zd-radius-lg: 16px;
    --zd-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    --zd-shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
    --zd-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
.woo-claims-container * {
    box-sizing: border-box;
}

.woo-claims-container {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--zd-text);
    -webkit-font-smoothing: antialiased;
}

/* Progress Steps */
.woo-claims-progress {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
    padding: 0;
    list-style: none;
}

.woo-claims-progress li {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--zd-text-light);
}

.woo-claims-progress li:not(:last-child)::after {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--zd-border);
    margin: 0 12px;
}

.woo-claims-progress .step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--zd-bg);
    border: 2px solid var(--zd-border);
    margin-right: 8px;
    font-weight: 600;
    font-size: 12px;
    transition: var(--zd-transition);
}

.woo-claims-progress li.active {
    color: var(--zd-primary);
}

.woo-claims-progress li.active .step-number {
    background: var(--zd-primary);
    border-color: var(--zd-primary);
    color: var(--zd-white);
}

.woo-claims-progress li.completed .step-number {
    background: var(--zd-success);
    border-color: var(--zd-success);
    color: var(--zd-white);
}

.woo-claims-progress li.completed .step-number::before {
    content: '✓';
}

/* Card */
.woo-claims-card {
    background: var(--zd-white);
    border-radius: var(--zd-radius-lg);
    box-shadow: var(--zd-shadow-lg);
    overflow: hidden;
}

/* Header */
.woo-claims-header {
    padding: 32px 32px 0;
    text-align: center;
}

.woo-claims-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    color: var(--zd-text);
    letter-spacing: -0.3px;
}

.woo-claims-header p {
    margin: 0;
    color: var(--zd-text-muted);
    font-size: 15px;
}

/* Form */
.woo-claims-form {
    padding: 32px;
}

.woo-claims-field {
    margin-bottom: 24px;
}

.woo-claims-field:last-child {
    margin-bottom: 0;
}

.woo-claims-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--zd-text);
    font-size: 14px;
}

.woo-claims-field .required {
    color: var(--zd-error);
    margin-left: 2px;
}

.woo-claims-field input[type="text"],
.woo-claims-field input[type="email"],
.woo-claims-field input[type="tel"],
.woo-claims-field select,
.woo-claims-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--zd-border);
    border-radius: var(--zd-radius);
    font-size: 14px;
    color: var(--zd-text);
    background: var(--zd-white);
    transition: var(--zd-transition);
    outline: none;
}

.woo-claims-field input::placeholder,
.woo-claims-field textarea::placeholder {
    color: var(--zd-text-light);
}

.woo-claims-field input:hover,
.woo-claims-field select:hover,
.woo-claims-field textarea:hover {
    border-color: #b5bcc2;
}

.woo-claims-field input:focus,
.woo-claims-field select:focus,
.woo-claims-field textarea:focus {
    border-color: var(--zd-border-focus);
    box-shadow: 0 0 0 3px rgba(31, 115, 183, 0.15);
}

.woo-claims-field input.error,
.woo-claims-field select.error,
.woo-claims-field textarea.error {
    border-color: var(--zd-error);
}

.woo-claims-field textarea {
    resize: vertical;
    min-height: 120px;
}

.woo-claims-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2368737d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

.field-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--zd-text-light);
}

/* Buttons */
.woo-claims-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--zd-border);
}

.woo-claims-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--zd-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--zd-transition);
    border: none;
    text-decoration: none;
    line-height: 1.4;
}

.woo-claims-btn-primary {
    background: var(--zd-primary);
    color: var(--zd-white);
    flex: 1;
}

.woo-claims-btn-primary:hover {
    background: var(--zd-primary-hover);
    color: var(--zd-white);
    transform: translateY(-1px);
}

.woo-claims-btn-primary:active {
    transform: translateY(0);
}

.woo-claims-btn-secondary {
    background: var(--zd-white);
    color: var(--zd-text);
    border: 1px solid var(--zd-border);
}

.woo-claims-btn-secondary:hover {
    background: var(--zd-bg-hover);
    color: var(--zd-text);
    border-color: #b5bcc2;
}

.woo-claims-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--zd-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error Message */
.woo-claims-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--zd-error-light);
    border: 1px solid #f5c6cb;
    border-radius: var(--zd-radius);
    color: var(--zd-error);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.woo-claims-error::before {
    content: '!';
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--zd-error);
    color: var(--zd-white);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Order Info Banner */
.woo-claims-order-info {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
    background: var(--zd-primary-light);
    border-bottom: 1px solid #c7e0f4;
}

.order-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.order-detail .label {
    color: var(--zd-text-muted);
}

.order-detail .value {
    font-weight: 600;
    color: var(--zd-primary);
}

/* Products List */
.woo-claims-products {
    padding: 24px 32px;
}

.woo-claims-products-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--zd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.woo-claims-product-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--zd-border);
    border-radius: var(--zd-radius);
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--zd-transition);
}

.woo-claims-product-item:last-child {
    margin-bottom: 0;
}

.woo-claims-product-item:hover {
    border-color: var(--zd-primary);
    background: var(--zd-primary-light);
}

.woo-claims-product-item.selected {
    border-color: var(--zd-primary);
    background: var(--zd-primary-light);
    box-shadow: 0 0 0 1px var(--zd-primary);
}

/* Custom Checkbox */
.product-checkbox {
    position: relative;
    flex-shrink: 0;
}

.product-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--zd-white);
    border: 2px solid var(--zd-border);
    border-radius: 6px;
    transition: var(--zd-transition);
}

.product-checkbox:hover .checkmark {
    border-color: var(--zd-primary);
}

.product-checkbox input:checked ~ .checkmark {
    background: var(--zd-primary);
    border-color: var(--zd-primary);
}

.checkmark::after {
    content: '';
    display: none;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.product-checkbox input:checked ~ .checkmark::after {
    display: block;
}

.product-image {
    width: 56px;
    height: 56px;
    border-radius: var(--zd-radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--zd-bg);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--zd-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-qty {
    font-size: 13px;
    color: var(--zd-text-muted);
}

/* Claim Item Form */
.woo-claims-item-form {
    padding: 24px;
    border: 1px solid var(--zd-border);
    border-radius: var(--zd-radius-lg);
    margin-bottom: 20px;
    background: var(--zd-white);
}

.woo-claims-item-form:last-of-type {
    margin-bottom: 0;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--zd-border);
}

.item-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--zd-radius);
    object-fit: cover;
    background: var(--zd-bg);
}

.item-info h4 {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
    color: var(--zd-text);
}

.item-qty {
    font-size: 13px;
    color: var(--zd-text-muted);
}

#claim-items-container {
    padding: 24px 32px;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    background: var(--zd-bg);
    border: 2px dashed var(--zd-border);
    border-radius: var(--zd-radius);
    color: var(--zd-text-muted);
    cursor: pointer;
    transition: var(--zd-transition);
}

.file-upload-wrapper:hover .file-upload-btn {
    border-color: var(--zd-primary);
    background: var(--zd-primary-light);
    color: var(--zd-primary);
}

.file-upload-btn svg {
    opacity: 0.7;
}

.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.file-preview-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: var(--zd-radius);
    overflow: hidden;
    border: 1px solid var(--zd-border);
}

.file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-item .remove-file {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: var(--zd-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

/* Contact Info */
.woo-claims-contact-info {
    padding: 0 32px 32px;
    border-top: 1px solid var(--zd-border);
    margin-top: 8px;
    padding-top: 24px;
}

.woo-claims-contact-info h3 {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--zd-text);
}

/* Success State */
.woo-claims-success {
    text-align: center;
    padding: 48px 32px;
}

.success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    background: var(--zd-success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--zd-success);
}

.success-icon svg {
    width: 36px;
    height: 36px;
}

.woo-claims-success h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    color: var(--zd-text);
}

.woo-claims-success > p {
    color: var(--zd-text-muted);
    margin: 0 0 24px;
    font-size: 15px;
}

.claim-number-display {
    display: inline-block;
    background: var(--zd-bg);
    padding: 16px 32px;
    border-radius: var(--zd-radius);
    margin-bottom: 24px;
}

.claim-number-display .label {
    display: block;
    color: var(--zd-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.claim-number-display .number {
    font-size: 20px;
    font-weight: 700;
    color: var(--zd-primary);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.info-text {
    font-size: 14px;
    color: var(--zd-text-muted);
    margin-bottom: 24px;
}

.woo-claims-success .woo-claims-actions {
    border-top: none;
    justify-content: center;
}

/* Help Text */
.woo-claims-help {
    text-align: center;
    padding: 20px 32px;
    background: var(--zd-bg);
    border-top: 1px solid var(--zd-border);
    font-size: 13px;
    color: var(--zd-text-muted);
}

.woo-claims-help a {
    color: var(--zd-primary);
    text-decoration: none;
}

.woo-claims-help a:hover {
    text-decoration: underline;
}

/* Animation */
.woo-claims-step {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .woo-claims-container {
        padding: 0 16px;
        margin: 24px auto;
    }
    
    .woo-claims-header,
    .woo-claims-form,
    .woo-claims-products,
    #claim-items-container {
        padding: 20px;
    }
    
    .woo-claims-header h2 {
        font-size: 20px;
    }
    
    .woo-claims-order-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .woo-claims-actions {
        flex-direction: column;
    }
    
    .woo-claims-btn {
        width: 100%;
    }
    
    .woo-claims-btn-secondary {
        order: 1;
    }
    
    .woo-claims-product-item {
        padding: 12px;
    }
    
    .product-image {
        width: 48px;
        height: 48px;
    }
    
    .woo-claims-progress li span:not(.step-number) {
        display: none;
    }
    
    .woo-claims-progress li:not(:last-child)::after {
        width: 24px;
    }
    
    .woo-claims-contact-info {
        padding: 20px;
    }
}
