.combat-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.combat-popup {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #4fc3f7;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    padding: 24px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(79, 195, 247, 0.2);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}

.popup-unit-card {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
}

.popup-unit-card h3 {
    color: #ffa500;
    margin-bottom: 8px;
    font-size: 1.1em;
    border-bottom: 1px solid #444;
    padding-bottom: 4px;
}

.popup-unit-info {
    font-size: 0.9em;
    color: #ccc;
}

.popup-unit-info .toggle-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4fc3f7;
    font-size: 1em;
    margin-left: 8px;
    user-select: none;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(79, 195, 247, 0.6);
    border-radius: 4px;
}

.popup-unit-info .toggle-details:hover {
    color: #ffa500;
    text-decoration: underline;
}

.model-list-container {
    display: none;
    margin-top: 12px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    max-height: 150px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4fc3f7 rgba(0, 0, 0, 0.2);
}

.model-list-container::-webkit-scrollbar {
    width: 4px;
}

.model-list-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.model-list-container::-webkit-scrollbar-thumb {
    background: #4fc3f7;
    border-radius: 4px;
}

.model-list-container.expanded {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.model-list-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

.model-list-item:hover {
    background: rgba(79, 195, 247, 0.08);
    border-left: 3px solid #4fc3f7;
    padding-left: 5px;
}

.model-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.model-list-item .model-name {
    font-size: 0.85em;
    font-weight: 600;
    color: #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-list-item .model-val {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.9em;
    color: #4fc3f7;
    margin-left: 12px;
}

.model-list-item .model-val.model-val-in-range {
    color: #66ff9a;
}

.model-list-item .model-val.model-val-out-of-range {
    color: #ff6767;
}

.model-weapons-row {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    font-size: 0.75em;
    color: #888;
    margin-top: 0;
    transition: all 0.25s ease;
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.model-list-item:hover .model-weapons-row {
    max-height: 60px;
    opacity: 1;
    margin-top: 4px;
    padding-top: 4px;
}

.vs-divider {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: #ffa500;
    font-style: italic;
}

.popup-distance {
    text-align: center;
    background: #2a2a4a;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.85em;
    color: #4fc3f7;
    margin-bottom: 20px;
    display: inline-block;
    margin-left: 50%;
    transform: translateX(-50%);
}

.popup-weapons-area {
    margin-bottom: 24px;
    max-height: 300px;
    overflow-y: auto;
}

.popup-weapons-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.popup-weapons-table th {
    text-align: left;
    background: #222;
    padding: 8px;
    color: #aaa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75em;
}

.popup-weapons-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #333;
}

.popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.popup-btn {
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-cancel {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: #777;
}

.btn-attack {
    background: linear-gradient(135deg, #ffa500, #ff6347);
    border: none;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-attack:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4);
}

.btn-attack:disabled {
    background: #4a4a4a;
    color: #9b9b9b;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.75;
}

.btn-attack:disabled:hover {
    transform: none;
    box-shadow: none;
}

.out-of-range {
    color: #ff5252 !important;
    text-decoration: line-through;
}
