/* Custom styles for the Image Zoom Viewer */

/* Loading animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Image hover effects */
.image-card {
    transition: all 0.3s ease;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.image-card.loaded {
    animation: fadeIn 0.3s ease;
}

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

/* Upload area styles */
.upload-area {
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

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

/* Progress bar animation */
.progress-bar {
    transition: width 0.3s ease;
}

/* Modal animations */
.modal-enter {
    animation: modalFadeIn 0.3s ease;
}

.modal-exit {
    animation: modalFadeOut 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes modalFadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

/* OpenLayers map container */
#map {
    background-color: #f3f4f6;
    position: relative;
}

#map::before {
    content: 'Loading image...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6b7280;
    font-size: 14px;
    z-index: 10;
}

#map:not(.opacity-50)::before {
    display: none;
}

/* Fullscreen styles */
.fullscreen-map {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .text-responsive {
        font-size: 0.875rem;
    }
    
    .header-mobile {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .grid-responsive {
        grid-template-columns: 1fr;
    }
    
    .modal-responsive {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
}

/* Error and success message styles */
.message-error {
    border-left: 4px solid #ef4444;
    background-color: #fef2f2;
}

.message-success {
    border-left: 4px solid #10b981;
    background-color: #f0fdf4;
}

/* Image info sidebar */
.info-sidebar {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

/* Zoom controls styling */
.ol-zoom {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ol-zoom button {
    background-color: white;
    border: none;
    color: #374151;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.ol-zoom button:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Image gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
}

/* File input styling */
input[type="file"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-full-width {
        width: 100% !important;
        max-width: none !important;
    }
}
