/* Gallery specific styles */

.gallery-header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    gap: 2rem;
}

.model-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.model-filter label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.filter-select {
    background-color: var(--secondary-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-bordeaux);
}

.gallery-stats {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Masonry Gallery Grid */
.gallery-container {
    padding: 1rem 0;
}

.gallery-grid {
    column-count: 4;
    column-gap: 1rem;
    line-height: 0;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--secondary-dark);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(114, 47, 55, 0.3);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--text-primary);
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: translateY(100%);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item-model {
    font-size: 0.8rem;
    color: var(--accent-bordeaux-light);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.gallery-item-prompt {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading Spinner */
.loading-spinner, .modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-bordeaux);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    margin: 2% auto;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.modal-image-container {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

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

.modal-info {
    width: 300px;
    background-color: var(--secondary-dark);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.modal-info h3 {
    color: var(--accent-bordeaux-light);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.modal-info p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.modal-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.prompt-section {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.prompt-section strong {
    color: var(--accent-bordeaux-light);
    display: block;
    margin-bottom: 0.25rem;
}

.negative-prompt strong {
    color: #d73a49;
}

.modal-close {
    position: absolute;
    top: -2rem;
    right: 0;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background-color: var(--secondary-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.modal-close:hover {
    background-color: var(--accent-bordeaux);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        column-count: 2;
    }
    
    .gallery-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-content {
        flex-direction: column;
        margin: 5% auto;
        max-width: 95vw;
    }
    
    .modal-info {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        column-count: 1;
    }
    
    .page-title {
        font-size: 2rem;
    }
} 