/* OLYMPUS COMMAND - Game View Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0d1117;
    color: #f0f6fc;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

#ui-overlay > * {
    pointer-events: auto;
}

/* Header */
.game-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(to bottom, rgba(13, 17, 23, 0.95), rgba(13, 17, 23, 0.7));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #30363d;
}

.game-header h1 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 1px;
}

.logo-icon {
    color: #58a6ff;
    font-size: 24px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 5px;
    background: #21262d;
    padding: 4px;
    border-radius: 8px;
}

.view-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #8b949e;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.view-btn:hover {
    color: #f0f6fc;
    background: #30363d;
}

.view-btn.active {
    background: #58a6ff;
    color: #fff;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #8b949e;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8b949e;
}

.status-dot.connected {
    background: #3fb950;
    box-shadow: 0 0 8px #3fb950;
}

.status-dot.connecting {
    background: #d29922;
    animation: pulse 1.5s infinite;
}

.status-dot.disconnected,
.status-dot.error {
    background: #ff7b72;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Back Button */
.back-btn {
    padding: 8px 16px;
    border: 1px solid #30363d;
    background: #21262d;
    color: #f0f6fc;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

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

/* Legend */
.legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 20px;
    padding: 12px 20px;
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid #30363d;
    border-radius: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #8b949e;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.working { background: #3fb950; box-shadow: 0 0 6px #3fb950; }
.legend-dot.idle { background: #d29922; }
.legend-dot.error { background: #ff7b72; }
.legend-dot.walking { background: #58a6ff; }

/* Tooltip */
.tooltip {
    position: fixed;
    padding: 10px 14px;
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid #30363d;
    border-radius: 8px;
    font-size: 13px;
    color: #f0f6fc;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.tooltip strong {
    color: #f0f6fc;
    font-size: 14px;
}

.tooltip small {
    color: #8b949e;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 2000;
    pointer-events: none;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #30363d;
    background: #21262d;
}

.agent-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: #58a6ff;
}

.agent-title {
    flex: 1;
}

.agent-title h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.agent-type {
    font-size: 13px;
    color: #8b949e;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #30363d;
    color: #f0f6fc;
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #ff7b72;
    color: #fff;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 50vh;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #0d1117;
    border-radius: 8px;
}

.status-label {
    font-size: 13px;
    color: #8b949e;
}

.status-value {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
}

.status-active, .status-working {
    background: rgba(63, 185, 80, 0.2);
    color: #3fb950;
}

.status-idle {
    background: rgba(210, 153, 34, 0.2);
    color: #d29922;
}

.status-error {
    background: rgba(255, 123, 114, 0.2);
    color: #ff7b72;
}

.task-section,
.stats-section,
.capabilities-section {
    margin-bottom: 20px;
}

.task-section h3,
.stats-section h3,
.capabilities-section h3 {
    font-size: 13px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.task-section p {
    padding: 12px 16px;
    background: #0d1117;
    border-radius: 8px;
    font-size: 14px;
    color: #f0f6fc;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat {
    text-align: center;
    padding: 15px;
    background: #0d1117;
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #58a6ff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: #8b949e;
    text-transform: uppercase;
}

.capabilities-section ul {
    list-style: none;
    padding: 0;
}

.capabilities-section li {
    padding: 8px 12px;
    background: #0d1117;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #f0f6fc;
    border-left: 3px solid #58a6ff;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #30363d;
    background: #21262d;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #238636;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #2ea043;
}

.btn-secondary {
    background: #da3633;
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: #f85149;
}

/* Responsive */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .legend {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
