/**
 * Realisaprint Upload Styles
 *
 * @package Realisaprint_WooCommerce
 */

/* Upload Page Container */
.realisaprint-upload-page {
    max-width: 800px;
}

.realisaprint-upload-page h2 {
    margin-bottom: 10px;
    color: #333;
}

.realisaprint-upload-page > .description {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Info Box */
.realisaprint-upload-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 30px;
}

.realisaprint-upload-info h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 15px;
}

.realisaprint-upload-info p {
    margin: 5px 0;
    color: #555;
    font-size: 13px;
}

/* Order Upload Card */
.realisaprint-order-upload {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s;
}

.realisaprint-order-upload:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Order Header */
.order-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 18px 25px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.order-header h3 {
    margin: 0;
    font-size: 17px;
    color: #333;
}

.order-header h3 small {
    font-weight: normal;
    color: #777;
    margin-left: 10px;
    font-size: 13px;
}

.order-header .realisaprint-ref {
    font-size: 13px;
    color: #666;
    background: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Order Items */
.order-items {
    padding: 15px 25px;
    border-bottom: 1px solid #eee;
    background: #fafbfc;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.order-item:not(:last-child) {
    border-bottom: 1px dotted #ddd;
}

.order-item strong {
    color: #333;
}

.order-item .qty {
    color: #666;
    font-size: 13px;
}

/* Upload Zones Container */
.upload-zones {
    padding: 25px;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #d0d5dd;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.upload-zone:last-child {
    margin-bottom: 0;
}

.upload-zone.uploaded {
    border-color: #10b981;
    border-style: solid;
    background: #ecfdf5;
}

.upload-zone.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: scale(1.01);
}

.upload-zone.uploading {
    border-color: #f59e0b;
    background: #fffbeb;
}

.upload-zone.error {
    border-color: #ef4444;
    background: #fef2f2;
}

/* Upload Zone Header */
.upload-zone-header {
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-type-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.upload-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.upload-status.success {
    color: #10b981;
}

.upload-status .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Uploaded File Display */
.uploaded-file {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    background: #fff;
}

.uploaded-file .file-icon {
    width: 40px;
    height: 40px;
    background: #10b981;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.uploaded-file .file-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.uploaded-file .filename {
    font-weight: 600;
    color: #333;
    flex: 1;
    word-break: break-all;
}

.uploaded-file .upload-date {
    color: #666;
    font-size: 12px;
}

.uploaded-file .replace-file {
    margin-left: auto;
}

/* Dropzone */
.dropzone {
    padding: 40px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.dropzone.hidden {
    display: none;
}

.dropzone:hover {
    background: rgba(59, 130, 246, 0.03);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dropzone-content .upload-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.dropzone-content .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #6366f1;
}

.dropzone-content p {
    margin: 5px 0;
    color: #555;
    font-size: 14px;
}

.dropzone-content .or {
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    margin: 10px 0;
}

.dropzone-content label.button {
    cursor: pointer;
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
}

.dropzone-content label.button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.dropzone-content input[type="file"] {
    display: none;
}

/* Upload Progress */
.upload-progress {
    padding: 20px;
    text-align: center;
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    width: 0;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.progress-text {
    font-weight: 600;
    color: #3b82f6;
    font-size: 14px;
}

/* Upload Error */
.upload-error {
    padding: 12px 20px;
    background: #fef2f2;
    color: #dc2626;
    border-top: 1px solid #fecaca;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-error.hidden {
    display: none;
}

.upload-error .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Order Actions */
.order-actions {
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #eee;
    text-align: center;
}

.send-files-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 35px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer;
    transition: all 0.3s !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.send-files-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.send-files-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-files-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.send-files-btn.loading {
    position: relative;
    color: transparent !important;
}

.send-files-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Pending Notice */
.files-pending-notice {
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 18px;
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.files-pending-notice .dashicons {
    color: #d97706;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Success Message */
.realisaprint-success-message {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #10b981;
    border-radius: 12px;
    padding: 25px 30px;
    text-align: center;
    margin-top: 20px;
}

.realisaprint-success-message .success-icon {
    width: 60px;
    height: 60px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.realisaprint-success-message .success-icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #fff;
}

.realisaprint-success-message h4 {
    color: #065f46;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.realisaprint-success-message p {
    color: #047857;
    margin: 0;
    font-size: 14px;
}

/* Empty State */
.realisaprint-empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.realisaprint-empty-state .empty-icon {
    width: 80px;
    height: 80px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.realisaprint-empty-state .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #9ca3af;
}

.realisaprint-empty-state h3 {
    color: #374151;
    margin: 0 0 10px 0;
}

.realisaprint-empty-state p {
    margin: 0 0 20px 0;
}

/* Responsive */
@media (max-width: 600px) {
    .realisaprint-upload-page {
        padding: 0 10px;
    }

    .order-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 18px;
    }

    .order-header h3 small {
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }

    .order-items {
        padding: 12px 18px;
    }

    .upload-zones {
        padding: 18px;
    }

    .uploaded-file {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .uploaded-file .replace-file {
        margin-left: 0;
        width: 100%;
    }

    .dropzone {
        padding: 30px 15px;
    }

    .dropzone-content .upload-icon {
        width: 50px;
        height: 50px;
    }

    .dropzone-content .dashicons {
        font-size: 24px;
        width: 24px;
        height: 24px;
    }

    .order-actions {
        padding: 18px;
    }

    .send-files-btn {
        width: 100%;
        justify-content: center;
    }

    .files-pending-notice {
        text-align: left;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .realisaprint-order-upload {
        background: #1f2937;
        border-color: #374151;
    }

    .order-header {
        background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
        border-bottom-color: #374151;
    }

    .order-header h3 {
        color: #f9fafb;
    }

    .order-header h3 small {
        color: #9ca3af;
    }

    .order-items {
        background: #111827;
        border-bottom-color: #374151;
    }

    .order-item strong {
        color: #f9fafb;
    }

    .upload-zones {
        background: #1f2937;
    }

    .upload-zone {
        background: #111827;
        border-color: #4b5563;
    }

    .upload-zone-header {
        background: rgba(55, 65, 81, 0.5);
    }

    .file-type-label {
        color: #f9fafb;
    }

    .uploaded-file {
        background: #1f2937;
    }

    .uploaded-file .filename {
        color: #f9fafb;
    }
}
