/* ==========================================================================
   TechHub - Modern Minimalist Instagram-Style Explore Feed Styles
   ========================================================================== */

/* Page Container - Matches site background seamlessly */
.explore-page-wrapper {
    min-height: 85vh;
    background-color: var(--bs-body-bg);
    padding-top: 1.5rem;
    padding-bottom: 3.5rem;
}

/* Header & Counter Badge */
.explore-count-badge {
    background-color: var(--bs-card-bg, #ffffff);
    color: var(--bs-primary);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

[data-bs-theme="dark"] .explore-count-badge {
    background-color: #161c24;
    color: var(--bs-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Category Filter Bar */
.explore-categories-wrapper {
    position: relative;
    padding: 2px 0;
}

.explore-categories-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    padding: 4px 2px;
}

.explore-categories-bar::-webkit-scrollbar {
    display: none;
}

.drag-scroll-container.is-dragging {
    cursor: grabbing;
}

/* Category Pills */
.explore-cat-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 50rem;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    background-color: var(--bs-card-bg, #ffffff);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

[data-bs-theme="dark"] .explore-cat-pill {
    background-color: #161c24;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.explore-cat-pill:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    border-color: rgba(var(--bs-primary-rgb), 0.35);
    color: var(--bs-primary);
    transform: translateY(-1px);
}

.explore-cat-pill.active {
    background: var(--bs-primary) !important;
    color: #ffffff !important;
    border-color: var(--bs-primary) !important;
    box-shadow: 0 4px 14px rgba(var(--bs-primary-rgb), 0.35);
}

/* ==========================================================================
   Modern Minimalist Cards (Framed & Distinct on Natural Background)
   ========================================================================== */

.explore-card {
    border-radius: 20px !important;
    background-color: var(--bs-card-bg, #ffffff) !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

[data-bs-theme="dark"] .explore-card {
    background-color: #161c24 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
}

.explore-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09) !important;
    border-color: rgba(var(--bs-primary-rgb), 0.35) !important;
}

[data-bs-theme="dark"] .explore-card:hover {
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.65) !important;
    border-color: rgba(var(--bs-primary-rgb), 0.45) !important;
}

/* Card Header */
.explore-card-header {
    background: transparent;
    border-bottom: 0;
}

.explore-cat-tag {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 50rem;
    background: rgba(var(--bs-primary-rgb), 0.08);
    color: var(--bs-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.explore-cat-tag:hover {
    background: rgba(var(--bs-primary-rgb), 0.16);
    color: var(--bs-primary);
}

.explore-tag-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    display: inline-block;
}

.explore-meta-time {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

[data-bs-theme="dark"] .explore-meta-time {
    color: #94a3b8;
}

/* Media & Image */
.explore-media-wrapper {
    overflow: hidden;
    background-color: rgba(var(--bs-tertiary-bg-rgb), 0.5);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.explore-card-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.explore-media-wrapper:hover .explore-card-image {
    transform: scale(1.02);
}

/* Double-Tap Heart Popup Animation (Instagram Like) */
.explore-heart-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: #ef4444;
    font-size: 5.5rem;
    pointer-events: none;
    opacity: 0;
    z-index: 10;
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.35));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.explore-heart-popup.show-heart {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.95;
    animation: heartBurst 0.85s forwards ease-in-out;
}

@keyframes heartBurst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    45% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.9;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
}

/* Action Buttons */
.explore-action-btn {
    border: none;
    background: transparent;
    color: var(--bs-body-color);
    padding: 6px 10px;
    border-radius: 50rem;
    font-size: 0.94rem;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
    cursor: pointer;
}

.explore-action-btn:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    transform: scale(1.07);
    color: var(--bs-primary);
}

.explore-action-btn:active {
    transform: scale(0.93);
}

.explore-vote-btn.btn-like.active {
    color: #ef4444 !important;
}

.explore-vote-btn.btn-like.active i {
    animation: heartPulse 0.3s ease;
}

.explore-vote-btn.btn-dislike.active {
    color: #eab308 !important;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Minimal Read More Link */
.explore-read-btn {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 50rem;
    color: var(--bs-primary);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.25);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    background: transparent;
}

.explore-read-btn:hover {
    background: var(--bs-primary);
    color: #ffffff;
    border-color: var(--bs-primary);
    transform: translateX(-2px);
}

.explore-read-btn i {
    transition: transform 0.2s ease;
}

.explore-read-btn:hover i {
    transform: translateX(-3px);
}

/* Content Typography */
.explore-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.6;
}

.explore-title-link {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.15s ease;
}

[data-bs-theme="dark"] .explore-title-link {
    color: #f1f5f9;
}

.explore-title-link:hover {
    color: var(--bs-primary);
}

.explore-summary {
    font-size: 0.92rem;
    line-height: 1.75;
    color: #334155; /* High contrast, deep rich slate for light mode */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.85rem;
}

[data-bs-theme="dark"] .explore-summary {
    color: #cbd5e1; /* Soft clear white for dark mode */
}

/* Minimalist Comment Prompt Input Pill */
.explore-comment-prompt {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50rem;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: #475569;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

[data-bs-theme="dark"] .explore-comment-prompt {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

.explore-comment-prompt:hover {
    background: rgba(var(--bs-primary-rgb), 0.06);
    border-color: rgba(var(--bs-primary-rgb), 0.3);
    color: var(--bs-primary);
}

/* Captcha Refresh Icon Rotation */
#exploreRefreshCaptchaBtn i {
    transition: transform 0.35s ease;
}

/* Comments Modal / Bottom-Sheet */
.explore-comments-scroll {
    max-height: 380px;
    overflow-y: auto;
}

/* Mobile Bottom-Sheet Behavior */
@media (max-width: 576px) {
    .explore-comments-modal .modal-dialog {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        max-width: 100%;
        transform: translate3d(0, 100%, 0);
        transition: transform 0.28s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .explore-comments-modal.show .modal-dialog {
        transform: translate3d(0, 0, 0);
    }

    .explore-comments-modal .modal-content {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        border-top-left-radius: 1.25rem !important;
        border-top-right-radius: 1.25rem !important;
        max-height: 82vh;
    }

    .explore-comments-scroll {
        max-height: 48vh;
    }
}
