/* Gallery Styles */
#imageGallery {
    margin-top: 40px;
    backdrop-filter: blur(15px);
    box-shadow: rgba(0, 0, 0, 0.1) 0px 8px 24px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    animation: fadeIn 0.5s ease-out;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.gallery-header h4 {
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.clear-gallery-btn {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.clear-gallery-btn:hover {
    background: #c82333;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    max-width: 100%;
    justify-items: center;
}

.gallery-item {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 300px;
    height: 200px;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    display: block;
    border-radius: 8px 8px 0 0;
    transition: transform 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-info {
    margin-bottom: 10px;
}

.gallery-timestamp {
    font-size: 12px;
    opacity: 0.8;
    display: block;
    margin-bottom: 5px;
}

.gallery-prompt {
    font-size: 14px;
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gallery-actions {
    display: flex;
    gap: 8px;
}

.gallery-download-btn,
.gallery-edit-btn {
    padding: 6px 12px;
    background: var(--quarkcode-button, #28a745);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.gallery-edit-btn {
    background: #007bff;
}

.gallery-download-btn:hover {
    background: #218838;
    text-decoration: none;
    color: white;
}

.gallery-edit-btn:hover {
    background: #0056b3;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
