/* ============================================================
   MC STATUS – ESTILO PRINCIPAL
   ============================================================ */

/* CARD BASE */

.mcsmd-card {
    width: 100%;
    max-width: 760px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 18px;
    padding: 18px 20px 16px;
    border: 2px solid #d1d5db;
    box-shadow: 0px 6px 18px rgba(0,0,0,0.10);
    font-family: "Inter", system-ui, sans-serif;
    color: #1f2937;
    transition: all .20s ease-out;
    box-sizing: border-box;
}

/* ONLINE */

.mcsmd-card.online {
    border-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4, #ffffff);
    box-shadow:
        0 0 0 1px rgba(34,197,94,0.25),
        0 14px 32px rgba(34,197,94,0.28);
}

/* OFFLINE */

.mcsmd-card.offline {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #ffffff);
    box-shadow:
        0 0 0 1px rgba(248,113,113,0.28),
        0 14px 32px rgba(239,68,68,0.25);
}

/* DARK MODE GLOBAL */

.mcsmd-card.dark {
    background: #111827;
    border-color: #374151;
    color: #e5e7eb;
    box-shadow:
        0 0 0 1px #1f2937 inset,
        0 18px 32px rgba(0,0,0,0.65);
}

/* HEADER */

.mcsmd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mcsmd-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ICONO */

.mcsmd-icon {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.mcsmd-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mcsmd-icon span {
    font-size: 40px;
    font-weight: 700;
    color: #4b5563;
}

.mcsmd-card.dark .mcsmd-icon {
    background: #1f2937;
}

.mcsmd-card.dark .mcsmd-icon span {
    color: #9ca3af;
}

/* TEXTO IZQUIERDA */

.mcsmd-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mcsmd-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.mcsmd-card.dark .mcsmd-title {
    color: #f3f4f6;
}

.mcsmd-ip {
    font-size: 13px;
    font-style: italic;
    color: #6b7280;
}

.mcsmd-card.dark .mcsmd-ip {
    color: #9ca3af;
}

.mcsmd-version {
    font-size: 13px;
    color: #4b5563;
}

.mcsmd-card.dark .mcsmd-version {
    color: #d1d5db;
}

.mcsmd-players {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.mcsmd-card.dark .mcsmd-players {
    color: #f3f4f6;
}

.offline-text {
    color: #b91c1c;
    font-weight: 600;
}

/* DERECHA */

.mcsmd-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* BOTÓN REFRESH */

.mcsmd-refresh {
    width: 30px;
    height: 30px;
    background: #f3f4f6;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    position: relative;
    transition: background .2s ease;
}

.mcsmd-card.dark .mcsmd-refresh {
    background: #1f2937;
}

.mcsmd-refresh:hover {
    background: #e5e7eb;
}

.mcsmd-card.dark .mcsmd-refresh:hover {
    background: #374151;
}

.mcsmd-refresh::before {
    content: "⟳";
    font-size: 16px;
    color: #374151;
    position: absolute;
    top: 6px;
    left: 8px;
}

.mcsmd-card.dark .mcsmd-refresh::before {
    color: #e5e7eb;
}

/* ESTADO ONLINE/OFFLINE */

.mcsmd-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.mcsmd-status.on {
    background: #22c55e;
    border-color: #16a34a;
    color: #ecfdf5;
}

.mcsmd-status.off {
    background: #ef4444;
    border-color: #b91c1c;
    color: #fef2f2;
}

.mcsmd-status .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ecfdf5;
    display: inline-block;  /* <- importante para la animación */
}


/* BANNER */

.mcsmd-banner {
    margin-top: 14px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #d1d5db;
}

.mcsmd-banner img {
    width: 100%;
    display: block;
}

.mcsmd-card.dark .mcsmd-banner {
    border-color: #374151;
}

/* BODY */

.mcsmd-body {
    margin-top: 14px;
}

.mcsmd-motd {
    font-size: 14px;
    color: #374151;
    margin-bottom: 10px;
}

.mcsmd-card.dark .mcsmd-motd {
    color: #d1d5db;
}

/* PLAYERS */

.mcsmd-players-box {
    display: grid;
    gap: 8px;
    margin-top: 6px;
}

.mcsmd-players-box.cols-1 { grid-template-columns: repeat(1, 1fr); }
.mcsmd-players-box.cols-2 { grid-template-columns: repeat(2, 1fr); }
.mcsmd-players-box.cols-3 { grid-template-columns: repeat(3, 1fr); }
.mcsmd-players-box.cols-4 { grid-template-columns: repeat(4, 1fr); }

.mcsmd-players-box .player {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    transition: all .15s ease-out;
}

.mcsmd-card.dark .player {
    background: #1f2937;
    border-color: #374151;
}

.mcsmd-players-box .player:hover {
    transform: translateY(-1px);
    background: #f3f4f6;
}

.mcsmd-card.dark .player:hover {
    background: #374151;
}

.player img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    image-rendering: pixelated;
}

.player .name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.mcsmd-card.dark .player .name {
    color: #e5e7eb;
}

/* Punto verde de jugador (tooltip de ping) */

.player-status-dot {
    display: inline-block;
    margin-left: 8px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.25);
}

/* +X more */

.extra {
    font-size: 13px;
    text-align: center;
    color: #6b7280;
    padding: 4px 0;
}

.mcsmd-card.dark .extra {
    color: #9ca3af;
}

/* FOOTER */

.mcsmd-footer {
    font-size: 12px;
    margin-top: 12px;
    text-align: right;
    color: #6b7280;
}

.mcsmd-footer a {
    color: #3b82f6;
    text-decoration: none;
}

.mcsmd-card.dark .mcsmd-footer {
    color: #9ca3af;
}

.mcsmd-card.dark .mcsmd-footer a {
    color: #60a5fa;
}

/* RESPONSIVE – IMPORTANTE: icono + texto SIGUEN EN FILA */

@media (max-width: 600px) {

    .mcsmd-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .mcsmd-header-left {
        flex-direction: row;   /* siempre icono + texto al lado */
        align-items: center;
    }

    .mcsmd-right {
        align-self: flex-end;
    }

    .mcsmd-players-box.cols-3,
    .mcsmd-players-box.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* solo cuando la tarjeta está online → animación sutil */
.mcsmd-card.online .mcsmd-status .dot {
    background: #bbf7d0;
    box-shadow: 0 0 0 0 rgba(34,197,94,0.7);  /* subido de 0.5 a 0.7 */
    animation: mcsmd-status-dot-pulse 1.4s infinite ease-out; /* un pelín más rápido */
}

/* animación: pequeño pulso, muy suave */
@keyframes mcsmd-status-dot-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34,197,94,0.45);
    }
    60% {
        transform: scale(1.15);
        box-shadow: 0 0 0 8px rgba(34,197,94,0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34,197,94,0);
    }
}

/* ============================================================
   GLOW ONLINE / OFFLINE EN MODO OSCURO (DARK MODE)
   ============================================================ */

/* ONLINE GLOW en modo oscuro */
.mcsmd-card.dark.online {
    border-color: #22c55e !important;
    box-shadow:
        0 0 0 1px rgba(34,197,94,0.35),
        0 14px 32px rgba(34,197,94,0.35);
}

/* OFFLINE GLOW en modo oscuro */
.mcsmd-card.dark.offline {
    border-color: #ef4444 !important;
    box-shadow:
        0 0 0 1px rgba(239,68,68,0.35),
        0 14px 32px rgba(239,68,68,0.30);
}

/* ============================================================
   SERVER ICON & BANNER & MOTD
   ============================================================ */
.mcsmd-server-icon {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.mcsmd-server-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mcsmd-server-banner {
    margin-top: 8px;
    border-radius: 12px;
    overflow: hidden;
}

.mcsmd-server-banner img {
    width: 100%;
    display: block;
}

.mcsmd-motd {
    margin-top: 10px;
    font-size: 18px;
    line-height: 1.5;
}


/* ============================================================
   ONLINE PLAYERS % COLOR
   ============================================================ */
/* Texto del porcentaje dentro de la línea de jugadores */
.mcsmd-players .mcsmd-players-percent {
    font-weight: 600;
    margin-left: 4px;
}

/* 0–50% lleno: verde */
.mcsmd-players .mcsmd-players-percent.mcsmd-percent-low {
    color: #4caf50 !important;
}

/* 51–85% lleno: amarillo/naranja */
.mcsmd-players .mcsmd-players-percent.mcsmd-percent-medium {
    color: #ffc107 !important;
}

/* >85% lleno: rojo */
.mcsmd-players .mcsmd-players-percent.mcsmd-percent-high {
    color: #f44336 !important;
}

/* ============================================================
   PLAYERS LIST SHORTCODE (mcsmd_players)
   ============================================================ */

.mcsmd-players-title {
    margin-bottom: 10px;
}

/* Barra con buscador + orden */
.mcsmd-player-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px; /* más espacio con los jugadores */
}

/* Input de búsqueda */
.mcsmd-card .mcsmd-player-search-input {
    flex: 1 1 230px;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    background: #f9fafb;
    color: #111827;
    outline: none;
    box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}

/* Selector de orden */
.mcsmd-card .mcsmd-player-sort {
    flex: 0 0 170px;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    background: #f9fafb;
    color: #111827;
    outline: none;
    cursor: pointer;
}

/* Hover / focus suaves */
.mcsmd-player-search-input:focus,
.mcsmd-player-sort:focus {
    border-color: #22c55e;
    box-shadow:
        0 0 0 1px rgba(34,197,94,0.25),
        0 4px 10px rgba(15,23,42,0.15);
}

/* Dark mode para el buscador y el selector */
.mcsmd-card.dark .mcsmd-player-search-input,
.mcsmd-card.dark .mcsmd-player-sort {
    background: #020617;
    border-color: #1f2937;
    color: #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.55);
}

.mcsmd-card.dark .mcsmd-player-search-input::placeholder {
    color: #6b7280;
}

/* Responsive: que la barra se adapte bien en móvil */
@media (max-width: 600px) {
    .mcsmd-player-toolbar {
        flex-direction: column;
    }

    .mcsmd-player-sort {
        flex: 1 1 auto;
        max-width: 100%;
    }
}

/* Botón refresh pequeño para mcsmd_players */
.mcsmd-refresh-small {
    width: 30px;
        height: 30px;
        background: #1f2937;
        border-radius: 50%;
        border: none;
        cursor: pointer;
        position: relative;
        transition: background .2s ease;
}

.mcsmd-refresh-small:hover {
    background: #374151;
}

.mcsmd-refresh-small::before {
    content: "⟳";
    font-size: 16px;
    color: #e5e7eb;
    position: absolute;
    top: 6px;
    left: 8px;
}

/* Dark mode */
.mcsmd-card.dark .mcsmd-refresh-small {
    background: #1f2937;
}

.mcsmd-card.dark .mcsmd-refresh-small:hover {
    background: #374151;
}

.mcsmd-card.dark .mcsmd-refresh-small::before {
    color: #e5e7eb;
}

/* ============================================================
   REFRESH JUNTO AL TÍTULO (players shortcode)
   ============================================================ */

.mcsmd-players-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.mcsmd-players-header .mcsmd-players-title {
    font-size: 20px;
    font-weight: 700;
}

/* Botón refresh del título */
.mcsmd-refresh-title {
    min-width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 999px;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    transition: background .2s ease, transform .15s ease, box-shadow .15s ease;
}

.mcsmd-refresh-title:hover {
    background: #e5e7eb;
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}

/* DARK MODE */
.mcsmd-card.dark .mcsmd-refresh-title {
    background: #1f2937;
    color: #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.mcsmd-card.dark .mcsmd-refresh-title:hover {
    background: #374151;
}


/* Mensaje de servidor offline (players shortcode) */
.mcsmd-offline-msg {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 16px;
    font-weight: 500;
    padding: 18px 24px;
    border-radius: 16px;
    border: 2px solid #ef4444;
    background: linear-gradient(135deg, #fff1f1, #ffffff);
    color: #7f1d1d;
    box-shadow:
        0 0 0 1px rgba(239,68,68,0.25),
        0 12px 28px rgba(239,68,68,0.20);
}

.mcsmd-card.dark .mcsmd-offline-msg {
    background: #190f0f;
    border-color: #b91c1c;
    color: #fca5a5;
    box-shadow:
        0 0 0 1px rgba(185,28,28,0.35),
        0 12px 28px rgba(185,28,28,0.25);
}

/* ============================================================
   MENSAJE SIN JUGADORES ONLINE
   ============================================================ */

.mcsmd-empty-msg {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 18px 24px;          /* sin padding extra a la izquierda */
    border-radius: 16px;
    border: 1px dashed #22c55e;
    background: linear-gradient(135deg, #f0fdf4, #ffffff);
    color: #14532d;
    font-size: 15px;
    font-weight: 500;
    box-shadow:
        0 0 0 1px rgba(34,197,94,0.15),
        0 10px 24px rgba(34,197,94,0.20);
}

/* dark mode */
.mcsmd-card.dark .mcsmd-empty-msg {
    background: #020617;
    border-color: #15803d;
    color: #bbf7d0;
    box-shadow:
        0 0 0 1px rgba(21,128,61,0.35),
        0 10px 24px rgba(0,0,0,0.65);
}

.mcsmd-card.dark .mcsmd-empty-msg::before {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.45);
}

/* Punto verde para "No players online" */
.mcsmd-empty-msg .status-dot-green {
    width: 14px;
    height: 14px;
    background: #22c55e;
    border-radius: 999px;
    margin-right: 10px;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.25);
    animation: mcsmd-status-dot-pulse 3.2s infinite ease-out;
}

/* Punto rojo para "Server is offline" */
.mcsmd-offline-msg .status-dot-red {
    width: 14px;
    height: 14px;
    background: #ef4444;
    border-radius: 999px;
    margin-right: 10px;
    box-shadow: 0 0 0 4px rgba(239,68,68,0.35);
    animation: mcsmd-status-dot-pulse-red 3.5s infinite ease-out;
}

@keyframes mcsmd-status-dot-pulse-red {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239,68,68,0.45);
    }
    60% {
        transform: scale(1.15);
        box-shadow: 0 0 0 8px rgba(239,68,68,0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239,68,68,0);
    }
}

