/* =============================================
 * Coded By - DARK LMNx9 (Limon Hossain)
 * GitHub - https://github.com/LMNx9-JOHNY
 * Website - https://dark.lmnx9.workers.dev
 * WhatsApp - https://wa.me/+8801882168975
 * Telegram - https://t.me/x_LMNx9
============================================= */
:root {
    --hb-primary: #1b4d3e;
    --hb-dark-green: #0f3a2e;
    --hb-purple: #800080;
    --hb-deep-pink: #ff1493;
    --hb-purple-light: #f3e8f3;
    --hb-pink-light: #fff0f7;
    --hb-primary-light: #e8f3ef;

    --text-dark: #1a1a1a;
    --text-light: #4a4a4a;
    --text-muted: #666666;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-light: #e1e1e1;

    --shadow-sm: 0 5px 15px rgba(27, 77, 62, 0.08);
    --shadow-md: 0 10px 25px rgba(128, 0, 128, 0.1);
    --shadow-lg: 0 20px 40px rgba(255, 20, 147, 0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Mina", sans-serif;
}

body {
    background-color: var(--bg-light);
    padding-top: 80px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 9999;
    padding: 12px 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
}

#LOGO {
    width: clamp(100px, 15vw, 140px);
    height: auto;
    transition: var(--transition);
}

#LOGO:hover {
    transform: scale(1.05);
}

.profile-img {
    width: clamp(38px, 8vw, 44px);
    height: clamp(38px, 8vw, 44px);
    border-radius: 50%;
    border: 2px solid var(--hb-primary);
    object-fit: cover;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(27, 77, 62, 0.2);
}

.profile-img:hover {
    transform: scale(1.1);
    border-color: var(--hb-deep-pink);
    box-shadow: 0 4px 12px rgba(255, 20, 147, 0.3);
}

.page-header {
    text-align: center;
    margin: 30px 0 20px;
    position: relative;
}

.page-header h2 {
    font-weight: 700;
    font-size: clamp(24px, 5vw, 32px);
    margin: 10px 0;
    background: linear-gradient(
        135deg,
        var(--hb-primary),
        var(--hb-purple),
        var(--hb-deep-pink)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header .subtitle {
    color: var(--hb-purple);
    font-size: clamp(14px, 3vw, 16px);
}

.page-header hr {
    border: none;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--hb-primary),
        var(--hb-purple),
        var(--hb-deep-pink),
        transparent
    );
    width: min(150px, 30%);
    margin: 15px auto;
}

.stats-section {
    margin: 20px 0 30px;
    padding: 0 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    max-width: 1000px;
    margin: 0 auto;
}

.stat-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 16px 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--hb-primary), var(--hb-deep-pink));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    width: 45px;
    height: 45px;
    background: var(--hb-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    background: linear-gradient(135deg, var(--hb-primary), var(--hb-purple));
    color: white !important;
}

.stat-count {
    font-size: clamp(20px, 4vw, 24px);
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: clamp(12px, 2.5vw, 13px);
    color: var(--text-muted);
    font-weight: 500;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 25px 0 30px;
    padding: 0 15px;
}

.btn-filter {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    color: var(--text-light);
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 40px;
    transition: var(--transition);
    font-size: 15px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    flex: 0 0 auto;
    min-width: 90px;
}

.btn-filter:hover {
    border-color: var(--hb-deep-pink);
    color: var(--hb-deep-pink);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-filter.active {
    background: linear-gradient(135deg, var(--hb-primary), var(--hb-purple));
    border-color: transparent;
    color: white;
    box-shadow: 0 5px 15px rgba(128, 0, 128, 0.3);
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 10px 15px 30px;
    margin: 0 auto;
    max-width: 900px;
    min-height: 400px;
    transition: opacity 0.3s ease;
}

.cards-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

.leaderboard-card {
    width: 100%;
    max-width: 400px;
    height: 440px;
    background: linear-gradient(
        145deg,
        var(--hb-primary) 0%,
        var(--hb-purple) 100%
    );
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaderboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.leaderboard-card-top {
    height: 30%;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
}

.leaderboard-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    padding: 5px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.leaderboard-img img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--hb-deep-pink);
    display: block;
    transition: transform 0.3s ease;
}

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

.leaderboard-card-bottom {
    height: 70%;
    background: #fff;
    padding: 1.2rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    border-radius: 28px 28px 0 0;
    margin-top: -10px;
    position: relative;
}

.leaderboard-card-bottom::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(90deg, var(--hb-primary), var(--hb-deep-pink));
    border-radius: 2px;
}

.leaderboard-card-bottom .name {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    color: var(--hb-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3rem;
}

.leaderboard-card-bottom .details {
    font-size: 0.85rem;
    color: var(--text-muted);
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.leaderboard-card-bottom .details p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0.3rem 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px dashed var(--border-light);
    padding-bottom: 0.3rem;
    gap: 8px;
}

.leaderboard-card-bottom .details p:last-child {
    border-bottom: none;
}

.leaderboard-card-bottom .details p strong {
    color: var(--hb-primary);
    font-weight: 600;
    min-width: 75px;
    font-size: 0.8rem;
}

.leaderboard-card-bottom .details p span {
    text-align: right;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--hb-purple);
}

.leaderboard-card-bottom .details::-webkit-scrollbar {
    width: 3px;
}

.leaderboard-card-bottom .details::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.leaderboard-card-bottom .details::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--hb-primary), var(--hb-deep-pink));
    border-radius: 3px;
}

.no-results {
    width: 100%;
    text-align: center;
    padding: 20px 10px;
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    grid-column: span 2;
}

.no-results i {
    color: var(--hb-primary);
    margin-bottom: 5px;
}

.no-results h4 {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1rem;
}

.no-results p {
    color: var(--text-muted);
}

.count-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--hb-primary), var(--hb-purple));
    color: white;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 500;
    margin: 10px 0 30px;
    font-size: 14px;
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .main-nav {
        padding: 8px 16px;
    }

    #LOGO {
        width: 100px;
    }

    .profile-img {
        width: 36px;
        height: 36px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 8px;
    }

    .stat-card {
        padding: 12px 5px;
    }

    .stat-count {
        font-size: 18px;
    }

    .stat-label {
        font-size: 11px;
    }

    .btn-filter {
        padding: 8px 18px;
        font-size: 14px;
        min-width: 80px;
    }

    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 10px 10px 20px;
        max-width: 700px;
    }

    .leaderboard-card {
        height: 420px;
        max-width: 350px;
    }

    .leaderboard-img {
        width: 90px;
        height: 90px;
    }

    .leaderboard-card-bottom .name {
        font-size: 1rem;
        min-height: 2.8rem;
    }

    .no-results {
        grid-column: span 2;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-container {
        gap: 8px;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 5px 15px 10px;
        -webkit-overflow-scrolling: touch;
    }

    .filter-container::-webkit-scrollbar {
        display: none;
    }

    .btn-filter {
        padding: 6px 14px;
        font-size: 13px;
        min-width: 70px;
        flex: 0 0 auto;
    }

    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 10px 8px 20px;
        max-width: 500px;
    }

    .leaderboard-card {
        height: 400px;
        max-width: 300px;
    }

    .leaderboard-card-bottom .name {
        font-size: 0.9rem;
        min-height: 2.5rem;
    }

    .leaderboard-card-bottom .details p {
        font-size: 0.75rem;
    }

    .leaderboard-card-bottom .details p strong {
        min-width: 65px;
        font-size: 0.7rem;
    }

    .leaderboard-card-bottom .details p span {
        font-size: 0.7rem;
    }

    .no-results {
        grid-column: span 2;
        padding: 20px 10px;
    }
}

@media (max-width: 480px) {
    .page-header h2 {
        font-size: 22px;
    }

    .page-header .subtitle {
        font-size: 13px;
    }

    .btn-filter {
        padding: 5px 12px;
        font-size: 12px;
        min-width: 65px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stat-count {
        font-size: 16px;
    }

    .stat-label {
        font-size: 10px;
    }

    .cards-container {
        gap: 10px;
        padding: 10px 6px 20px;
    }

    .leaderboard-card {
        height: 380px;
        max-width: 280px;
    }

    .leaderboard-img {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 320px) {
    .cards-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .leaderboard-card {
        max-width: 260px;
        height: 400px;
    }

    .no-results {
        grid-column: span 1;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .stats-section {
        margin: 10px 0;
    }

    .cards-container {
        gap: 15px;
    }

    .leaderboard-card {
        height: 380px;
    }
}

@media (hover: none) {
    .leaderboard-card:hover,
    .stat-card:hover,
    .btn-filter:hover {
        transform: none;
    }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
