/**
 * Modern Image Handler Styles
 * Nowoczesne style dla biblioteki obsługi zdjęć
 */

/* Upload Area Styles */
.modern-upload-area {
    border: 2px dashed #e1e5e9;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.modern-upload-area:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.modern-upload-area.drag-over {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.2);
}

.upload-content {
    position: relative;
    z-index: 2;
}

.upload-icon {
    margin-bottom: 1rem;
}

.upload-icon i {
    font-size: 3rem;
    color: #6b7280;
    transition: all 0.3s ease;
}

.modern-upload-area:hover .upload-icon i {
    color: #3b82f6;
    transform: scale(1.1);
}

.modern-upload-area.drag-over .upload-icon i {
    color: #10b981;
    transform: scale(1.2) rotate(5deg);
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.modern-upload-area:hover .upload-title {
    color: #1f2937;
}

.upload-description {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.upload-limits {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.limit-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    backdrop-filter: blur(10px);
}

.btn-select-files {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-select-files:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-select-files:active {
    transform: translateY(0);
}

/* Progress Styles */
.upload-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::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: shimmer 2s infinite;
}

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

.progress-text {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Preview Grid Styles */
.modern-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 1.5rem;
}

.image-preview-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.image-preview-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.preview-image-container {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-preview-item:hover .preview-image {
    transform: scale(1.05);
}

.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;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-item:hover .preview-overlay {
    opacity: 1;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
}

.preview-actions button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.btn-edit {
    color: #3b82f6;
}

.btn-edit:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.1);
}

.btn-remove {
    color: #ef4444;
}

.btn-remove:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.upload-status {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
}

.status-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    backdrop-filter: blur(10px);
    border: 2px solid white;
}

.status-uploading {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.status-completed {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.status-error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.preview-info {
    padding: 0.75rem;
    background: white;
}

.file-name {
    display: block;
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: #6b7280;
    font-size: 0.8rem;
}

/* Upload Summary */
.upload-summary {
    margin-top: 1rem;
    text-align: center;
}

.photo-counter {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #374151;
    font-weight: 500;
    border: 1px solid #d1d5db;
}

/* Notifications */
.modern-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    color: white;
}

.notification-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.notification-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.notification-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.notification-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.notification-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.3s ease;
    margin-left: auto;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-upload-area {
        padding: 1.5rem;
    }
    
    .upload-limits {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .modern-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .modern-notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .upload-icon i {
        font-size: 2.5rem;
    }
    
    .upload-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .modern-upload-area {
        padding: 1rem;
    }
    
    .modern-preview-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-actions {
        gap: 0.25rem;
    }
    
    .preview-actions button {
        width: 36px;
        height: 36px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .modern-upload-area {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-color: #374151;
    }
    
    .modern-upload-area:hover {
        background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
        border-color: #3b82f6;
    }
    
    .upload-title {
        color: #f9fafb;
    }
    
    .upload-description {
        color: #d1d5db;
    }
    
    .limit-item {
        background: rgba(31, 41, 55, 0.8);
        color: #d1d5db;
        border-color: #4b5563;
    }
    
    .image-preview-item {
        background: #1f2937;
    }
    
    .preview-info {
        background: #1f2937;
    }
    
    .file-name {
        color: #f9fafb;
    }
    
    .file-size {
        color: #d1d5db;
    }
    
    .photo-counter {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
        color: #f9fafb;
        border-color: #6b7280;
    }
}

/* Accessibility improvements */
.modern-upload-area:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.preview-actions button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.btn-select-files:focus {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .modern-upload-area {
        border-width: 3px;
    }
    
    .preview-actions button {
        border: 2px solid currentColor;
    }
    
    .status-indicator {
        border-width: 3px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .modern-upload-area,
    .image-preview-item,
    .preview-image,
    .preview-overlay,
    .preview-actions button,
    .btn-select-files {
        transition: none;
    }
    
    .progress-fill::after {
        animation: none;
    }
    
    .modern-notification {
        animation: none;
    }
}

/* Print styles */
@media print {
    .modern-upload-area,
    .preview-actions,
    .upload-status,
    .modern-notification {
        display: none;
    }
    
    .modern-preview-grid {
        display: block;
    }
    
    .image-preview-item {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}