/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #1a1a2e;
    color: #eee;
    height: 100vh;
    overflow: hidden;
}

#root {
    height: 100vh;
}

/* Main layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #16213e;
    border-right: 1px solid #0f3460;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #0f3460;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    color: #e94560;
    margin-bottom: 4px;
}

.sidebar-header p {
    font-size: 0.75rem;
    color: #888;
}

.course-name-input {
    width: 100%;
    padding: 8px 12px;
    margin-top: 12px;
    background-color: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 4px;
    color: #eee;
    font-size: 0.9rem;
}

.course-name-input:focus {
    outline: none;
    border-color: #e94560;
}

/* Toolbar section */
.toolbar-section {
    padding: 16px;
    border-bottom: 1px solid #0f3460;
}

.toolbar-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.tool-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background-color: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 6px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
}

.tool-btn:hover {
    background-color: #0f3460;
    color: #fff;
}

.tool-btn.active {
    background-color: #e94560;
    border-color: #e94560;
    color: #fff;
}

.tool-btn svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

/* Actions section */
.actions-section {
    padding: 16px;
    border-bottom: 1px solid #0f3460;
}

.actions-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background-color: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 6px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.action-btn:hover {
    background-color: #0f3460;
    color: #fff;
}

.action-btn.primary {
    background-color: #e94560;
    border-color: #e94560;
    color: #fff;
}

.action-btn.primary:hover {
    background-color: #d13a54;
}

.action-btn.danger {
    border-color: #dc3545;
    color: #dc3545;
}

.action-btn.danger:hover {
    background-color: #dc3545;
    color: #fff;
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

/* Stats section */
.stats-section {
    padding: 16px;
    flex-grow: 1;
}

.stats-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #0f3460;
    font-size: 0.85rem;
}

.stat-label {
    color: #888;
}

.stat-value {
    color: #eee;
    font-weight: 500;
}

/* Main content area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* SVG map container */
#map {
    flex: 1;
    background-color: #1a1a2e;
    display: block;
    user-select: none;
    -webkit-user-select: none;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background-color: #16213e;
    border: 1px solid #0f3460;
    border-radius: 6px;
    color: #eee;
    font-size: 0.9rem;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-color: #28a745;
}

.toast.error {
    border-color: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal {
    background-color: #16213e;
    border: 1px solid #0f3460;
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
}

.modal h2 {
    margin-bottom: 16px;
    color: #e94560;
}

.modal p {
    margin-bottom: 16px;
    color: #ccc;
    font-size: 0.9rem;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.modal-btn.cancel {
    background-color: transparent;
    border: 1px solid #0f3460;
    color: #ccc;
}

.modal-btn.cancel:hover {
    background-color: #0f3460;
}

.modal-btn.confirm {
    background-color: #e94560;
    border: 1px solid #e94560;
    color: #fff;
}

.modal-btn.confirm:hover {
    background-color: #d13a54;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid #0f3460;
    }

    .tool-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Hidden file input for JSON import */
.hidden-input {
    display: none;
}

/* Help tooltip */
.help-text {
    font-size: 0.7rem;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

/* Tool group styling */
.tool-group {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #0f3460;
}

.tool-group-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.tool-group .tool-btn {
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 12px;
}

.tool-group .tool-btn svg {
    margin-bottom: 0;
    width: 20px;
    height: 20px;
}

/* Selected Cone section */
.selected-cone-section {
    padding: 16px;
    border-bottom: 1px solid #0f3460;
    background-color: rgba(233, 69, 96, 0.1);
}

.selected-cone-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #e94560;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.deselect-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    background-color: transparent;
    border: 1px solid #666;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.deselect-btn:hover {
    border-color: #e94560;
    color: #e94560;
}

/* Calibration section */
.calibration-section {
    padding: 16px;
    border-bottom: 1px solid #0f3460;
}

.calibration-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.slider-group {
    margin-bottom: 12px;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.slider-label {
    color: #aaa;
}

.slider-value {
    color: #e94560;
    font-weight: 500;
    min-width: 45px;
    text-align: right;
}

.calibration-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #1a1a2e;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.calibration-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #e94560;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.calibration-slider::-webkit-slider-thumb:hover {
    background: #ff6b85;
}

.calibration-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #e94560;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.calibration-slider::-moz-range-thumb:hover {
    background: #ff6b85;
}

