/* Upload Component Styles */
.upload-section {
    max-width: 850px;
    margin: 32px auto 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 32px;
    border: 1px solid #e8e8e8;
}

.upload-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.upload-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}

.upload-icon.uploaded {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16,185,129,0.25);
}

.upload-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
}

.upload-subtitle {
    font-size: 12px;
    color: #888;
    letter-spacing: 0.5px;
}

/* Drop Zone */
.upload-dropzone {
    border: 2px dashed #d0d5dd;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: #fafbfc;
}

.upload-dropzone.dragover {
    border-color: #3b82f6;
    background: rgba(59,130,246,0.04);
}

.dropzone-icon {
    color: #bcc3d0;
    margin-bottom: 12px;
}

.upload-dropzone.dragover .dropzone-icon { color: #3b82f6; }

.dropzone-text {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.dropzone-hint {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.upload-btn {
    display: inline-block;
    background: #1a1a2e;
    color: #fff;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Sarabun', sans-serif;
}

.upload-btn:hover {
    background: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.dropzone-formats {
    font-size: 12px;
    color: #aaa;
    margin-top: 12px;
}

/* Uploaded Result */
.upload-result {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f8fdf9;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    padding: 20px;
}

.upload-preview {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
}

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

.upload-preview-pdf {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #e94560;
}

.upload-preview-pdf span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

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

.upload-filename {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-meta {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.upload-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-preview, .btn-download, .btn-delete {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Sarabun', sans-serif;
}

.btn-preview {
    background: #3b82f6;
    color: #fff;
}

.btn-preview:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-download {
    background: #1a1a2e;
    color: #fff;
}

.btn-download:hover {
    background: #3b82f6;
    transform: translateY(-1px);
}

.btn-delete {
    background: #fff;
    color: #e94560;
    border: 1px solid #fecdd3;
}

.btn-delete:hover {
    background: #fef2f2;
    border-color: #e94560;
}

/* Preview Modal */
.preview-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.preview-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s;
}

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

.preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.preview-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
}

.preview-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.preview-modal-close:hover {
    background: #e94560;
    color: #fff;
}

.preview-modal-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #f8f9fa;
    min-height: 300px;
}

.preview-modal-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.preview-modal-body iframe {
    width: 100%;
    height: 70vh;
    border: none;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 600px) {
    .upload-result { flex-direction: column; text-align: center; }
    .upload-actions { justify-content: center; }
    .upload-section { margin: 20px 16px 0; }
}

@media print {
    .upload-section { display: none; }
}
