/* Cards Grid Layout */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

.lobby-card {
    background: rgba(22, 22, 28, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    height: 100%;
}

.lobby-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Game theme glows */
.lobby-card.game-valorant {
    border-left: 4px solid #ff4655;
}

@media (hover: hover) {}

.lobby-card.game-cs2 {
    border-left: 4px solid #ffbd2e;
}

@media (hover: hover) {}

.lobby-card.game-lol {
    border-left: 4px solid #00baff;
}

@media (hover: hover) {}

.lobby-card.game-apex {
    border-left: 4px solid #ff3333;
}

@media (hover: hover) {}

.lobby-card.game-gta {
    border-left: 4px solid #2ecc71;
}

@media (hover: hover) {}

.lobby-card.game-roblox {
    border-left: 4px solid #ff2550;
}

@media (hover: hover) {}

.lobby-card.game-minecraft {
    border-left: 4px solid #57b846;
}

@media (hover: hover) {}

.lobby-card.game-fortnite {
    border-left: 4px solid #a238ff;
}

@media (hover: hover) {}

.lobby-card.game-pubg {
    border-left: 4px solid #e67e22;
}

@media (hover: hover) {}

.lobby-card.game-rocketleague {
    border-left: 4px solid #0088ff;
}

@media (hover: hover) {}

.lobby-card.game-mlbb {
    border-left: 4px solid #f1c40f;
}

@media (hover: hover) {}

.lobby-card.game-brawlstars {
    border-left: 4px solid #ff8000;
}

@media (hover: hover) {}

.lobby-card.game-cod {
    border-left: 4px solid #d4af37;
}

@media (hover: hover) {}

.lobby-card.game-rust {
    border-left: 4px solid #cd3e00;
}

@media (hover: hover) {}

.lobby-card.game-dbd {
    border-left: 4px solid #8b0000;
}

@media (hover: hover) {}

.lobby-card.game-amongus {
    border-left: 4px solid #ff1a1a;
}

@media (hover: hover) {}

.lobby-card.game-lethalcompany {
    border-left: 4px solid #ff8c00;
}

@media (hover: hover) {}

.lobby-card.game-terraria {
    border-left: 4px solid #16a085;
}

@media (hover: hover) {}

.lobby-card.game-other {
    border-left: 4px solid rgba(255, 255, 255, 0.3);
}

@media (hover: hover) {}

@media (hover: hover) {}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.85rem;
    z-index: 2;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.player-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.player-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-ago {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Game Badges */
.game-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.game-badge-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    opacity: 0.9;
}

.game-badge.game-valorant {
    background: rgba(255, 70, 85, 0.12);
    color: #ff4655;
    border: 1px solid rgba(255, 70, 85, 0.2);
}

.game-badge.game-cs2 {
    background: rgba(255, 189, 46, 0.12);
    color: #ffbd2e;
    border: 1px solid rgba(255, 189, 46, 0.2);
}

.game-badge.game-lol {
    background: rgba(0, 186, 255, 0.12);
    color: #00baff;
    border: 1px solid rgba(0, 186, 255, 0.2);
}

.game-badge.game-apex {
    background: rgba(255, 51, 51, 0.12);
    color: #ff3333;
    border: 1px solid rgba(255, 51, 51, 0.2);
}

.game-badge.game-gta {
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.game-badge.game-roblox {
    background: rgba(255, 37, 80, 0.12);
    color: #ff2550;
    border: 1px solid rgba(255, 37, 80, 0.2);
}

.game-badge.game-minecraft {
    background: rgba(87, 184, 70, 0.12);
    color: #57b846;
    border: 1px solid rgba(87, 184, 70, 0.2);
}

.game-badge.game-fortnite {
    background: rgba(162, 56, 255, 0.12);
    color: #a238ff;
    border: 1px solid rgba(162, 56, 255, 0.2);
}

.game-badge.game-pubg {
    background: rgba(230, 126, 34, 0.12);
    color: #e67e22;
    border: 1px solid rgba(230, 126, 34, 0.2);
}

.game-badge.game-rocketleague {
    background: rgba(0, 136, 255, 0.12);
    color: #0088ff;
    border: 1px solid rgba(0, 136, 255, 0.2);
}

.game-badge.game-mlbb {
    background: rgba(241, 196, 15, 0.12);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.2);
}

.game-badge.game-brawlstars {
    background: rgba(255, 128, 0, 0.12);
    color: #ff8000;
    border: 1px solid rgba(255, 128, 0, 0.2);
}

.game-badge.game-cod {
    background: rgba(212, 175, 55, 0.12);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.game-badge.game-rust {
    background: rgba(205, 62, 0, 0.12);
    color: #cd3e00;
    border: 1px solid rgba(205, 62, 0, 0.2);
}

.game-badge.game-dbd {
    background: rgba(139, 0, 0, 0.12);
    color: #8b0000;
    border: 1px solid rgba(139, 0, 0, 0.2);
}

.game-badge.game-amongus {
    background: rgba(255, 26, 26, 0.12);
    color: #ff1a1a;
    border: 1px solid rgba(255, 26, 26, 0.2);
}

.game-badge.game-lethalcompany {
    background: rgba(255, 140, 0, 0.12);
    color: #ff8c00;
    border: 1px solid rgba(255, 140, 0, 0.2);
}

.game-badge.game-terraria {
    background: rgba(22, 160, 133, 0.12);
    color: #16a085;
    border: 1px solid rgba(22, 160, 133, 0.2);
}

.game-badge.game-other {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Card Body */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2;
    flex: 1;
    margin-top: -0.75rem;
    /* Pull rank badges to the top line */
}

.rank-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rank-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #00ffcc;
    background: rgba(0, 255, 204, 0.08);
    border: 1px solid rgba(0, 255, 204, 0.15);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.mode-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.lobby-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    font-style: italic;
    overflow-wrap: break-word;
    word-break: break-word;
    margin-top: auto;
    margin-bottom: auto;
    /* Vertically center the text to fill the card's stretch space */
}

.lobby-meta-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.tag-meta {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Slots and Hype */
.card-slots-hype {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -0.75rem;
    /* Pull bottom line UP to the tags */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.85rem;
    z-index: 2;
}

.slots-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slots-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.slots-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.slots-dots {
    display: flex;
    gap: 0.25rem;
}

.slot-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s;
}

.slot-dot.filled {
    background: #00ffcc;
    box-shadow: 0 0 6px #00ffcc;
}

/* Player Game ID in Footer */
.footer-game-id {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    overflow-wrap: break-word;
    word-break: break-word;
}

@media (hover: hover) {}

.footer-game-id i {
    color: #ff4655;
    opacity: 0.9;
}


/* Hype Button */
.btn-hype {
    background: rgba(255, 70, 85, 0.08);
    border: 1px solid rgba(255, 70, 85, 0.2);
    color: #ff4655;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-hype:hover {
    background: rgba(255, 70, 85, 0.2);
    border-color: rgba(255, 70, 85, 0.4);
    box-shadow: 0 0 10px rgba(255, 70, 85, 0.15);
    transform: scale(1.05);
}

.btn-hype i {
    animation: pulse-fire 2s infinite;
}

@keyframes pulse-fire {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
        text-shadow: 0 0 8px #ff4655;
    }

    100% {
        transform: scale(1);
    }
}

/* Discord Button */
.card-footer {
    z-index: 2;
}

.discord-join-btn {
    width: 100%;
    padding: 0.75rem;
    background: #5865F2;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.2);
}

@media (hover: hover) {}

/* Delete Lobby Button */
.delete-lobby-btn {
    background: rgba(255, 70, 85, 0.1);
    color: #ff4655;
    border: 1px solid rgba(255, 70, 85, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.delete-lobby-btn:hover {
    background: rgba(255, 70, 85, 0.25);
    border-color: rgba(255, 70, 85, 0.4);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 70, 85, 0.2);
}

/* Smart Row List View Redesign */
.cards-grid.list-view {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.cards-grid.list-view .lobby-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    gap: 1rem;
    height: auto;
}

/* Header */
.cards-grid.list-view .card-header {
    border-bottom: none;
    padding-bottom: 0;
    flex: 0 1 310px;
    /* Increased slightly to push content right */
    display: flex;
    gap: 1rem;
    align-items: center;
    min-width: 0;
}

.cards-grid.list-view .user-profile {
    flex: 0 1 190px;
    /* Increased slightly to give name more space and push badge right */
    min-width: 0;
}

.cards-grid.list-view .game-info {
    margin-left: 0;
    flex: 0 0 auto;
}

/* Body */
.cards-grid.list-view .card-body {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1rem;
    flex: 0 1 140px;
    margin: 0;
    min-width: 0;
}

.cards-grid.list-view .lobby-desc,
.cards-grid.list-view .lobby-meta-tags,
.cards-grid.list-view .rank-label {
    display: none;
    /* Hide extra elements */
}

.cards-grid.list-view .rank-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    min-width: 0;
}

.cards-grid.list-view .mode-label {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Slots & ID */
.cards-grid.list-view .card-slots-hype {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    flex: 1 1 auto;
    /* Take remaining space */
    justify-content: flex-start;
    gap: 1rem;
    min-width: 0;
}

.cards-grid.list-view .slots-dots {
    display: none;
    /* Hide dots in list view as requested */
}

.cards-grid.list-view .player-game-id {
    display: none;
    /* Hide old ID in list view if it was here */
}

/* Footer (Button & ID) */
.cards-grid.list-view .card-footer {
    width: 190px;
    /* Made buttons longer */
    flex: 0 0 190px;
    flex-shrink: 0;
    margin-top: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.cards-grid.list-view .discord-join-btn {
    width: 100%;
    padding: 0.6rem;
    font-size: 0.85rem;
    margin: 0;
    text-align: center;
    justify-content: center;
    display: flex;
    align-items: center;
}

.cards-grid.list-view .footer-game-id {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Icon on the left, text on its right */
    gap: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    white-space: nowrap;
}

.cards-grid.list-view .footer-game-id .id-label {
    display: none;
    /* Hide the label in list view to save space */
}

.cards-grid.list-view .footer-game-id .id-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cards-grid.list-view .footer-game-id .long-text {
    font-size: 0.7rem;
    letter-spacing: -0.01em;
}

/* Delete Button Position in List View */
.cards-grid.list-view .lobby-card.is-owner {
    padding-right: 4.5rem;
    /* Make room for the absolute delete button on the right */
}

.cards-grid.list-view .delete-lobby-btn {
    position: absolute !important;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
    z-index: 10;
}

@media (max-width: 1024px) {
    .cards-grid.list-view .lobby-card {
        flex-wrap: wrap;
    }

    .cards-grid.list-view .card-body {
        order: 3;
        flex: 1 1 100%;
        margin-top: 0.5rem;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .cards-grid.list-view {
        width: 100% !important;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .cards-grid.list-view .lobby-card {
        flex-direction: column;
        padding: 0.8rem 1rem;
        gap: 0;
        height: auto !important;
        align-items: stretch;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Row 1: Header */
    .cards-grid.list-view .card-header {
        flex: 0 0 auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0.4rem;
        width: 100%;
    }

    .cards-grid.list-view .user-profile {
        display: flex;
        align-items: center;
        gap: 0.6rem;
    }

    .cards-grid.list-view .user-avatar {
        width: 32px !important;
        height: 32px !important;
        border-radius: 50%;
        /* Circle for list view symmetry */
    }

    .cards-grid.list-view .player-name {
        font-size: 0.9rem;
        font-weight: 700;
        margin: 0;
    }

    .cards-grid.list-view .time-ago {
        font-size: 0.65rem;
        opacity: 0.7;
    }

    .cards-grid.list-view .game-info {
        margin: 0;
    }

    .cards-grid.list-view .game-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    /* Row 2: Description */
    .cards-grid.list-view .card-body {
        flex: 0 0 auto;
        margin: 0 0 0.5rem 0;
        padding: 0;
        width: 100%;
    }

    .cards-grid.list-view .lobby-desc {
        font-size: 0.8rem;
        color: var(--text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        /* Single line for perfect symmetry */
        margin: 0;
    }

    /* Hide tags */
    .cards-grid.list-view .rank-container,
    .cards-grid.list-view .lobby-meta-tags {
        display: none !important;
    }

    /* Row 3: Footer (ID/Button) - Full Width */
    .cards-grid.list-view .card-slots-hype {
        display: none !important;
        /* Remove Ekip info as requested */
    }

    .cards-grid.list-view .card-footer {
        flex: 0 0 auto;
        width: 100%;
        margin: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 0.6rem;
    }

    .cards-grid.list-view .discord-join-btn {
        width: 100%;
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
        border-radius: 6px;
        justify-content: center;
    }

    .cards-grid.list-view .footer-game-id {
        width: 100%;
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
        border-radius: 6px;
        justify-content: center;
    }

    .cards-grid.list-view .footer-game-id .id-label {
        display: inline-block !important;
        /* Restore label to explicitly show it's an in-game ID */
    }
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
}

.page-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    height: 38px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.page-btn.page-num {
    width: 38px;
    padding: 0;
}

.page-btn.page-prev,
.page-btn.page-next {
    padding: 0 1rem;
}

.page-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-btn.active {
    background: rgba(255, 70, 85, 0.15);
    border-color: rgba(255, 70, 85, 0.4);
    color: #ff4655;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-dots {
    color: var(--text-muted);
    padding: 0 0.25rem;
    font-weight: 700;
}

    .feed-footer a i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.feed-footer a:hover i {
    transform: translateX(3px);
}

/* End of lobbyCard.css */