
/* Instagram-like Explore Page Styles */
:root {
    --explore-bg: #000;
    --explore-border: #262626;
    --explore-text: #fafafa;
    --explore-text-muted: #8e8e8e;
    --explore-accent: #8240FF;
    --explore-accent-light: #D2B8FF;
}

.explore-page {
    background: var(--explore-bg);
    min-height: 100vh;
}

.explore-container {
    background: var(--explore-bg);
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Stories-style Horizontal Chat Bar */
.stories-bar {
    background: var(--explore-bg);
    border-bottom: 1px solid var(--explore-border);
    padding: 12px 0;
}

.stories-list {
    display: flex;
    gap: 16px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stories-list::-webkit-scrollbar {
    display: none;
}

.stories-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 8px;
    color: var(--explore-text-muted);
}

/* Story Avatar Style */
.chat-thumb-container {
    flex: 0 0 auto;
    text-align: center;
}

.chat-thumb-card {
    width: 66px !important;
    height: 66px !important;
    border-radius: 50% !important;
    border: 2px solid transparent !important;
    background: linear-gradient(var(--explore-bg), var(--explore-bg)) padding-box,
                linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888) border-box;
    padding: 3px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chat-thumb-card:hover {
    transform: scale(1.05);
}

.chat-thumb-card img {
    border-radius: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--explore-bg);
    border-bottom: 1px solid var(--explore-border);
    z-index: 100;
    top: 56px;
}

@media (max-width: 991px) {
    .filter-bar {
        top: 50px;
    }
}

/* Tags Scroll */
.tags-scroll {
    display: flex;
    flex: 1;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}

.tags-scroll::-webkit-scrollbar {
    display: none;
}

.tags-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--explore-text-muted);
    font-size: 12px;
}

/* Query Tag Pills */
.query-tag {
    flex-shrink: 0;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: var(--explore-border);
    color: var(--explore-text);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.query-tag:hover {
    background: #363636;
}

.query-tag.active {
    background: var(--explore-text) !important;
    color: var(--explore-bg) !important;
}

/* Filter Icons */
.filter-icons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.filter-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: var(--explore-border);
    color: var(--explore-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.filter-icon-btn:hover,
.filter-icon-btn.active {
    background: var(--explore-text);
    color: var(--explore-bg);
}

.filter-dropdown {
    background: #262626;
    border: 1px solid #363636;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.filter-dropdown .dropdown-item {
    color: var(--explore-text);
    padding: 10px 16px;
    font-size: 14px;
}

.filter-dropdown .dropdown-item:hover {
    background: #363636;
}

.filter-dropdown .dropdown-divider {
    border-color: #363636;
}

/* Explore Grid Gallery */
.explore-gallery {
    padding: 2px;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

@media (min-width: 768px) {
    .explore-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
    }
}

@media (min-width: 1200px) {
    .explore-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }
}

@media (min-width: 1600px) {
    .explore-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Gallery Card - Instagram Style */
.gallery-card {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: #1a1a1a;
}

.gallery-card .card {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    height: 100%;
}

.gallery-card .gallery-image-wrapper {
    aspect-ratio: 1 !important;
    border-radius: 0 !important;
}

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

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

/* Hover Overlay */
.gallery-card .card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.2s ease;
    pointer-events: none;
}

.gallery-card:hover .card::after {
    background: rgba(0,0,0,0.3);
}

/* Card Overlay Content - Hidden by default, shown on hover */
.gallery-card .position-absolute.bottom-0 {
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.gallery-card:hover .position-absolute.bottom-0 {
    opacity: 1;
}

/* Hide bottom gradient by default */
.gallery-card .position-absolute[style*="gradient"] {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-card:hover .position-absolute[style*="gradient"] {
    opacity: 1;
}

/* Top badges always visible */
.gallery-card .position-absolute.top-0 {
    z-index: 10;
}

/* Multi-image indicator */
.gallery-card .multi-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    color: white;
    font-size: 18px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
    z-index: 5;
}

/* Video indicator */
.gallery-card .video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 48px;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    z-index: 5;
}

/* NSFW Blur - Only apply when gallery has blur-nsfw class */
.blur-nsfw .nsfw-content img {
    filter: blur(20px);
}

.blur-nsfw .nsfw-content:hover img {
    filter: blur(10px);
}

/* When user opts to show NSFW, no blur */
.nsfw-content img {
    transition: filter 0.3s ease;
}

/* Premium indicator */
.premium-chat::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--explore-accent);
    pointer-events: none;
    z-index: 5;
}

/* Load More Area */
.load-more-area {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--explore-text-muted);
}

/* Spinner */
.spinner-border {
    color: var(--explore-text);
    border-color: var(--explore-text);
    border-right-color: transparent;
}

.text-purple {
    color: var(--explore-accent) !important;
}

/* Badge Styles */
.gallery-card .badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
}

/* Hidden elements for compatibility */
#selected-gender-text {
    display: none;
}

/* Override Bootstrap Grid for Gallery */
.explore-grid .gallery-card.col-6,
.explore-grid .gallery-card.col-sm-6,
.explore-grid .gallery-card.col-lg-3,
.explore-grid .gallery-card.col-xl-2 {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Responsive text */
@media (max-width: 576px) {
    .gallery-card h6 {
        font-size: 0.75rem !important;
    }
    
    .gallery-card .badge {
        font-size: 8px;
    }
    
    .filter-bar {
        padding: 8px 10px;
    }
    
    .query-tag {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .filter-icon-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Safe area for mobile */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .explore-gallery {
        padding-bottom: calc(env(safe-area-inset-bottom) + 60px);
    }
}

/* Touch feedback */
@media (hover: none) {
    .gallery-card:active {
        opacity: 0.7;
    }
    
    .query-tag:active {
        transform: scale(0.95);
    }
}

/* Gallery hover effects - preserve for compatibility */
.gallery-hover {
    transition: transform 0.3s ease;
}

.gallery-img {
    transition: opacity 0.3s ease;
}