@import url('global.css');

.discover-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    color: var(--text-color);
    min-height: 60vh;
    box-sizing: border-box;
}

.discover-container * {
    box-sizing: border-box;
}

.discover-container h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 40px;
    text-align: center;
}

/* Discover Toolbar */
.discover-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 14px 25px;
    background-color: var(--nav-bg-color);
    border-radius: 12px;
    margin-bottom: 10px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.toolbar-group select {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.toolbar-group select:hover,
.toolbar-group select:focus {
    border-color: var(--primary-color);
}

.toolbar-group select option {
    background-color: var(--nav-bg-color);
    color: var(--text-color);
}

/* NSFW Toggle Switch */
.toolbar-toggle input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 44px;
    height: 24px;
    background-color: #333;
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.25s ease;
    outline: none;
    flex-shrink: 0;
}

.toolbar-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background-color: #888;
    border-radius: 50%;
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.toolbar-toggle input[type="checkbox"]:checked {
    background-color: var(--danger-color);
}

.toolbar-toggle input[type="checkbox"]:checked::after {
    transform: translateX(20px);
    background-color: #fff;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 70px 30px;
    margin-top: 60px;
}

.listing-card {
    background-color: transparent;
    border-radius: 16px;
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    filter: drop-shadow(0 0px 20px rgba(0, 0, 0, 0.2));
    transition: transform 0.2s ease, filter 0.2s ease;
}

.listing-card:hover {
    transform: translateY(-5px);
    filter: drop-shadow(0 0px 30px rgba(0, 0, 0, 0.3));
}

.listing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--nav-bg-color, #1d1d1d);
    border-radius: 16px;
    z-index: -1;
    -webkit-mask: radial-gradient(circle at 50% 0, transparent 42px, black 43px);
    mask: radial-gradient(circle at 50% 0, transparent 42px, black 43px);
}

.card-avatar-container {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    z-index: 3;
}

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

.card-stats {
    display: flex;
    width: 100%;
    margin-top: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    position: relative;
}

.stat-item {
    padding: 8px 24px;
    text-align: center;
    color: #ffffff;
    display: inline-block;
    line-height: 1.3;
    border-radius: 50px;
    box-shadow: 0 0px 8px rgba(0, 0, 0, 0.4);
    min-width: 70px;
    vertical-align: middle;
}

.stat-members {
    background-color: #2B2B2B;
    z-index: 3;
    position: relative;
}

.stat-online {
    background-color: var(--primary-color);
    z-index: 2;
    position: relative;
    margin-left: -30px;
    padding-left: 40px;
}

.stat-bump {
    background-color: var(--fluxer-color);
    z-index: 1;
    position: relative;
    margin-left: -30px;
    padding-left: 40px;
}

.stat-bump:only-child {
    margin-left: 0;
    padding-left: 24px;
    width: 100%;
    box-sizing: border-box;
}

.card-content {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 5px 0 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.verified-badge-sm {
    width: 16px;
    height: 16px;
    object-fit: contain;
    margin-bottom: -2px;
}

.card-type {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary-text-color, #aaa);
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}

.card-tag {
    background-color: transparent;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-tag .tag-emoji {
    font-size: 0.75rem;
    line-height: 1;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
    margin-bottom: 25px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.action-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.95rem;
    text-decoration: none;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.action-btn:hover {
    filter: brightness(0.9);
    transform: translateY(-2px);
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--text-color);
}

.secondary-btn {
    background-color: transparent;
    border: 2px solid var(--text-color);
    color: var(--text-color);
}

/* NSFW Card Border */
.listing-card.nsfw::before {
    border: 2px solid var(--danger-color);
}

.no-listings {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--secondary-text-color);
}

.no-listings h2 {
    font-size: 2rem;
    color: var(--text-color);
}

.pagination {
    margin-top: 50px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination a {
    color: var(--text-color);
    background-color: var(--nav-bg-color);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.pagination span {
    font-weight: bold;
    color: var(--text-color);
    padding: 8px 16px;
}

@media (max-width: 1100px) {
    .discover-toolbar {
        flex-wrap: wrap;
        gap: 15px;
        padding: 12px 18px;
    }

    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 60px 20px;
    }
}

@media (max-width: 800px) {
    .discover-container {
        width: 100%;
        padding: 20px 10px;
    }

    .discover-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 20px;
    }

    .toolbar-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 6px;
    }

    .toolbar-toggle {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .toolbar-group label {
        margin-left: 5px;
    }

    .toolbar-group select {
        width: 100%;
        box-sizing: border-box;
        flex: none;
    }

    .listings-grid {
        grid-template-columns: 1fr;
    }

    .card-stats {
        flex-wrap: wrap;
        gap: 10px;
    }

    .stat-item {
        margin-left: 0 !important;
        padding-left: 24px !important;
    }
}