/* SnapCaption Gallery Styles - Supabase Version 2.0.0 */

/* Force Roboto font throughout the gallery */
.snapcaption-gallery-container {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.snapcaption-gallery-container * {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Controls Section */
.snapcaption-controls {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.search-label {
    margin: 0;
    color: #0d3b66;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
    font-family: 'Roboto', sans-serif;
}

.search-container {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.snapcaption-search {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
}

/* Filter Styles */
.snapcaption-filters {
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-label {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
    font-family: 'Roboto', sans-serif;
    text-align: left;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
}

/* Filter button colors by type */
.filter-section:nth-child(1) .filter-btn { /* Sport */
    background: #0d3b66;
    color: white;
}

.filter-section:nth-child(2) .filter-btn { /* Gender */
    background: #1976d2;
    color: white;
}

.filter-section:nth-child(3) .filter-btn { /* Client */
    background: #ff6b6b;
    color: white;
}

.filter-section:nth-child(4) .filter-btn { /* Platform */
    background: #4ecdc4;
    color: white;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, #0d3b66, #00a878);
    color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Animated shimmer for active buttons */
.filter-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.clear-filters {
    margin-top: 10px;
    padding: 10px 20px;
    background: white;
    color: #4ecdc4;
    border: 2px solid #4ecdc4;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.clear-filters:hover {
    background: #4ecdc4;
    color: white;
}

/* Gallery Grid - Always 3 columns on desktop */
.snapcaption-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 20px;
}

/* Gallery Card */
.gallery-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    display: flex;
    flex-direction: column;
    height: 100%;
    font-family: 'Roboto', sans-serif;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Card Header */
.card-header {
    background: linear-gradient(90deg, #0d3b66 0%, #1976d2 35%, #0d3b66 100%);
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
}

.header-sport {
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.header-sport:hover {
    opacity: 0.8;
}

.header-date {
    color: white;
    font-size: 14px;
    font-weight: 400;
    margin-left: auto;
    font-family: 'Roboto', sans-serif;
}

/* Card Image - 16:9 aspect ratio */
.card-image {
    width: 100%;
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
}

.image-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

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

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

.no-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 14px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
}

/* Card Content */
.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
}

/* Card Info */
.card-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    color: #0a4269;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Roboto', sans-serif;
}

/* Card metadata tags */
.card-meta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-tag {
    display: inline-block;
    padding: 3px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
}

/* Photographer info */
.card-photographer {
    margin-top: 8px;
    color: #666;
    font-size: 13px;
    font-style: italic;
    font-family: 'Roboto', sans-serif;
}

/* Card Action */
.card-action {
    padding: 0 15px 15px 15px;
    margin-top: auto;
    text-align: center;
}

.view-gallery-btn {
    display: inline-block;
    padding: 10px 20px;
    background: white;
    color: #4ecdc4;
    border: 2px solid #4ecdc4;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
}

.view-gallery-btn:hover {
    background: #4ecdc4;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(78, 205, 196, 0.3);
}

.no-link {
    display: inline-block;
    padding: 10px 20px;
    background: #e0e0e0;
    color: #999;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
}

/* Load More Container */
.load-more-container {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
}

.load-more-btn,
.load-all-btn {
    padding: 12px 30px;
    margin: 0 10px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.load-more-btn {
    background: #1976d2;
    color: white;
}

.load-more-btn:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.3);
}

.load-all-btn {
    background: #00a878;
    color: white;
}

.load-all-btn:hover {
    background: #00956d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 168, 120, 0.3);
}

/* Loading State */
.gallery-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
    grid-column: 1 / -1;
    font-family: 'Roboto', sans-serif;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
    grid-column: 1 / -1;
    font-family: 'Roboto', sans-serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    .snapcaption-controls {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 10px;
    }
    
    .search-label {
        margin-bottom: 10px;
    }
    
    .search-container {
        width: 100%;
        max-width: none;
    }
    
    /* Force single column on mobile */
    .snapcaption-gallery-grid {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 15px;
    }
    
    .filter-label {
        margin-bottom: 8px;
    }
    
    .filter-buttons {
        display: flex;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .card-header {
        padding: 6px 10px;
    }
    
    .header-sport,
    .header-date {
        font-size: 13px;
    }
    
    .card-meta {
        margin-top: 6px;
    }
    
    .meta-tag {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    .card-photographer {
        font-size: 12px;
    }
    
    .load-more-container {
        padding: 15px;
    }
    
    .load-more-btn,
    .load-all-btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .snapcaption-gallery-container {
        padding: 10px;
    }
    
    .search-label {
        font-size: 18px;
    }
    
    .card-header {
        height: 25px;
        padding: 5px 10px;
    }
    
    .header-sport,
    .header-date {
        font-size: 12px;
    }
    
    .card-title {
        font-size: 14px;
    }
    
    .card-content {
        min-height: 150px;
    }
}