/**
 * My Account Slip Upload Styles
 */

/* Container */
.wmsv-myaccount-upload,
.wmsv-myaccount-slip {
    margin-top: 30px;
    padding: 25px;
    background: #f9f9f9;
    border: 2px dashed #0073aa;
    border-radius: 8px;
}

.wmsv-myaccount-upload h3,
.wmsv-myaccount-slip h3 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wmsv-upload-desc {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 0.95em;
}

/* Drop Zone */
.wmsv-myaccount-upload .wmsv-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wmsv-myaccount-upload .wmsv-drop-zone:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.wmsv-myaccount-upload .wmsv-drop-zone.dragover {
    border-color: #0073aa;
    background: #e6f2ff;
    transform: scale(1.02);
}

.wmsv-myaccount-upload .wmsv-upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.wmsv-myaccount-upload .wmsv-upload-text {
    font-size: 16px;
    color: #555;
}

.wmsv-myaccount-upload .wmsv-upload-text strong {
    color: #0073aa;
}

.wmsv-myaccount-upload .wmsv-browse-link {
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
}

.wmsv-myaccount-upload .wmsv-browse-link:hover {
    color: #005177;
}

/* Preview */
.wmsv-myaccount-upload .wmsv-preview {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    animation: wmsvFadeIn 0.3s ease;
}

@keyframes wmsvFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wmsv-myaccount-upload .wmsv-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
    background: #f9f9f9;
}

.wmsv-myaccount-upload .wmsv-file-info {
    padding: 12px 15px;
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.wmsv-myaccount-upload .wmsv-filename {
    flex: 1;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wmsv-myaccount-upload .wmsv-remove-btn {
    background: #dc3232;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.wmsv-myaccount-upload .wmsv-remove-btn:hover {
    background: #a00;
}

/* QR Status */
.wmsv-myaccount-upload .wmsv-qr-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.wmsv-myaccount-upload .wmsv-qr-scanning {
    color: #666;
    display: inline-block;
    animation: wmsvPulse 1.5s infinite;
}

@keyframes wmsvPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.wmsv-myaccount-upload .wmsv-qr-found {
    color: #46b450;
    font-weight: 600;
}

.wmsv-myaccount-upload .wmsv-qr-notfound {
    color: #f56e28;
}

/* Upload Actions */
.wmsv-upload-actions {
    margin-top: 20px;
    text-align: center;
}

.wmsv-upload-btn {
    background: #0073aa !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: background 0.2s;
}

.wmsv-upload-btn:hover {
    background: #005177 !important;
}

.wmsv-upload-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
}

/* Status Messages */
.wmsv-upload-status {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.wmsv-upload-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wmsv-upload-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wmsv-upload-status.loading {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* ============================
   Existing Slip - Compact File Row
   ============================ */
.wmsv-slip-file {
    margin-top: 30px;
}

.wmsv-slip-file-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wmsv-slip-file-thumb {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.wmsv-slip-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wmsv-slip-file-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.wmsv-slip-file-name {
    font-size: 0.95em;
    font-weight: 500;
    color: #374151;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wmsv-slip-file-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
}

.wmsv-file-badge-valid {
    background: #dcfce7;
    color: #166534;
}

.wmsv-file-badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.wmsv-file-badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.wmsv-slip-file-view {
    flex-shrink: 0;
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s ease;
}

.wmsv-slip-file-view:hover {
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
}

/* Legacy Support (keep old class for backward compatibility) */
.wmsv-myaccount-slip {
    margin-top: 30px;
    padding: 25px;
    background: #f9f9f9;
    border: 2px dashed #0073aa;
    border-radius: 8px;
}

.wmsv-myaccount-slip h3 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wmsv-slip-preview {
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.wmsv-slip-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.wmsv-slip-status {
    margin: 0;
}

.wmsv-status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.wmsv-status-valid {
    background: #d4edda;
    color: #155724;
}

.wmsv-status-flagged,
.wmsv-status-pending {
    background: #fff3cd;
    color: #856404;
}

/* Mobile Responsive */
@media (max-width: 600px) {

    .wmsv-myaccount-upload,
    .wmsv-myaccount-slip {
        padding: 15px;
    }

    .wmsv-myaccount-upload .wmsv-drop-zone {
        padding: 30px 15px;
    }

    .wmsv-myaccount-upload .wmsv-upload-icon {
        font-size: 36px;
    }

    .wmsv-myaccount-upload .wmsv-upload-text {
        font-size: 14px;
    }

    .wmsv-myaccount-upload .wmsv-preview img,
    .wmsv-slip-preview img {
        max-height: 200px;
    }

    /* New File Row Mobile */
    .wmsv-slip-file-row {
        flex-wrap: wrap;
    }

    .wmsv-slip-file-view {
        width: 100%;
        text-align: right;
    }
}

/* ------------------------------------------------------------------
   Anti-override guard (Elementor / design system compatibility)
   Keep upload UI stable by scoping to plugin container.
------------------------------------------------------------------- */
#wmsv-myaccount-upload.wmsv-myaccount-upload {
    font-family: inherit;
    line-height: 1.5;
}

#wmsv-myaccount-upload.wmsv-myaccount-upload h3,
#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-upload-desc,
#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-upload-text,
#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-filename,
#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-upload-status {
    margin: 0;
}

#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-upload-desc {
    margin-bottom: 20px;
}

#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-drop-zone,
#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-preview,
#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-file-info {
    box-sizing: border-box;
    width: 100%;
}

#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-upload-btn.button,
#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-remove-btn {
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.2;
    font-weight: 600;
}

/* Hard reset for Remove button when themes globally style buttons. */
#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-remove-btn,
#wmsv-myaccount-upload.wmsv-myaccount-upload button.wmsv-remove-btn,
.wmsv-myaccount-upload .wmsv-remove-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    background-color: #dc3232 !important;
    background: #dc3232 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    min-height: 0 !important;
    height: auto !important;
    width: auto !important;
    max-width: none !important;
    padding: 6px 12px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    float: none !important;
    text-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    text-transform: none !important;
}

#wmsv-myaccount-upload.wmsv-myaccount-upload .wmsv-remove-btn:hover,
#wmsv-myaccount-upload.wmsv-myaccount-upload button.wmsv-remove-btn:hover,
.wmsv-myaccount-upload .wmsv-remove-btn:hover {
    background-color: #a00 !important;
    background: #a00 !important;
    color: #fff !important;
    border: none !important;
}