/* style/mobile.css - Mobile Specific Styles (< 768px) */

@media (max-width: 768px) {
    /* 1. Layout Generale & Fix Overflow */
    .main-layout {
        display: flex;
        flex-direction: column;
        padding: 0 15px;
        gap: 20px;
        width: 100%;
        overflow-x: hidden;
    }

    /* 2. Filtri Verticali */
    .mobile-controls {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .mobile-btn {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
        justify-content: center;
        box-sizing: border-box;
    }

    .mobile-dropdown {
        width: 100%;
        box-sizing: border-box;
    }

    /* 3. Lista Server */
    .server-list {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }

    .list-header { display: none; }

    /* =========================================
       4. CARD MOBILE - BANNER STYLE
       ========================================= */
    .server-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 0;
        border-radius: 12px;
        position: relative;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        height: auto; 
        min-height: auto;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }

    /* --- RANK --- */
    .rank-box {
        position: absolute;
        top: 175px; 
        left: 15px;
        background: transparent; 
        color: var(--primary); 
        font-weight: 800;
        font-size: 1.5rem; 
        line-height: 1;
        padding: 0;
        border: none;
        z-index: 20;
        box-shadow: none;
        backdrop-filter: none;
        display: flex;
        align-items: center;
        height: 28px; 
    }
    .rank-box i.trophy-1 { color: #FFD700; font-size: 1.4rem; }
    .rank-box i.trophy-2 { color: #C0C0C0; font-size: 1.4rem; }
    .rank-box i.trophy-3 { color: #CD7F32; font-size: 1.4rem; }

    /* --- SPONSOR BADGE --- */
    .badge-sponsor {
        position: absolute;
        top: 10px;
        right: 10px;
        font-size: 0.7rem;
        padding: 4px 8px;
        z-index: 10;
    }

    /* --- IMMAGINE / BANNER --- */
    .server-icon { 
        width: 100%;
        height: 160px; 
        margin: 0;
        padding: 0;
        background: #111;
        position: relative;
    }
    .server-icon::after { display: none; }
    .server-icon a { display: block; width: 100%; height: 100%; }
    .server-icon img {
        width: 100%;
        height: 100%;
        border-radius: 0;
        object-fit: cover;
        display: block;
    }

    /* --- CONTENUTO --- */
    .server-details {
        width: 100%;
        padding: 15px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        box-sizing: border-box;
    }

    /* HEADER ROW AGGIORNATA */
    .server-header-row {
        flex-direction: row; 
        width: 100%;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 5px;
    }

    /* Titolo */
    .server-name-wrap { 
        width: auto;
        flex: 1; 
        justify-content: flex-start;
        padding-left: 45px; /* Spazio per Rank */
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }
    .server-name-wrap h3 {
        font-size: 1.5rem;
        font-weight: 700;
        white-space: normal;
        overflow: hidden;
        margin: 0;
        line-height: 1.1;
    }

    /* Status Box Mobile */
    .server-status-box {
        align-items: flex-end;
        text-align: right;
        min-width: 75px; 
    }

    /* Applica animazione anche su mobile */
    .status-online {
        font-size: 0.7rem;
        padding: 2px 5px;
        animation: online-pulse 2s infinite; 
    }
    
    .status-offline {
        font-size: 0.7rem;
        padding: 2px 5px;
    }

    .player-count-header {
        font-size: 0.85rem;
    }

    /* Descrizione */
    .server-desc-row { 
        display: block; 
        width: 100%;
    }
    .server-desc {
        font-size: 0.9rem;
        color: #aaa;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 0;
    }

    /* =========================================
       FOOTER CARD MOBILE (Tags + IP)
       ========================================= */
    .server-footer-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        width: 100%;
        margin-top: 5px;
    }

    .server-tags { 
        justify-content: flex-start;
        flex-wrap: wrap;
        width: 100%;
    }
    .tag { font-size: 0.75rem; padding: 4px 8px; margin-bottom: 5px; }

    /* Barra IP Mobile */
    .server-ip-wrap-modern {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
        background: #151515;
        height: 42px;
        box-sizing: border-box;
        border: 1px solid #333;
    }
    .ip-text-modern { font-size: 0.95rem; flex: 1; }
    .btn-copy-modern { width: 32px; height: 32px; }

    /* =========================================
       PULSANTE "MORE DETAILS" MOBILE
       ========================================= */
    .server-stats {
        width: 100%;
        height: 48px; 
        flex-direction: row;
        justify-content: center;
        align-items: center;
        border-top: none;
        border-left: none;
        background: #2563eb; 
        padding: 0;
        margin-top: 15px;
        box-sizing: border-box;
        border-radius: 0 0 12px 12px;
        text-decoration: none;
        gap: 10px;
    }
    
    .server-stats:active { background: #1d4ed8; }

    /* Su mobile testo e icona fissi */
    .action-text {
        color: white;
        font-weight: 700;
        font-size: 0.95rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        opacity: 1;
        position: static;
        transform: none;
    }

    .action-icon {
        color: white;
        font-size: 1.2rem; /* Icona leggermente più piccola che desktop ma visibile */
        transform: none;
        opacity: 1;
    }
    
    .vote-box { display: none; }


    /* 5. Footer & Modali */
    .seo-footer { padding: 30px 15px; text-align: center; }
    .footer-grid { display: flex; flex-direction: column; gap: 30px; }
    .copyright-row { margin-top: 30px; padding-top: 15px; font-size: 0.8rem; }

    .modal-content, .modal-large {
        width: 90% !important;
        padding: 20px !important;
        margin: 20px auto;
        box-sizing: border-box;
    }
    .modal-close { top: 10px; right: 10px; }
}