/* Import base styles if possible, or replicate. Replicating for standalone safety. */
:root {
    --primary-color: #C41E3A;
    --primary-glow: rgba(196, 30, 58, 0.4);
    --bg-dark: #07080a;
    --card-bg: rgba(20, 20, 25, 0.85);
    --card-width: 90vw;
    --card-max-width: 500px;
    --card-height: 550px;
    --success-color: #28a745;
    --danger-color: #dc3545;
}

@media (min-width: 768px) {
    :root {
        --card-max-width: 1200px;
        /* Wider for admin manager to see more columns/actions */
        --card-height: 700px;
    }
}

/* Base same as visualizador.css */
.visualizer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, var(--primary-glow) 0%, transparent 70%), linear-gradient(180deg, #0a0b10 0%, #000 100%);
    z-index: 0;
    pointer-events: none;
}

#f7-gestor-root {
    position: relative;
    font-family: 'Inter', sans-serif;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 800px;
    padding: 20px;
    z-index: 1;
}

.visualizer-main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: var(--card-max-width);
    position: relative;
    z-index: 10;
    perspective: 1000px;
}

.visualizer-logo-container {
    margin-bottom: 1.5rem;
}

.visualizer-logo-container img {
    height: 60px;
    filter: drop-shadow(0 0 15px var(--primary-color));
}

.visualizer-card {
    width: var(--card-width);
    max-width: var(--card-max-width);
    height: var(--card-height);
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 3px solid var(--primary-color);
    border-radius: 24px;
    backdrop-filter: blur(25px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    padding: 25px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.content-area {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px;
}

.content-area::-webkit-scrollbar {
    width: 4px;
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.list-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding-right: 15px;
    /* Default */
    justify-content: center;
    /* Center Navigation Items */
}

/* Player Items (No data-view) - Keep Left aligned with space for actions */
.list-item:not([data-view]) {
    padding-right: 140px;
    justify-content: flex-start;
}

.list-item:hover {
    background: rgba(196, 30, 58, 0.1);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.item-icon {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
}

.item-name {
    font-weight: 600;
    font-size: 1rem;
}

.btn-container {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 14px;
    background: rgba(196, 30, 58, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.action-btn:hover {
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

.action-btn.back {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.action-btn.back:hover {
    background: rgba(255, 255, 255, 0.1);
}

.action-btn svg {
    width: 16px;
    fill: white;
}

/* --- ADMIN SPECIFIC --- */

/* --- ADMIN SPECIFIC --- */

/* Hover Menu - Always Visible */
.list-item .admin-actions {
    opacity: 1;
    pointer-events: auto;
}

/* Admin Actions - Copying f7_jugadores styles */
.admin-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    /* Increased gap */
}

/* Matching .f7l-btn-icon from frontend.css */
.icon-btn {
    padding: 6px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: #ff8c1a !important;
    /* Force Yellow */
    color: #0b1d33 !important;
    /* Force Dark Blue */
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.icon-btn:hover {
    transform: translateY(-1px);
    background: #ff7a00 !important;
    box-shadow: 0 6px 16px rgba(255, 140, 26, .3);
}

.icon-btn.delete {
    background: #ff3b30 !important;
    /* Force Red */
    color: #fff !important;
    /* Force White */
}

.icon-btn.delete:hover {
    background: #c02b22 !important;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor !important;
    /* Force inheritance */
}

/* Add Player Button (Floating in list) */
.add-player-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s;
}

.add-player-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(196, 30, 58, 0.05);
}

/* Modal */
.f7-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    animation: fadeIn 0.3s;
}

.f7-modal {
    background: #1a1b20;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideUp 0.3s;
}

.f7-modal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.f7-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.f7-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.f7-modal-body {
    padding: 20px;
}

.f7-form-group {
    margin-bottom: 15px;
    text-align: left;
}

.f7-form-group label {
    display: block;
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 5px;
}

.f7-form-group input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
}

.f7-form-group input[type="text"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

.f7-form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.f7-form-group.checkbox input {
    margin: 0;
}

.f7-form-group.checkbox label {
    margin: 0;
    cursor: pointer;
}

.f7-form-actions {
    margin-top: 20px;
    text-align: right;
}

/* Toast */
.f7-toast {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 200;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.f7-toast.show {
    opacity: 1;
}

.f7-toast.success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.f7-toast.error {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Mobile Tweaks --- */
@media (max-width: 480px) {
    .list-item {
        padding-right: 15px !important;
        min-height: auto;
        align-items: center;
        /* Center stack */
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Keep Players Left Aligned on Mobile? Or center them too? 
       If we center players, the actions need to flow below or be positioned.
       User only asked for Clubs/Tournaments/Divisions centering. 
       But let's center all for visual consistency if possible, 
       BUT players have actions. 
       Let's stick to centering Navigation Items mainly. 
    */
    .list-item[data-view] {
        align-items: center;
        text-align: center;
    }

    /* Players on mobile: Left align to keep actions accessible? 
       The previous code had 'align-items: flex-start'. 
       Let's keep players capable. 
    */
    .list-item:not([data-view]) {
        align-items: flex-start;
        text-align: left;
        /* Mobile Action Styling handles position */
    }

    .list-item>div {
        width: 100%;
    }

    .admin-actions {
        position: relative;
        top: auto;
        right: auto;
        transform: none;

        flex-direction: column;
        gap: 4px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .icon-btn {
        width: 30px;
        height: 30px;
        padding: 6px;
        border-radius: 6px;
    }

    .icon-btn svg {
        width: 16px;
        height: 16px;
    }

    .item-icon {
        width: 40px;
        height: 40px;
    }

    /* --- Inline Editing / Bulk Add --- */
    /* --- Inline Editing / Bulk Add --- */
    .new-player-card {
        background: rgba(255, 140, 26, 0.15) !important;
        /* Yellow Tint */
        border: 1px dashed var(--primary-color) !important;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
    }

    .new-player-card .f7-input {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #ffffff !important;
        /* Force White Text */
        padding: 10px;
        border-radius: 6px;
        font-size: 1rem;
        width: 100%;
        box-sizing: border-box;
        font-weight: 500;
    }

    .new-player-card .f7-input::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }

    .new-player-card .f7-input:focus {
        background: rgba(0, 0, 0, 0.5);
        border-color: #ff8c1a;
        /* Yellow */
        outline: none;
        box-shadow: 0 0 0 2px rgba(255, 140, 26, 0.2);
    }

    .new-player-card .input-group {
        flex: none;
        width: 100%;
        margin-bottom: 5px;
    }

    .new-player-card .remove-new-btn {
        background: transparent;
        border: none;
        color: #ff3b30;
        cursor: pointer;
        font-size: 1.5rem;
        padding: 0 10px;
        line-height: 1;
    }

    /* Global Save Button */
    .global-save-container {
        position: fixed;
        top: 20px;
        /* Moved to top */
        right: 20px;
        z-index: 1000;
        pointer-events: none;
        /* Let clicks pass through if button hidden */
        display: flex;
        justify-content: flex-end;
        background: none;
        padding: 0;
    }

    .global-save-btn {
        pointer-events: auto;
        /* Re-enable clicks on button */
        background: #ff8c1a;
        color: #0b1d33;
        border: none;
        padding: 12px 24px;
        border-radius: 50px;
        font-weight: 800;
        font-size: 0.9rem;
        cursor: pointer;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        /* Stronger shadow for floating on top */
        transition: all 0.2s;
        display: none;
        /* Hidden by default until needed */
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .global-save-btn:hover {
        transform: scale(1.05);
        background: #ff7a00;
    }

    /* Ensure list content has padding for sticky button */
    #listContent {
        padding-bottom: 20px;
    }
}

/* Breadcrumbs Header */
.visualizer-header {
    width: var(--card-width);
    max-width: var(--card-max-width);
    margin-bottom: 0;
    background: rgba(20, 20, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 15px 25px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
    z-index: 15;
}

.f7-breadcrumbs {
    font-size: 0.9rem;
    color: #aaa;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.f7-crumb-item { color: #fff; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.f7-crumb-separator { color: #666; font-size: 0.8rem; }
.f7-crumb-current { color: var(--primary-color); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* Ajuste para unir con la tarjeta */
.visualizer-header + .visualizer-card {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}