* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

p {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.upload-container {
    border: 2px dashed #3498db;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.upload-container:hover, .upload-container.dragover {
    background: #e1f0fa;
    border-color: #2980b9;
}

.upload-icon {
    font-size: 50px;
    color: #3498db;
    margin-bottom: 15px;
}

.upload-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.upload-btn:hover {
    background: #2980b9;
}

#file-input {
    display: none;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.gallery-item img {
    cursor: pointer;
    opacity: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.05);
}

button:hover {
    opacity: 0.8;
}

/* Smooth modal appearance */
.modal-content {
    animation: fadeIn 0.3s ease;
}

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

.status {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: none;
}

.success {
    background: #d4edda;
    color: #155724;
}

.error {
    background: #f8d7da;
    color: #721c24;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
    display: none;
}

.progress {
    height: 100%;
    background: #3498db;
    width: 0;
    transition: width 0.3s ease;
}

/*.instructions {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}*/

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.instructions ol {
    margin-left: 20px;
    line-height: 1.6;
}

.instructions code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .upload-container {
        padding: 20px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Modal overlay styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
}

.modal-container {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.modal-filename {
    color: white;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    opacity: 0.8;
}

.modal-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    cursor: pointer;
    z-index: 1001;
    transition: background 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Animation for modal */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-overlay {
    animation: fadeIn 0.3s ease;
}




/* Loading state for images */


.gallery-item img.loaded {
    opacity: 1;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
}

.gallery-item.loading::before {
    opacity: 1;
}

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

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.download-btn {
    background: #28a745;
    color: white;
}

.download-btn:hover {
    background: #218838;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

.action-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}


.image-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Selected image effect */
.gallery-item.selected {
    opacity: 0.7;
    box-shadow: 0 0 0 3px #007bff;
}

/* Loading state for actions */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    color: white;
    font-size: 24px;
}

/* Gallery header with select all button */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.select-all-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.select-all-btn:hover {
    background: #5a6268;
}

.select-all-btn.selected {
    background: #007bff;
}

.select-all-btn.selected:hover {
    background: #0056b3;
}

/* Video specific styles */
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item video:hover {
    transform: scale(1.05);
}


/* Modal video styles */
.modal-container video {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    background: #000;
}

/* PDF specific styles */
.pdf-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
}

.pdf-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.pdf-filename {
    font-size: 12px;
    color: #666;
    word-break: break-word;
}

.pdf-container:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

.gallery-item .pdf-container {
    border: 2px solid #e9ecef;
}

.gallery-item.selected .pdf-container {
    border-color: #007bff;
    opacity: 0.7;
}

/* Video play icon styles */
.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: white;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 0.8;
}

/* Video container styles */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Image styles */
.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

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

/* Error states */
.load-error {
    border: 2px dashed #ff0000 !important;
    background-color: #ffeeee !important;
}

.video-container.load-error,
.gallery-item.load-error .gallery-image,
.gallery-item.load-error .video-container {
    border: 2px dashed #ff0000;
    background-color: #ffeeee;
}

/* Existing gallery item styles remain the same */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1;
}
