/* Partner Arena Styles */
:root {
    --primary-color: #5ba4c2;
    --secondary-color: #4a90a4;
    --accent-color: #ff6b35;
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #ffffff;
    --text-muted: #b0b0b0;
    --border-color: #404040;
    --success-color: #00d084;
    --warning-color: #ffb800;
    --error-color: #ff4757;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, #2d3748 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.rules-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rules-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.collection-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.collection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.collection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(91, 164, 194, 0.2);
    border-color: var(--primary-color);
}

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.collection-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--text-color);
}

.collection-status {
    display: flex;
    gap: 8px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-active {
    background: rgba(0, 208, 132, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-inactive {
    background: rgba(255, 71, 87, 0.2);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.collection-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: rgba(91, 164, 194, 0.1);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.feature-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-list {
    background: rgba(0, 208, 132, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.badge-sale {
    background: rgba(255, 184, 0, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.badge-purchase {
    background: rgba(91, 164, 194, 0.2);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.badge-burn {
    background: rgba(255, 107, 53, 0.2);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.badge-mint {
    background: rgba(138, 43, 226, 0.2);
    color: #8a2be2;
    border: 1px solid #8a2be2;
}

.badge-registration {
    background: rgba(255, 20, 147, 0.2);
    color: #ff1493;
    border: 1px solid #ff1493;
}

.mint-badge {
    background: rgba(138, 43, 226, 0.2);
    color: #8a2be2;
    border: 1px solid #8a2be2;
}

.prize-info {
    background: linear-gradient(135deg, rgba(91, 164, 194, 0.1), rgba(255, 107, 53, 0.1));
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--primary-color);
}

.prize-amount {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.prize-currency {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.view-leaderboard {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.view-leaderboard:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.rules-section {
    margin-bottom: 30px;
}

.rules-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.scoring-rules {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(91, 164, 194, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.rule-item .badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.special-tokens {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.token-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(91, 164, 194, 0.05);
    border-radius: 8px;
}

.token-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.token-badge.frtn {
    background: rgba(255, 184, 0, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.token-badge.moon {
    background: rgba(138, 43, 226, 0.2);
    color: #8a2be2;
    border: 1px solid #8a2be2;
}

.token-badge.robin {
    background: rgba(255, 20, 147, 0.2);
    color: #ff1493;
    border: 1px solid #ff1493;
}

.penalties {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.penalty-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 71, 87, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--error-color);
}

.penalty-badge {
    background: rgba(255, 71, 87, 0.2);
    color: var(--error-color);
    border: 1px solid var(--error-color);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .collections-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .collection-stats {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .rule-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

/* Mobile Responsive Leaderboard - SOLO per Partner Arena */
@media (max-width: 768px) {
    /* Nascondi colonne NFTs e Rules su mobile SOLO quando body ha classe partner-mode */
    body.partner-mode .modern-leaderboard-table th:nth-child(4),
    body.partner-mode .modern-leaderboard-table td:nth-child(4),
    body.partner-mode .modern-leaderboard-table th:nth-child(5),
    body.partner-mode .modern-leaderboard-table td:nth-child(5),
    body.partner-mode .modern-leaderboard-table thead th:nth-child(4),
    body.partner-mode .modern-leaderboard-table tbody td:nth-child(4),
    body.partner-mode .modern-leaderboard-table thead th:nth-child(5),
    body.partner-mode .modern-leaderboard-table tbody td:nth-child(5) {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Forza la tabella a usare solo 3 colonne SOLO in partner mode */
    body.partner-mode .modern-leaderboard-table {
        table-layout: fixed !important;
    }
    
    body.partner-mode .modern-leaderboard-table th:nth-child(1),
    body.partner-mode .modern-leaderboard-table td:nth-child(1) {
        width: 15% !important; /* Rank */
    }
    
    body.partner-mode .modern-leaderboard-table th:nth-child(2),
    body.partner-mode .modern-leaderboard-table td:nth-child(2) {
        width: 60% !important; /* Wallet */
    }
    
    body.partner-mode .modern-leaderboard-table th:nth-child(3),
    body.partner-mode .modern-leaderboard-table td:nth-child(3) {
        width: 25% !important; /* Score */
    }
    
    /* Rendi il wallet column più compatto SOLO in partner mode */
    body.partner-mode .modern-leaderboard-table .wallet-column {
        width: 50% !important;
        max-width: 150px !important;
    }
    
    /* Rendi lo score cliccabile e più visibile SOLO in partner mode */
    body.partner-mode .modern-leaderboard-table .score-column strong {
        padding: 10px 12px !important;
        border-radius: 8px !important;
        background: rgba(91, 164, 194, 0.1) !important;
        border: 1px solid rgba(91, 164, 194, 0.3) !important;
        transition: all 0.3s ease !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 60px !important;
        text-align: center !important;
        cursor: default !important;
    }
    
    body.partner-mode .modern-leaderboard-table .score-column strong:hover {
        background: rgba(91, 164, 194, 0.2) !important;
        border-color: rgba(91, 164, 194, 0.5) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 12px rgba(91, 164, 194, 0.2) !important;
    }
    
    /* Assicurati che non ci sia cursor pointer per gli score clickabili SOLO in partner mode */
    body.partner-mode .mobile-score-clickable {
        cursor: default !important;
    }
    
    /* Ottimizza header table per mobile SOLO in partner mode */
    body.partner-mode .modern-leaderboard-table th {
        font-size: 0.9rem !important;
        padding: 8px 4px !important;
    }
    
    body.partner-mode .modern-leaderboard-table td {
        padding: 8px 4px !important;
    }
    
    /* Rendi i wallet più leggibili su mobile SOLO in partner mode */
    body.partner-mode .wallet-column div div {
        font-size: 0.85rem !important;
        word-break: break-all !important;
    }
}

/* Mode Toggle Buttons */
.mode-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    margin-left: 4px;
}

.mode-btn:first-child {
    margin-left: 0;
}

.mode-btn.active {
    background: rgba(91, 164, 194, 0.8);
    color: white;
}

.mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

#mode-war.active {
    background: rgba(41, 128, 185, 0.8);
    color: white;
}

/* Mode Toggle Buttons - Clean & Centered */
#partner-mode-toggle {
    display: flex;
    justify-content: center;
    background: none;
    border-radius: 4px;
    padding: 0;
    border: none;
    max-width: 140px;
    margin: 0;
}

.mode-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mode-btn:first-child {
    border-right: none;
    border-radius: 3px 0 0 3px;
}

.mode-btn:last-child {
    border-radius: 0 3px 3px 0;
}

.mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#mode-war.active {
    background: #2980b9;
    border-color: #2980b9;
    color: white;
}

/* Simplified disabled state */
#partner-collection-dropdown.war-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Simplified disabled state */
#partner-collection-dropdown.war-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ====== PARTNER POPUP UNIFICATI - Header e Content insieme ====== */

/* Base popup styling - FONDAMENTALE per funzionamento */
.modern-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Popup attivo - CRITICO */
.modern-popup.active {
    display: flex !important;
    opacity: 1 !important;
}

/* Struttura unificata */
.modern-popup-unified {
    background: #1a1a1a;
    border: 1px solid #5ba4c2;
    border-radius: 8px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

/* Animazione popup attivo */
.modern-popup.active .modern-popup-unified {
    transform: scale(1);
}

/* Close button - TOUCH FRIENDLY */
.modern-popup-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.modern-popup-close:hover,
.modern-popup-close:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile-specific optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Dispositivi touch puri */
    .modern-popup-close {
        min-width: 48px;
        min-height: 48px;
        font-size: 28px;
    }
    
    .rules-icon,
    .mobile-score-clickable {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }
}
.modern-popup-unified {
    background: #1a1a1a;
    border: 1px solid #5ba4c2;
    border-radius: 8px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modern-popup-unified .popup-header-section {
    background: linear-gradient(135deg, #2a2a2a, #1f1f1f);
    border-bottom: 1px solid #5ba4c2;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.modern-popup-unified .popup-header-section h3 {
    margin: 0;
    color: #fff;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.modern-popup-unified .popup-content-section {
    padding: 20px;
    color: #fff;
    line-height: 1.6;
}

/* Mobile responsiveness per popup unificati partner */
@media (max-width: 768px) {
  .modern-popup-unified {
    width: 95%;
    max-height: 85vh;
    margin: 10px;
  }
  
  .modern-popup-unified .popup-header-section {
    padding: 12px 15px;
  }
  
  .modern-popup-unified .popup-header-section h3 {
    font-size: 1em;
  }
  
  .modern-popup-unified .popup-content-section {
    padding: 15px;
  }
  
  /* Miglior targeting touch su mobile */
  .mobile-score-clickable {
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
  }
  
  .mobile-score-clickable:active {
    background-color: rgba(91, 164, 194, 0.2);
  }
}

@media (max-width: 480px) {
  .modern-popup-unified {
    width: 98%;
    max-height: 90vh;
    margin: 5px;
  }
  
  .modern-popup-unified .popup-header-section {
    padding: 10px 12px;
  }
  
  .modern-popup-unified .popup-content-section {
    padding: 12px;
    font-size: 0.9em;
  }
  
  /* Elementi ancora più touch-friendly su schermi piccoli */
  .modern-popup-close {
    min-width: 50px;
    min-height: 50px;
    font-size: 30px;
  }
}

/* Supporto per dispositivi con hover limitato */
@media (hover: none) {
  .rules-icon:hover,
  .mobile-score-clickable:hover {
    background-color: rgba(91, 164, 194, 0.2);
  }
}

/* ==== PARTNER DISTRIBUTION MODAL Z-INDEX FIX ==== */
#partner-distribution-modal {
  z-index: 10010 !important;
}

.modern-popup {
  z-index: 10010 !important;
}
