/* Gallery Page Styles - DEBUGGING: Only Card Grid Styles Active */

/* COMMENTED OUT - TESTING FOR GAP ISSUES
/* Base Styles */
/*
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container:last-child {
    padding-top: 0;
}

/* Simple Gallery Header */
.simple-gallery-header {
    background: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.gallery-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #667eea;
    margin: 0 0 2rem 0;
    text-align: center;
}
*/

/* COMMENTED OUT - TESTING FOR GAP ISSUES
/* Controls Styles */
/*
.gallery-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.filter-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.clear-filters {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.clear-filters:hover {
    background: #e9ecef;
}

/* Stats Styles */
.gallery-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 0;
    padding-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.results-count {
    font-weight: 500;
}
*/

/* Gallery Images Section - TESTING FOR GAP */
.gallery-images-section {
    /* background: #f5f7fa; COMMENTED OUT FOR TESTING */
    /* padding: 0 0 2rem 0; COMMENTED OUT FOR TESTING */
}

/* Gallery Container */
#gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

/* Grid Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 0 0 2rem 0;
    padding: 0;
    justify-content: center;
}

/* Card Styles */
.puzzle-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.puzzle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.puzzle-card-image {
    position: relative;
    width: 100%;
    height: 640px;
    overflow: hidden;
}

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

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

.puzzle-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.view-detail-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.view-detail-btn:hover {
    background: white;
    transform: scale(1.1);
}

.puzzle-card-content {
    padding: 1.5rem;
}

.puzzle-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    line-height: 1.3;
}

.puzzle-card-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.puzzle-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.puzzle-card-date {
    font-size: 0.8rem;
    color: #666;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #667eea;
    color: white;
}

.puzzle-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #666;
    border: 1px solid #e9ecef;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.status-badge.published {
    background: #d4edda;
    color: #155724;
}

.status-badge.unpublished {
    background: #f8d7da;
    color: #721c24;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0 3rem 0;
    padding: 0;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.pagination-btn {
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #667eea;
    background: #f8f9ff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-ellipsis {
    font-size: 0.9rem;
    color: #666;
    padding: 0 0.5rem;
}

.pagination-info {
    font-size: 0.9rem;
    color: #666;
}

/* Detail Modal Styles */
.detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
}

.detail-modal-content {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .detail-modal {
        padding: 0.5rem;
    }
    
    .detail-modal-content {
        margin: 0 auto;
        border-radius: 8px;
    }
    
    .detail-modal-info {
        padding: 1.5rem;
    }
    
    .detail-modal-title {
        font-size: 1.5rem;
    }
    
    .detail-modal-description {
        font-size: 1rem;
    }
    
    .detail-modal-meta {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .detail-modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-action-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

.detail-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.detail-modal-close:hover {
    transform: scale(1.1);
}

.detail-modal-content .detail-modal-image,
#modal-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.detail-modal-info {
    padding: 2rem;
}

.detail-modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.detail-modal-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #666;
    margin-bottom: 2rem;
}

.detail-modal-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 1rem;
    color: #666;
}

.detail-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.detail-modal-tags .tag {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.detail-modal-actions {
    display: flex;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.modal-action-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-action-btn.primary {
    background: #667eea;
    color: white;
}

.modal-action-btn.primary:hover {
    background: #5a67d8;
}

.modal-action-btn.secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
}

.modal-action-btn.secondary:hover {
    background: #e9ecef;
}

/* Loading Styles */
.loading {
    text-align: center;
    padding: 1rem;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.error-message {
    text-align: center;
    padding: 3rem;
    color: #e53e3e;
    background: #fed7d7;
    border-radius: 8px;
    margin: 2rem 0;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.empty-state .btn {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.empty-state .btn:hover {
    background: #5a67d8;
}

/* Gallery Responsive Design */
@media (max-width: 768px) {
    #gallery-container {
        padding: 0 1rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .puzzle-card-image {
        height: 520px;
    }

    .puzzle-card-content {
        padding: 1rem;
    }

    .puzzle-card-title {
        font-size: 1.1rem;
    }

    .puzzle-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin: 1rem 0 2rem 0;
    }

    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    #gallery-container {
        padding: 0 0.5rem;
    }

    .gallery-grid {
        gap: 1rem;
    }

    .puzzle-card-image {
        height: 450px;
    }

    .puzzle-card-content {
        padding: 0.75rem;
    }

    .puzzle-card-title {
        font-size: 1rem;
    }

    .pagination {
        gap: 0.25rem;
    }

    .pagination-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
        min-width: 40px;
    }
} 