/**
 * List2Play Servers Plugin Styles
 * Matches List2Play frontend design with Tailwind-inspired classes
 */

/* Container */
.list2play-servers-container {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Mobile card design - visible everywhere (mobile and desktop) */
.list2play-servers-mobile {
    display: block !important;
}

/* Desktop version - always hidden */
.list2play-servers-desktop {
    display: none !important;
}

/* Mobile Card Styles */
.list2play-servers-mobile > div {
    margin-bottom: 0.75rem;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.list2play-servers-mobile > div:last-child {
    margin-bottom: 0;
}

/* Server card */
.list2play-servers-mobile > div {
    border: 1px solid rgb(30 41 59);
    background: rgba(2, 6, 23, 0.7);
}

/* Card header */
.list2play-servers-mobile .flex.items-start {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.list2play-servers-mobile .min-w-0 {
    min-width: 0;
}

.list2play-servers-mobile .flex-1 {
    flex: 1 1 0%;
}

/* Server name link */
.list2play-servers-mobile a.flex.items-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list2play-servers-mobile a.flex.items-center:hover {
    color: rgb(52, 211, 153);
}

.list2play-servers-mobile .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Status badge */
.list2play-servers-mobile .inline-flex.items-center.rounded-full {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Online status - with green glow */
.list2play-servers-mobile .border-emerald-500\/30 {
    border: 1px solid rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.15);
    color: rgb(110, 231, 183);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4), 0 0 12px rgba(16, 185, 129, 0.2);
}

/* Offline status - with red glow */
.list2play-servers-mobile .border-rose-500\/30 {
    border: 1px solid rgba(244, 63, 94, 0.3);
    background: rgba(244, 63, 94, 0.15);
    color: rgb(251, 113, 133);
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.4), 0 0 12px rgba(244, 63, 94, 0.2);
}

/* Details section */
.list2play-servers-mobile .mt-3 {
    margin-top: 0.75rem;
}

.list2play-servers-mobile .space-y-2 > * + * {
    margin-top: 0.5rem;
}

.list2play-servers-mobile .text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.list2play-servers-mobile .text-slate-300 {
    color: rgb(203, 213, 225);
}

.list2play-servers-mobile .text-slate-400 {
    color: rgb(148, 163, 184);
}

.list2play-servers-mobile .text-slate-200 {
    color: rgb(226, 232, 240);
}

.list2play-servers-mobile .text-slate-100 {
    color: rgb(241, 245, 249);
}

.list2play-servers-mobile .text-emerald-300 {
    color: rgb(110, 231, 183);
}

.list2play-servers-mobile .text-emerald-200 {
    color: rgb(167, 243, 208);
}

/* Flex items */
.list2play-servers-mobile .flex.flex-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* Buttons and badges */
.list2play-servers-mobile button,
.list2play-servers-mobile .inline-flex {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 0.375rem;
    border: 1px solid rgb(51, 65, 85);
    background: rgb(2, 6, 23);
    padding: 0.25rem 0.5rem;
    color: rgb(226, 232, 240);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.list2play-servers-mobile button:hover {
    border-color: rgb(16, 185, 129);
    color: rgb(110, 231, 183);
}

.list2play-servers-mobile button svg {
    height: 0.75rem;
    width: 0.75rem;
}

/* Badge styles */
.list2play-servers-mobile .rounded-md {
    border-radius: 0.375rem;
}

.list2play-servers-mobile .border-slate-700\/70 {
    border: 1px solid rgba(51, 65, 85, 0.7);
}

.list2play-servers-mobile .bg-slate-900\/70 {
    background: rgba(15, 23, 42, 0.7);
}

/* Game type badge - same height as address/players badges */
.list2play-servers-mobile .list2play-game-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(51, 65, 85, 0.7);
    background: rgba(15, 23, 42, 0.7);
    padding: 0.25rem 0.5rem !important;
    line-height: 1.5;
    font-size: 0.75rem;
    height: auto;
    min-height: auto;
    max-height: 1.75rem;
    box-sizing: border-box;
}

.list2play-servers-mobile .list2play-game-badge:hover {
    border-color: rgba(16, 185, 129, 0.6);
}

.list2play-servers-mobile .list2play-game-badge .text-emerald-300 {
    color: rgb(110, 231, 183);
    white-space: nowrap;
    line-height: 1.5;
    font-size: 0.75rem;
}

.list2play-servers-mobile .list2play-game-badge img {
    height: 1rem !important;
    width: 1rem !important;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
}


/* Icons */
.list2play-servers-mobile svg.h-3\.5 {
    height: 0.875rem;
    width: 0.875rem;
}

/* Vote section */
.list2play-servers-mobile .mt-3.pt-3 {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgb(30, 41, 59);
}

.list2play-servers-mobile .font-semibold {
    font-weight: 600;
}

.list2play-servers-mobile a[href*="list2play"] {
    margin-left: auto;
    border: 1px solid rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.375rem 0.75rem;
    color: rgb(167, 243, 208);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
}

.list2play-servers-mobile a[href*="list2play"]:hover {
    background: rgba(16, 185, 129, 0.2);
}

/* Desktop Table Styles - matching mobile card design */
.list2play-servers-desktop .overflow-x-auto {
    overflow-x: auto !important;
    border-radius: 0.75rem !important;
    border: 1px solid rgb(30, 41, 59) !important;
    background: rgba(2, 6, 23, 0.7) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.list2play-servers-desktop table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    background: transparent !important;
}

.list2play-servers-desktop thead tr {
    background: rgba(2, 6, 23, 0.9) !important;
    text-align: left !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: rgb(148, 163, 184) !important;
    border-bottom: 1px solid rgb(30, 41, 59) !important;
}

.list2play-servers-desktop thead th {
    padding: 1rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    color: rgb(148, 163, 184) !important;
    border: none !important;
}

.list2play-servers-desktop tbody {
    color: rgb(203, 213, 225) !important;
    background: transparent !important;
}

.list2play-servers-desktop tbody tr {
    transition: all 0.2s ease-in-out !important;
    border-top: 1px solid rgba(30, 41, 59, 0.5) !important;
    background: transparent !important;
}

.list2play-servers-desktop tbody tr:first-child {
    border-top: none !important;
}

.list2play-servers-desktop tbody tr:hover {
    background: rgba(30, 41, 59, 0.3) !important;
}

.list2play-servers-desktop tbody tr:last-child {
    border-bottom: none !important;
}

/* Server meta list */
.list2play-servers-desktop .server-meta {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list2play-servers-desktop .server-meta li {
    margin: 0;
    padding: 0;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.list2play-servers-desktop .server-meta li:first-child {
    margin-top: 0;
}

.list2play-servers-desktop .server-meta li:last-child {
    margin-bottom: 0;
}

/* Status dot */
.list2play-servers-desktop .h-2 {
    height: 0.5rem;
    width: 0.5rem;
}

.list2play-servers-desktop .w-2 {
    width: 0.5rem;
}

.list2play-servers-desktop .rounded-full {
    border-radius: 9999px;
}

.list2play-servers-desktop .bg-emerald-400 {
    background-color: rgb(52, 211, 153);
}

.list2play-servers-desktop .bg-rose-500 {
    background-color: rgb(244, 63, 94);
}

.list2play-servers-desktop .uppercase {
    text-transform: uppercase;
}

.list2play-servers-desktop .tracking-wide {
    letter-spacing: 0.025em;
}

/* Game type icon - fixed size */
.list2play-servers-desktop img[style*="height: 1rem"] {
    height: 1rem !important;
    width: 1rem !important;
    flex-shrink: 0;
    object-fit: contain;
}

.list2play-servers-mobile img[style*="height: 1rem"] {
    height: 1rem !important;
    width: 1rem !important;
    flex-shrink: 0;
    object-fit: contain;
}

/* Flag icons - fixed size */
.list2play-servers-container .fi {
    display: inline-block;
    width: 1.33333333em;
    height: 1em;
    line-height: 1em;
    flex-shrink: 0;
}

.list2play-servers-container .fio {
    background-size: contain;
    background-position: 50%;
    background-repeat: no-repeat;
}

.list2play-servers-desktop .fi.fio {
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.list2play-servers-desktop tbody td {
    padding: 1rem !important;
    vertical-align: top !important;
    border: none !important;
    background: transparent !important;
}

.list2play-servers-desktop .flex.flex-col {
    display: flex;
    flex-direction: column;
}

.list2play-servers-desktop .flex.items-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list2play-servers-desktop a.font-semibold {
    font-weight: 600 !important;
    color: #fff !important;
    text-decoration: none !important;
    transition: color 0.2s ease-in-out !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

.list2play-servers-desktop a.font-semibold:hover {
    color: rgb(52, 211, 153) !important;
}

.list2play-servers-desktop .mt-2 {
    margin-top: 0.5rem;
}

.list2play-servers-desktop .text-slate-500 {
    color: rgb(100, 116, 139);
}

/* Activity column - matching mobile badge style */
.list2play-servers-desktop tbody td > span.inline-flex,
.list2play-servers-desktop tbody td span.inline-flex.items-center.gap-2 {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    border-radius: 0.375rem !important;
    border: 1px solid rgba(51, 65, 85, 0.7) !important;
    background: rgba(15, 23, 42, 0.7) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    line-height: 1.5 !important;
    color: rgb(241, 245, 249) !important;
}

.list2play-servers-desktop tbody td .text-xs {
    font-size: 0.75rem !important;
    color: rgb(148, 163, 184) !important;
}

/* Status column - matching mobile badge style */
.list2play-servers-desktop tbody td > span.inline-flex.rounded-full,
.list2play-servers-desktop tbody td span.inline-flex.items-center.rounded-full {
    display: inline-flex !important;
    align-items: center !important;
    border-radius: 9999px !important;
    padding: 0.25rem 0.625rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
}

.list2play-servers-desktop tbody td .border-emerald-500\/30 {
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    background: rgba(16, 185, 129, 0.15) !important;
    color: rgb(110, 231, 183) !important;
}

.list2play-servers-desktop tbody td .border-rose-500\/30 {
    border: 1px solid rgba(244, 63, 94, 0.3) !important;
    background: rgba(244, 63, 94, 0.15) !important;
    color: rgb(251, 113, 133) !important;
}

/* Status dot */
.list2play-servers-desktop .h-2.w-2 {
    height: 0.5rem;
    width: 0.5rem;
    flex-shrink: 0;
}

/* Map column - matching mobile badge style */
.list2play-servers-desktop tbody td > span.inline-flex:has(svg),
.list2play-servers-desktop tbody td span.inline-flex.items-center.gap-2:has(svg),
.list2play-servers-desktop tbody td span.inline-flex.items-center.gap-2 svg {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    border-radius: 0.375rem !important;
    border: 1px solid rgba(51, 65, 85, 0.7) !important;
    background: rgba(15, 23, 42, 0.7) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    line-height: 1.5 !important;
    color: rgb(241, 245, 249) !important;
}

/* Force all badge styles in desktop table */
.list2play-servers-desktop tbody td span[class*="inline-flex"] {
    display: inline-flex !important;
    align-items: center !important;
    border-radius: 0.375rem !important;
    border: 1px solid rgba(51, 65, 85, 0.7) !important;
    background: rgba(15, 23, 42, 0.7) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    line-height: 1.5 !important;
    color: rgb(241, 245, 249) !important;
}

.list2play-servers-desktop tbody td span[class*="rounded-full"] {
    border-radius: 9999px !important;
    padding: 0.25rem 0.625rem !important;
    font-weight: 600 !important;
}

/* Votes column - matching mobile */
.list2play-servers-desktop tbody td .font-semibold.text-white {
    font-weight: 600 !important;
    color: rgb(226, 232, 240) !important;
    font-size: 0.75rem !important;
    line-height: 1.5 !important;
}

/* Server meta button styles - matching mobile exactly */
.list2play-servers-desktop .server-meta button,
.list2play-servers-desktop .server-meta button[data-copy] {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    border-radius: 0.375rem !important;
    border: 1px solid rgb(51, 65, 85) !important;
    background: rgb(2, 6, 23) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    color: rgb(226, 232, 240) !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    font-weight: 400 !important;
}

.list2play-servers-desktop .server-meta button:hover,
.list2play-servers-desktop .server-meta button[data-copy]:hover {
    border-color: rgb(16, 185, 129) !important;
    color: rgb(110, 231, 183) !important;
    background: rgb(2, 6, 23) !important;
}

.list2play-servers-desktop .server-meta button svg {
    height: 0.75rem;
    width: 0.75rem;
    flex-shrink: 0;
    stroke-width: 1.5;
}

/* Game type badge - as link - matching mobile exactly */
.list2play-servers-desktop .server-meta a.inline-flex.items-center.gap-1,
.list2play-servers-desktop .server-meta a[href*="game_type"] {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    border-radius: 0.375rem !important;
    border: 1px solid rgba(51, 65, 85, 0.7) !important;
    background: rgba(15, 23, 42, 0.7) !important;
    padding: 0.25rem 0.5rem !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
    font-size: 0.75rem !important;
}

.list2play-servers-desktop .server-meta a.inline-flex.items-center.gap-1:hover,
.list2play-servers-desktop .server-meta a[href*="game_type"]:hover {
    border-color: rgba(16, 185, 129, 0.6) !important;
    background: rgba(15, 23, 42, 0.7) !important;
}

.list2play-servers-desktop .server-meta a.inline-flex.items-center.gap-1 .text-emerald-300 {
    color: rgb(110, 231, 183);
    font-weight: 400;
}

.list2play-servers-desktop .server-meta a.inline-flex.items-center.gap-1:hover .text-emerald-300 {
    color: rgb(167, 243, 208);
}

/* Country flag in desktop - as link - matching mobile exactly */
.list2play-servers-desktop .server-meta a.inline-flex.items-center.gap-2,
.list2play-servers-desktop .server-meta a[href*="country"] {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 0.375rem !important;
    border: 1px solid rgba(51, 65, 85, 0.7) !important;
    background: rgba(15, 23, 42, 0.7) !important;
    background: rgba(15, 23, 42, 0.7);
    color: rgb(226, 232, 240);
}

.list2play-servers-desktop .server-meta a.inline-flex.items-center.gap-2:hover {
    color: #fff;
    border-color: rgba(16, 185, 129, 0.6);
    background: rgba(15, 23, 42, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.list2play-servers-desktop .server-meta a.inline-flex.items-center.gap-2 .fi.fio {
    display: inline-block;
    width: 1.33333333em;
    height: 1em;
    line-height: 1em;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

/* Activity column */
.list2play-servers-desktop tbody td .font-semibold {
    font-weight: 600;
    color: #fff;
}

.list2play-servers-desktop tbody td .text-xs {
    font-size: 0.75rem;
}

.list2play-servers-desktop tbody td .text-slate-400 {
    color: rgb(148, 163, 184);
}

/* Status column */
.list2play-servers-desktop tbody td .inline-flex.items-center.gap-2 {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.list2play-servers-desktop tbody td .text-sm {
    font-size: 0.875rem;
}

.list2play-servers-desktop tbody td .text-slate-300 {
    color: rgb(203, 213, 225);
}

/* Votes column */
.list2play-servers-desktop tbody td .font-semibold.text-white {
    font-weight: 600;
    color: #fff;
}

/* Map column */
.list2play-servers-desktop tbody td .map-name {
    color: rgb(203, 213, 225);
}

/* Pagination */
.list2play-pagination {
    margin-top: 1.5rem;
    text-align: center;
}

.list2play-pagination-info {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: rgb(148, 163, 184);
}

.list2play-pagination-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.list2play-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(203, 213, 225);
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgb(51, 65, 85);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
}

.list2play-pagination-btn:hover {
    background: rgb(51, 65, 85);
    color: rgb(255, 255, 255);
    border-color: rgb(71, 85, 105);
}

.list2play-pagination-btn:disabled,
.list2play-pagination-btn.cursor-not-allowed {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.list2play-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.list2play-pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(203, 213, 225);
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgb(51, 65, 85);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
}

.list2play-pagination-number:hover {
    background: rgb(51, 65, 85);
    color: rgb(255, 255, 255);
    border-color: rgb(71, 85, 105);
}

.list2play-pagination-number.list2play-pagination-current {
    color: rgb(255, 255, 255);
    background: rgb(5, 150, 105);
    border-color: rgb(16, 185, 129);
    cursor: default;
}

.list2play-pagination-number.list2play-pagination-current:hover {
    background: rgb(5, 150, 105);
    border-color: rgb(16, 185, 129);
}

/* Responsive pagination */
@media (max-width: 640px) {
    .list2play-pagination-buttons {
        gap: 0.25rem;
    }
    
    .list2play-pagination-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .list2play-pagination-number {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.8125rem;
    }
}

/* Copy to clipboard functionality */
.list2play-servers-container button[data-copy] {
    position: relative;
}

.list2play-servers-container button[data-copy]:active::after {
    content: "Copied!";
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(15, 23, 42);
    color: rgb(110, 231, 183);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .list2play-servers-mobile > div {
        padding: 0.75rem;
    }
    
    .list2play-servers-mobile .text-base {
        font-size: 0.875rem;
    }
}

/* Ensure dark theme compatibility */
.list2play-servers-container {
    color: rgb(226, 232, 240);
    background: transparent;
}

/* Players history chart styles */
.list2play-servers-mobile .list2play-chart {
    width: 100% !important;
    height: 100px !important;
    max-height: 100px !important;
    background: rgba(2, 6, 23, 0.5) !important;
    border-radius: 0.375rem !important;
    margin-top: 0.5rem !important;
}

/* Chart.js axis styling */
.list2play-servers-mobile .list2play-chart canvas {
    padding: 8px !important;
}
