/**
 * Level Selector UI - Design cohérent avec Settings
 */

/* ============================================
   OVERLAY
   ============================================ */

.level-selector-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.level-selector-overlay.visible {
    display: flex;
}

/* ============================================
   MODAL
   ============================================ */

.level-selector-modal {
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: 90%;
    max-width: 1100px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    animation: lsSlideIn 0.3s ease-out;
}

@keyframes lsSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   HEADER
   ============================================ */

.level-selector-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.level-selector-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #f0f6fc;
}

.level-selector-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: #8b949e;
}

.level-selector-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #8b949e;
    cursor: pointer;
    transition: all 0.15s ease;
}

.level-selector-close:hover {
    background: rgba(248, 81, 73, 0.15);
    border-color: rgba(248, 81, 73, 0.3);
    color: #f85149;
}

/* ============================================
   TABS
   ============================================ */

.level-selector-tabs {
    display: flex;
    gap: 4px;
    padding: 16px 28px 0;
    background: #161b22;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.level-selector-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #8b949e;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: -1px;
}

.level-selector-tab:hover {
    color: #c9d1d9;
}

.level-selector-tab.active {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
}

/* ============================================
   BODY
   ============================================ */

.level-selector-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================
   LEVEL LIST
   ============================================ */

.level-list-container {
    width: 340px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    background: #161b22;
}

.level-list-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.level-search {
    width: 100%;
    padding: 10px 14px;
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #c9d1d9;
    font-size: 13px;
}

.level-search::placeholder {
    color: #6e7681;
}

.level-search:focus {
    outline: none;
    border-color: #58a6ff;
}

.level-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.level-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
}

.level-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.level-item.selected {
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.3);
}

.level-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #21262d;
    border-radius: 8px;
    font-size: 18px;
    flex-shrink: 0;
}

.level-item-info {
    flex: 1;
    min-width: 0;
}

.level-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #c9d1d9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.level-item-meta {
    font-size: 12px;
    color: #6e7681;
    margin-top: 2px;
}

/* ============================================
   LEVEL PREVIEW
   ============================================ */

.level-preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
}

.level-preview-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e7681;
    font-size: 14px;
}

.level-preview-canvas {
    width: 200px;
    height: 200px;
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 20px;
}

.level-preview-title {
    font-size: 20px;
    font-weight: 600;
    color: #f0f6fc;
    margin: 0 0 8px 0;
}

.level-preview-desc {
    font-size: 14px;
    color: #8b949e;
    margin: 0 0 20px 0;
}

.level-preview-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.level-preview-stat {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
}

.level-preview-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #58a6ff;
}

.level-preview-stat-label {
    font-size: 11px;
    color: #6e7681;
    text-transform: uppercase;
    margin-top: 4px;
}

/* ============================================
   ACTIONS
   ============================================ */

.level-preview-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.level-action-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.level-action-btn.primary {
    background: #238636;
    border: 1px solid #238636;
    color: #fff;
}

.level-action-btn.primary:hover {
    background: #2ea043;
}

.level-action-btn.secondary {
    background: #21262d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #c9d1d9;
}

.level-action-btn.secondary:hover {
    background: #30363d;
    border-color: rgba(255, 255, 255, 0.15);
}

.level-action-btn.danger {
    background: rgba(248, 81, 73, 0.15);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: #f85149;
}

.level-action-btn.danger:hover {
    background: rgba(248, 81, 73, 0.25);
}

/* ============================================
   IMPORT SECTION
   ============================================ */

.level-import-section {
    padding: 16px;
    background: #0d1117;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.level-import-btn {
    width: 100%;
    padding: 12px;
    background: #21262d;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #8b949e;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.level-import-btn:hover {
    background: #30363d;
    border-color: #58a6ff;
    color: #58a6ff;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .level-selector-modal {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .level-selector-body {
        flex-direction: column;
    }
    
    .level-list-container {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
}
