
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    margin: 0;
    padding: 0;
    color: #e0e0e0;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.app-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

h1 {
    color: #ffffff;
    margin: 0;
    font-size: 2em;
    font-weight: 300;
}

.main-content {
    display: flex;
    gap: 20px;
    min-height: 70vh;
}

.controls-panel {
    flex: 0 0 350px;
    background: #2d2d2d;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.5);
    height: fit-content;
    border: 1px solid #444;
}

.map-panel {
    flex: 1;
    background: #2d2d2d;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #444;
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #ffffff;
}

#map-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #555;
    border-radius: 4px;
    font-size: 14px;
    background: #3d3d3d;
    color: #e0e0e0;
}

#map-select:focus {
    outline: none;
    border-color: #0ea5e9;
}

.info-panel, .results-panel {
    background: #383838;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #555;
}

.info-panel h3, .results-panel h3 {
    margin: 0 0 15px 0;
    color: #ffffff;
    font-size: 1.1em;
    font-weight: 600;
    border-bottom: 2px solid #0ea5e9;
    padding-bottom: 5px;
}

.map-info div, .result-item {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item label {
    font-weight: 500;
    margin: 0;
}

.result-value {
    font-weight: 600;
    color: #10b981;
    font-family: 'Courier New', monospace;
}

.main-results {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid #0ea5e9;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-metric {
    text-align: center;
    padding: 15px;
    background: #333333;
    border-radius: 6px;
    border: 1px solid #444;
}

.metric-label {
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 2.8em;
    font-weight: 700;
    color: #10b981;
    font-family: 'Courier New', monospace;
    line-height: 1;
}

.metric-unit {
    font-size: 0.6em;
    color: #6b7280;
    margin-left: 5px;
}

.info-panel {
    background: #383838;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #555;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #9ca3af;
    font-weight: 500;
}

.details-panel {
    background: #383838;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    border: 1px solid #555;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    color: #10b981;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

#map-status {
    color: #9ca3af;
    font-style: italic;
}

.actions {
    margin-bottom: 15px;
}

.btn-clear {
    width: 100%;
    padding: 12px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-clear:hover {
    background: #b91c1c;
}

.btn-clear:disabled {
    background: #6b7280;
    cursor: not-allowed;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #0ea5e9;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #0284c7;
}

.btn-primary.active {
    background: #10b981;
}

.btn-primary.active:hover {
    background: #059669;
}

.btn-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.8;
}

.instructions {
    background: #ecf0f1;
    border-radius: 6px;
    padding: 15px;
}

.instructions ol {
    margin: 0;
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 5px;
    line-height: 1.4;
}

#canvas-container {
    position: relative;
    border: 2px solid #555;
    border-radius: 8px;
    background: #1a1a1a;
    width: 80vh;
    height: 80vh;
    max-width: calc(100vw - 420px);
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
}

#map-canvas {
    display: block;
    cursor: crosshair;
    border-radius: 6px;
    transform-origin: center center;
    transition: transform 0.1s ease;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .controls-panel {
        flex: none;
        order: 2;
    }
    
    .map-panel {
        order: 1;
        min-height: 300px;
    }
    
    #canvas-container {
        width: 90vw;
        height: 90vw;
        max-width: 90vw;
        max-height: 70vh;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .app-icon {
        width: 40px;
        height: 40px;
    }
    
    .main-results {
        gap: 15px;
        padding: 15px;
    }
    
    .main-metric {
        padding: 12px;
    }
    
    .metric-value {
        font-size: 2.4em;
    }
    
    .metric-label {
        font-size: 11px;
    }
}
