body {
    font-family: 'Inter', sans-serif;
    background-color: #0F172A;
    color: #E2E8F0;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #1E293B;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(135deg, #7C3AED, #3B82F6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #7C3AED, #5B21B6);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6D28D9, #4C1D95);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #374151;
    color: #E2E8F0;
    border: 1px solid #4B5563;
}

.btn-secondary:hover {
    background-color: #4B5563;
    transform: translateY(-2px);
}

.gallery-container {
    position: relative;
    transition: margin-right 0.3s ease;
}

.gallery-container.sidebar-open {
    margin-right: 400px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.image-card {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #1E293B;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

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

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

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.load-more-container {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    padding: 15px 30px;
    font-size: 16px;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
}

.load-more-btn:hover {
    background: linear-gradient(135deg, #2563EB, #1E40AF);
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    background-color: #374151;
    cursor: not-allowed;
    transform: none;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: #1E293B;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.open {
    right: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: #374151;
    color: #E2E8F0;
}

.sidebar-content {
    padding: 20px;
}

.sidebar-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-details {
    background-color: #0F172A;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.detail-item {
    margin-bottom: 15px;
}

.detail-label {
    font-weight: 600;
    color: #7C3AED;
    margin-bottom: 5px;
}

.detail-value {
    color: #E2E8F0;
}

#fileInput {
    display: none;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6B7280;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #7C3AED;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #374151;
    border-radius: 50%;
    border-top-color: #7C3AED;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1200px) {
    .image-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .sidebar {
        width: 100%;
        right: -100%;
    }
    
    .gallery-container.sidebar-open {
        margin-right: 0;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-controls {
        width: 100%;
        justify-content: center;
    }
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #ccc;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Placeholder card styles */
.placeholder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    height: 100%; /* Match the height of other cards */
    background-color: #1E293B; /* Match the background color of other cards */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* Match the shadow of other cards */
    position: relative;
}

.placeholder-card .spinner {
    width: 30px;
    height: 30px;
    border: 4px solid #ccc;
    border-top: 4px solid #888;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 57%;
    left: 43%;
    transform: translate(-50%, -50%);
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
    #imageGrid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    #sidebar {
        width: 300px;
    }
}

@media (max-width: 480px) {
    #imageGrid {
        grid-template-columns: 1fr;
    }

    #sidebar {
        width: 100%;
    }
}