/**
 * Image Upload Component Styles
 * Beautiful, responsive styles for image upload with progress indicators
 */

/* Upload Area Container */
[data-image-upload] {
    margin: 1.5rem 0;
}

/* Drop Zone Styles */
.drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #f9fafb, #f3f4f6);
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.drop-zone:hover {
    border-color: #059669;
    background: linear-gradient(145deg, #f0fdf4, #ecfdf5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.1);
}

.drop-zone.drag-over {
    border-color: #10b981;
    background: linear-gradient(145deg, #ecfdf5, #d1fae5);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.drop-zone.uploading {
    border-color: #3b82f6;
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    pointer-events: none;
}

.drop-zone.upload-success {
    border-color: #10b981;
    background: linear-gradient(145deg, #ecfdf5, #d1fae5);
}

.drop-zone.upload-error {
    border-color: #ef4444;
    background: linear-gradient(145deg, #fef2f2, #fee2e2);
}

/* Drop Zone Content */
.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.drop-zone-icon {
    font-size: 3rem;
    color: #6b7280;
    transition: color 0.3s ease;
}

.drop-zone:hover .drop-zone-icon {
    color: #059669;
}

.drop-zone-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.drop-zone-subtext {
    font-size: 0.9rem;
    color: #6b7280;
}

/* File Input (Hidden) */
.file-input {
    display: none;
}

/* Upload Progress */
.upload-progress {
    margin-top: 1rem;
    display: none;
}

.progress-container {
    background-color: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    height: 8px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 8px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 2s infinite;
}

.progress-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    text-align: center;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Image Preview */
.image-preview {
    margin-top: 1rem;
}

.preview-container {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 12px;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.preview-container.success .preview-overlay {
    display: none;
}

.processing-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: white;
}

.processing-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Preview Actions */
.preview-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-container:hover .preview-actions {
    opacity: 1;
}

/* Success Indicator */
.success-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transform: translateY(100%);
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

/* Upload Messages */
.upload-messages {
    margin-top: 1rem;
}

.upload-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    border-left: 4px solid;
    animation: slideInUp 0.3s ease-out;
}

.upload-message.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border-left-color: #10b981;
}

.upload-message.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left-color: #ef4444;
}

.upload-message.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-left-color: #3b82f6;
}

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

/* Button Styles */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

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

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .drop-zone {
        padding: 1.5rem 1rem;
        min-height: 150px;
    }
    
    .drop-zone-icon {
        font-size: 2.5rem;
    }
    
    .drop-zone-text {
        font-size: 1rem;
    }
    
    .preview-image {
        max-height: 200px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .drop-zone {
        background: linear-gradient(145deg, #1f2937, #111827);
        border-color: #4b5563;
    }
    
    .drop-zone:hover {
        background: linear-gradient(145deg, #065f46, #047857);
        border-color: #10b981;
    }
    
    .drop-zone-text {
        color: #f9fafb;
    }
    
    .drop-zone-subtext {
        color: #d1d5db;
    }
    
    .drop-zone-icon {
        color: #9ca3af;
    }
    
    .progress-container {
        background-color: #374151;
    }
    
    .progress-text {
        color: #d1d5db;
    }
}
