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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: #0a0e27;
    min-height: 100vh;
    padding: 20px;
    color: #e2e8f0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #0f172a;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border: 1px solid #1e293b;
}

.mode-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #1e293b;
    border-radius: 10px;
    padding: 4px;
}

.mode-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s;
}

.mode-tab:hover { color: #94a3b8; background: #334155; }
.mode-tab.active { color: #f8fafc; background: #3b82f6; }

.mode-content { display: none; }
.mode-content.active { display: block; }

h1 { color: #f8fafc; margin-bottom: 8px; font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
.subtitle { color: #94a3b8; margin-bottom: 24px; font-size: 14px; line-height: 1.6; }
.controls { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.input-group { display: flex; gap: 10px; align-items: center; }

input[type="text"], input[type="number"] {
    padding: 10px 14px;
    border: 1px solid #334155;
    border-radius: 8px;
    font-size: 14px;
    background: #1e293b;
    color: #e2e8f0;
    transition: all 0.2s;
}

input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="text"] { width: 300px; }
input[type="number"] { width: 80px; }

button {
    padding: 10px 18px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

button:hover { background: #2563eb; }
button:active { transform: scale(0.98); }
button.secondary { background: #10b981; }
button.secondary:hover { background: #059669; }
button.danger { background: #ef4444; }
button.danger:hover { background: #dc2626; }
input[type="file"] { display: none; }

.marker-type-selector {
    display: flex;
    gap: 10px;
    padding: 16px;
    background: #1e293b;
    border-radius: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    border: 1px solid #334155;
}

.marker-type-btn {
    padding: 12px 18px;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #cbd5e1;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.marker-type-btn:hover { border-color: #475569; background: #1e293b; }
.marker-type-btn.active { border-color: #3b82f6; background: rgba(59, 130, 246, 0.1); color: #3b82f6; }

.marker-icon { width: 24px; height: 24px; }
.marker-icon.dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.marker-icon.dot.Waypoint { border-style: dashed; }

.gw2-marker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px;
    background: #1e293b;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid #334155;
}

.gw2-marker-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.gw2-marker-item:hover { border-color: #475569; background: #1e293b; }
.gw2-marker-item.active { border-color: #3b82f6; background: rgba(59, 130, 246, 0.1); }

.gw2-marker-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gw2-marker-name { font-size: 14px; font-weight: 600; color: #e2e8f0; }

.gw2-required-input {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.gw2-required-input label { color: #94a3b8; }
.gw2-required-input input {
    width: 60px;
    padding: 4px 8px;
    font-size: 12px;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 6px;
}

.options-panel {
    display: flex;
    gap: 16px;
    padding: 14px 18px;
    background: #1e293b;
    border-radius: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid #334155;
}

.option-group { display: flex; align-items: center; gap: 10px; }
.option-group label { font-weight: 600; color: #cbd5e1; font-size: 14px; }
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.endpoint-mode-selector {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    background: #1e293b;
    border-radius: 10px;
    margin-bottom: 16px;
    align-items: center;
    border: 1px solid #334155;
}

.endpoint-mode-selector label { font-weight: 600; color: #cbd5e1; margin-right: 10px; }

.mode-option {
    padding: 8px 16px;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #94a3b8;
    transition: all 0.2s;
    font-size: 13px;
}

.mode-option:hover { border-color: #475569; background: #1e293b; }
.mode-option.active { border-color: #3b82f6; background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.mode-description { font-size: 12px; color: #94a3b8; margin-left: auto; font-style: italic; }

.main-content { display: grid; grid-template-columns: 1fr 450px; gap: 24px; margin-top: 24px; }
@media (max-width: 1200px) { .main-content { grid-template-columns: 1fr; } }

.canvas-container {
    position: relative;
    border: 2px solid #334155;
    border-radius: 12px;
    overflow: hidden;
    background: #1e293b;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

canvas { display: block; cursor: crosshair; }

.marker {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    transition: all 0.2s;
    z-index: 10;
}

.marker img { width: 24px; height: 24px; pointer-events: none; }
.marker:hover { transform: translate(-50%, -50%) scale(1.25); box-shadow: 0 6px 16px rgba(0,0,0,0.6); }
.marker.start { background: #10b981; border: 3px solid #064e3b; }
.marker.end { background: #ef4444; border: 3px solid #7f1d1d; }
.marker.Marker { background: #3b82f6; border: 3px solid #1e3a8a; }
.marker.Waypoint { background: #8b5cf6; border: 3px dashed #4c1d95; cursor: ns-resize; }
.marker.gw2 { background: transparent; border: none; box-shadow: none; width: 32px; height: 32px; }

.legend {
    margin-top: 20px;
    padding: 16px;
    background: #1e293b;
    border-radius: 10px;
    border: 1px solid #334155;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #cbd5e1; }

.results-panel { display: none; }
.results-panel.active { display: block; }

.results-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.2s;
}

.results-header:hover { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.toggle-icon { font-size: 20px; transition: transform 0.3s; }
.toggle-icon.expanded { transform: rotate(180deg); }

.results-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.results-content.expanded { max-height: 2000px; }

.method-result {
    border: 1px solid #334155;
    border-top: none;
    padding: 16px;
    background: #1e293b;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.method-result:hover {
    background: #334155;
    border-color: #3b82f6;
    transform: translateX(4px);
    box-shadow: -2px 0 0 #3b82f6;
}

.method-result:hover::before {
    content: 'Previewing route';
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 11px;
    color: #3b82f6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-result:last-child { border-radius: 0 0 12px 12px; }
.method-result.best {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    border-width: 2px;
}

.method-name {
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.method-name .badge {
    background: #10b981;
    color: #064e3b;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-distance { color: #60a5fa; font-weight: 600; font-size: 18px; margin-bottom: 10px; }
.method-route { color: #94a3b8; font-size: 13px; line-height: 1.8; word-break: break-word; }

.placeholder { text-align: center; color: #64748b; padding: 50px 20px; }
.placeholder-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.placeholder p { font-size: 15px; }

.computing { text-align: center; padding: 40px; color: #60a5fa; }
.computing-spinner {
    font-size: 32px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.reminder-note {
    background: rgba(251, 191, 36, 0.1);
    border-left: 4px solid #fbbf24;
    padding: 14px 16px;
    margin-top: 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #fcd34d;
    line-height: 1.6;
}

/* GW2 Marker Selector Styling */
.sg-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 12px;
}

.suggestion-group { padding: 12px 0; }
.sg-separator { height: 1px; background: #334155; margin: 12px 0; }

.compact-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 14px;
}

.compact-check input[type="checkbox"] { margin: 0; }
.compact-check:hover { color: #f8fafc; }

.sg-btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.sg-btn.primary {
    background: #3b82f6;
    color: white;
}

.sg-btn.primary:hover { background: #2563eb; }

.sg-btn.danger {
    background: #ef4444;
    color: white;
}

.sg-btn.danger:hover { background: #dc2626; }

.sg-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.sg-close-btn:hover {
    background: #334155;
    color: #f8fafc;
}
