/**
 * MadBot - Explore Page Styles
 * @since 1.2.0
 */

/* =====================================================
   EXPLORE CONTAINER - Same pattern as profile
   ===================================================== */

.explore-container {
    flex: 1;
    overflow-y: auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
}

.explore-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 100px;
}

/* Header */
.explore-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    padding-right: 50px;
    border-bottom: 1px solid var(--border-color);
}

.explore-header-content {
    flex: 1;
}

.explore-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.explore-subtitle {
    color: var(--text-muted);
    margin: 0;
    font-size: 14px;
}

/* Search */
.explore-search {
    flex-shrink: 0;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    min-width: 280px;
}

.search-input-wrapper svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input-wrapper input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}


/* =====================================================
   SECTIONS
   ===================================================== */

.explore-sections {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.explore-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
}

.section-title h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.section-count {
    color: var(--text-muted);
    font-size: 14px;
}

.section-view-all {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
}

.section-view-all:hover {
    opacity: 0.8;
}

/* Section Grid */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}


/* =====================================================
   EXPLORE CARDS
   ===================================================== */

.explore-card {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Light mode border */
.light-mode .explore-card {
    border-color: rgba(0,0,0,0.1);
}

.explore-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255,255,255,0.1);
}

/* Light mode shadow */
.light-mode .explore-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Avatar */
.card-avatar {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    font-size: 48px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

.card-avatar.blurred img {
    filter: blur(20px);
}

/* Badges */
.card-avatar .badge {
    position: absolute;
    top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.badge-premium {
    left: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.badge-nsfw {
    right: 8px;
    background: #dc2626;
    color: white;
}

.badge-nsfw svg {
    width: 17px;
    height: 17px;
}

/* Content */
.card-content {
    padding: 12px;
}

.card-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-creator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 6px;
    transition: color 0.2s;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-creator:hover {
    color: var(--primary);
}

.card-creator svg {
    opacity: 0.7;
}

.card-tagline {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 33px;
}

/* Stats */
.card-stats {
    display: flex;
    gap: 12px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.stat svg {
    width: 12px;
    height: 12px;
}

.stat-rating svg {
    color: #f59e0b;
}

/* Favorite Button - Heart icon only, no background */
.card-favorite {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    /* Text shadow for visibility on light images */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
    /* Hidden by default on desktop */
    opacity: 0;
}

/* Show on card hover (desktop) */
.explore-card:hover .card-favorite {
    opacity: 1;
}

.card-favorite:hover {
    color: white;
    transform: scale(1.15);
}

/* Always visible when favorited */
.card-favorite.active {
    opacity: 1;
    color: #ef4444;
}

.card-favorite.active:hover {
    color: #dc2626;
    transform: scale(1.15);
}


/* =====================================================
   EMPTY STATE
   ===================================================== */

.explore-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-muted);
}

.explore-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.explore-empty h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.explore-empty p {
    margin: 0 0 20px 0;
    font-size: 14px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .explore-container {
        padding-top: 60px; /* Space for hamburger */
    }
    
    .explore-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .explore-search {
        width: 100%;
    }
    
    .search-input-wrapper {
        min-width: 100%;
    }
    
    .section-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .card-content {
        padding: 10px;
    }
    
    .card-name {
        font-size: 13px;
    }
    
    .card-tagline {
        font-size: 11px;
        min-height: 28px;
    }
}

/* Tablet & Mobile: always show favorite heart (no hover on touch devices) */
@media (max-width: 1023px), (hover: none) {
    .card-favorite {
        opacity: 0.7;
    }
    
    .card-favorite.active {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .explore-content {
        padding: 20px 15px;
    }
    
    .section-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .explore-title {
        font-size: 24px;
    }
}

/* =====================================================
   EXPLORE SCROLLBAR
   ===================================================== */

.explore-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) rgba(255,255,255,0.08);
}

.explore-container::-webkit-scrollbar {
    width: 6px;
}

.explore-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}

.explore-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.explore-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.45);
}

/* Light mode scrollbar */
.light-mode .explore-container {
    scrollbar-color: rgba(0,0,0,0.25) rgba(0,0,0,0.05);
}

.light-mode .explore-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}

.light-mode .explore-container::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.25);
}

.light-mode .explore-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.35);
}
