/* Gallery-specific styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.gallery-container {
    flex: 1;
    background-color: #0a0a0a;
    display: flex;
    flex-direction: column;
}

.gallery-header {
    background-color: #1a1a1a;
    border-bottom: 1px solid #333;
    padding: 30px 0;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.header-content p {
    color: #888;
    margin: 5px 0 0 0;
    font-size: 1.1rem;
}

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

/* Gallery Grid */
.gallery-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    flex: 1;
    align-content: start;
}

.gallery-item {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    border-color: #4a9eff;
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(74, 158, 255, 0.2);
}

.gallery-preview {
    width: 100%;
    height: 200px;
    background-color: #0f0f0f;
    position: relative;
    overflow: hidden;
}

.gallery-preview canvas {
    width: 100%;
    height: 100%;
}

.gallery-preview-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    text-align: center;
}

.gallery-info {
    padding: 20px;
}

.gallery-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 15px;
    color: #e0e0e0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #888;
}

.gallery-timestamp {
    color: #aaa;
}

.gallery-size {
    color: #4a9eff;
    font-weight: 500;
}

/* Loading */
.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading-placeholder .spinner {
    margin: 0 auto 20px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 999;
}

.modal-content {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    z-index: 1001;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #e0e0e0;
}

.modal-body {
    display: flex;
    height: 70vh;
}

.modal-viewer {
    flex: 2;
    background-color: #0f0f0f;
    position: relative;
}

.modal-viewer canvas {
    width: 100%;
    height: 100%;
}

.modal-info {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.modal-prompt h4 {
    margin: 0 0 10px 0;
    color: #4a9eff;
}

.modal-prompt p {
    margin: 0;
    line-height: 1.5;
    color: #e0e0e0;
}

.modal-details p {
    margin: 5px 0;
    color: #aaa;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .modal-body {
        flex-direction: column;
        height: auto;
        max-height: 80vh;
    }
    
    .modal-viewer {
        height: 300px;
    }
    
    .modal-info {
        padding: 20px;
    }
}