@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Google Sans', 'Product Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    background: #1a1a1a;
    color: #e0e0e0;
}

/* ===== AUTH SCREENS ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #0d1117;
    padding: 20px;
}

.auth-box {
    background: #161b22;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 400px;
    border: 1px solid #30363d;
}

/* App Branding */
.app-branding {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #30363d;
}

.app-name {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    animation: fadeInUp 0.8s ease-out;
}

.app-name .geo {
    color: #58a6ff;
    display: inline-block;
    animation: slideInLeft 0.6s ease-out;
}

.app-name .sphere {
    color: #7ee787;
    display: inline-block;
    animation: slideInRight 0.6s ease-out 0.2s both;
}

.app-tagline {
    font-size: 0.85rem;
    color: #8b949e;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 400;
    animation: fadeIn 1s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.auth-box h2 {
    color: #c9d1d9;
    margin-bottom: 24px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 400;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #c9d1d9;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #30363d;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    background: #0d1117;
    color: #c9d1d9;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #58a6ff;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #238636;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(35, 134, 54, 0.4);
    background: #2ea043;
}

.btn-secondary {
    background: #21262d;
    color: #c9d1d9;
    margin-top: 10px;
    width: 100%;
    border: 1px solid #30363d;
}

.btn-secondary:hover {
    background: #30363d;
}

.error-message {
    background: #3d1e1e;
    color: #f85149;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    display: none;
    border: 1px solid #6e2c2c;
}

.success-message {
    background: #1e3d1e;
    color: #3fb950;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    display: none;
    border: 1px solid #2c6e2c;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #8b949e;
}

.auth-switch a {
    color: #58a6ff;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #30363d;
}

.auth-footer a {
    color: #8b949e;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: #58a6ff;
}

/* Layer Panel Footer */
.layer-panel-footer {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #30363d;
    background: #0d1117;
    margin-top: auto;
}

.layer-panel-footer a {
    color: #8b949e;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s;
}

.layer-panel-footer a:hover {
    color: #58a6ff;
}

/* ===== MAP DASHBOARD ===== */
.map-container {
    display: none;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Top Header */
.map-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #161b22;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid #30363d;
}

.map-header h1 {
    color: #58a6ff;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.globe-spin {
    height: 30px;
    width: 30px;
    vertical-align: middle;
}

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

.btn-upload {
    background: #238636;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-upload:hover {
    background: #2ea043;
    transform: translateY(-2px);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-weight: 600;
    color: #c9d1d9;
}

.btn-logout {
    background: #da3633;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.btn-logout:hover {
    background: #f85149;
}

/* Dashboard Button */
.btn-dashboard {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s;
}

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

/* Left Sidebar - Layer Panel */
.layer-panel {
    position: absolute;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 320px;
    background: #0d1117;
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 900;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    border-right: 1px solid #30363d;
}

.layer-panel.collapsed {
    transform: translateX(-100%);
}

.layer-panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.layer-panel-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.layer-panel-header h3 {
    color: #c9d1d9;
    margin: 0;
}

.btn-upload-small {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #238636;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-upload-small:hover {
    background: #2ea043;
    transform: scale(1.05);
}

/* Layer Panel Tabs */
.layer-panel-tabs {
    display: flex;
    border-bottom: 1px solid #30363d;
    background: #161b22;
}

.layer-tab {
    flex: 1;
    padding: 12px 15px;
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.layer-tab:hover {
    color: #c9d1d9;
    background: #21262d;
}

.layer-tab.active {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
    background: #0d1117;
}

.layer-tab-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.layer-tab-content.active {
    display: flex;
}

/* Basemap Options */
.basemap-options {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.basemap-section h4 {
    color: #c9d1d9;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #21262d;
}

.basemap-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 8px;
}

.basemap-item:hover {
    background: #21262d;
    border-color: #58a6ff;
}

.basemap-item input[type="radio"] {
    accent-color: #58a6ff;
}

.basemap-item label {
    color: #c9d1d9;
    font-size: 13px;
    cursor: pointer;
    flex: 1;
}

/* Custom WMS Form */
.custom-wms-list {
    margin-bottom: 15px;
}

.custom-wms-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 8px;
}

.custom-wms-item span {
    color: #c9d1d9;
    font-size: 12px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-wms-item button {
    background: #da3633;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
}

.add-wms-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wms-input {
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 12px;
}

.wms-input:focus {
    outline: none;
    border-color: #58a6ff;
}

.btn-add-wms {
    padding: 10px 15px;
    background: #238636;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-wms:hover {
    background: #2ea043;
}

/* Service type select dropdown options */
.wms-input option {
    background: #0d1117;
    color: #c9d1d9;
}

/* Service type badge in saved basemap items */
.custom-wms-item .service-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 500;
    flex-shrink: 0;
}

.service-badge.wms {
    background: #1f6feb;
    color: white;
}

.service-badge.wmts {
    background: #8b5cf6;
    color: white;
}

.layer-panel-header h3 + span {
    color: #c9d1d9;
    font-size: 18px;
}

.btn-toggle-panel {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #58a6ff;
}

.layer-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.layer-item {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

.layer-item:hover {
    border-color: #58a6ff;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

.layer-item.active {
    border-color: #58a6ff;
    background: #1c2128;
}

.layer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.layer-name {
    font-weight: 600;
    color: #c9d1d9;
    font-size: 15px;
}

.layer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: #484f58;
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-switch.on {
    background: #238636;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
}

.toggle-switch.on::after {
    left: 27px;
}

.layer-info {
    font-size: 13px;
    color: #8b949e;
}

.layer-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-layer-action {
    flex: 1;
    padding: 6px;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: #21262d;
    color: #c9d1d9;
}

.btn-layer-action:hover {
    background: #30363d;
}

.btn-layer-action.danger {
    background: #3d1e1e;
    color: #f85149;
    border-color: #6e2c2c;
}

.btn-layer-action.danger:hover {
    background: #4d2525;
}

/* Map Container */
#map {
    position: absolute;
    left: 320px;
    top: 60px;
    right: 0;
    bottom: 0;
    transition: left 0.3s ease, right 0.3s ease, bottom 0.25s ease;
}

#map.full-width {
    left: 0;
}

#map.chat-open {
    right: 500px;
}

#map.attr-panel-open {
    bottom: 300px;
}

#map.attr-panel-expanded {
    bottom: 50vh;
}

/* Floating Ask AI Button */
.ask-ai-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #238636;
    border-radius: 50%;
    border: 2px solid #2ea043;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(35, 134, 54, 0.5);
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: white;
    font-size: 24px;
}

.ask-ai-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(35, 134, 54, 0.7);
    background: #2ea043;
}

.ask-ai-btn.chat-open {
    right: 530px;
}

/* Chat Panel (Sliding from Right) */
.chat-panel {
    position: absolute;
    right: 0;
    top: 60px;
    bottom: 0;
    width: 500px;
    background: #0d1117;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 850;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 1px solid #30363d;
    overflow: hidden;
}

/* Chat Panel Three.js Background */
#chatThreeCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

.chat-panel.open {
    transform: translateX(0);
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(22, 27, 34, 0.95);
    color: #c9d1d9;
    position: relative;
    z-index: 1;
}

.chat-header h3 {
    font-size: 18px;
}

.btn-close-chat {
    background: none;
    border: none;
    color: #c9d1d9;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: transparent;
    position: relative;
    z-index: 1;
}

.chat-message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 10px;
    max-width: 85%;
}

.chat-message.user {
    background: #1f6feb;
    color: white;
    margin-left: auto;
    text-align: right;
    font-size: 13px;
}

.chat-message.ai {
    background: #161b22;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

.chat-message.ai .reasoning {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ffffff;
    font-size: 13px;
    color: #8b949e;
    font-style: italic;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid #30363d;
    background: rgba(22, 27, 34, 0.95);
    position: relative;
    z-index: 1;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #30363d;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    background: #0d1117;
    color: #c9d1d9;
}

.chat-input:focus {
    outline: none;
    border-color: #58a6ff;
}

.btn-send {
    background: #238636;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-send:hover {
    background: #2ea043;
}

.btn-send:disabled {
    background: #484f58;
    cursor: not-allowed;
}

.chat-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-mic {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

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

.btn-mic.recording {
    background: #f85149;
    color: white;
    border-color: #f85149;
    animation: pulse 1s infinite;
}

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

/* Chat Tabs */
.chat-tabs {
    display: flex;
    background: rgba(22, 27, 34, 0.95);
    border-bottom: 1px solid #30363d;
    padding: 0;
    position: relative;
    z-index: 1;
}

.chat-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #8b949e;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-tab:hover {
    background: #21262d;
    color: #c9d1d9;
}

.chat-tab.active {
    background: #0d1117;
    color: #58a6ff;
    border-bottom-color: #58a6ff;
}

.chat-tab .tab-icon {
    font-size: 18px;
}

.chat-tab .tab-label {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* Chat Tab Content */
.chat-tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.chat-tab-content.active {
    display: flex;
}

.chat-tab-content .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: transparent;
    position: relative;
    z-index: 1;
}

/* Suggestion Container */
.suggestion-container {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.suggestion-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8b949e;
    font-size: 13px;
    padding: 10px;
}

.suggestion-chip {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #c9d1d9;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.suggestion-chip:hover {
    background: #30363d;
    border-color: #58a6ff;
    color: #58a6ff;
    transform: translateX(4px);
}

.suggestion-chip.suggest-more {
    background: transparent;
    border-style: dashed;
    color: #58a6ff;
    text-align: center;
    font-weight: 500;
}

.suggestion-chip.suggest-more:hover {
    background: rgba(88, 166, 255, 0.1);
}

.suggestion-header {
    color: #8b949e;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    padding-left: 4px;
}

/* Upload Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: #161b22;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #30363d;
}

/* ===== Attribute Table Bottom Panel ===== */
.attribute-table-panel {
    position: fixed;
    left: 320px;
    right: 0;
    bottom: 0;
    height: 300px;
    background: #fff;
    z-index: 900;
    display: none;
    flex-direction: column;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    border-top: 2px solid #667eea;
    transition: left 0.3s ease, right 0.3s ease, height 0.25s ease;
}

.attribute-table-panel.open {
    display: flex;
}

.attribute-table-panel.expanded {
    height: 50vh;
}

/* Adjust for sidebar collapsed */
.layer-panel.collapsed ~ .attribute-table-panel,
.attribute-table-panel.sidebar-collapsed {
    left: 0;
}

/* Adjust for chat panel open */
.attribute-table-panel.chat-open {
    right: 500px;
}

.attr-panel-resize-handle {
    height: 4px;
    cursor: ns-resize;
    background: transparent;
    flex-shrink: 0;
    transition: background 0.15s;
}

.attr-panel-resize-handle:hover {
    background: #667eea;
}

.attribute-table-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f5f7ff;
    border-bottom: 1px solid #e0e3f0;
    padding: 0 8px 0 0;
    min-height: 36px;
    flex-shrink: 0;
}

.attribute-table-tabs {
    display: flex;
    overflow-x: auto;
    flex: 1;
    gap: 0;
    min-width: 0;
}

.attribute-table-tabs::-webkit-scrollbar {
    height: 3px;
}

.attribute-table-tabs::-webkit-scrollbar-thumb {
    background: #c0c4d0;
    border-radius: 3px;
}

.attr-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
    position: relative;
}

.attr-tab:hover {
    background: #e8ebf5;
    color: #4c5fd7;
}

.attr-tab.active {
    color: #4c5fd7;
    border-bottom-color: #667eea;
    background: #fff;
    font-weight: 600;
}

.attr-tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: all 0.15s;
}

.attr-tab-close:hover {
    background: #e74c3c;
    color: white;
}

.attribute-table-panel-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding-left: 8px;
}

.attr-panel-resize-btn,
.attr-panel-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.15s;
    line-height: 1;
}

.attr-panel-resize-btn:hover,
.attr-panel-close-btn:hover {
    background: #e0e3f0;
    color: #4c5fd7;
}

.attr-panel-close-btn:hover {
    color: #e74c3c;
}

.attribute-table-panel.expanded .attr-panel-resize-btn {
    transform: rotate(180deg);
}

.attr-tab-label {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attribute-table-panel-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.attr-tab-content {
    display: none;
    flex-direction: column;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.attr-tab-content.active {
    display: flex;
}

.attribute-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

.attribute-table-search {
    flex-shrink: 0;
}

.attribute-table-search input {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    width: 200px;
    outline: none;
    background: #f9f9f9;
    color: #333;
}

.attribute-table-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.attribute-table-status {
    color: #666;
    font-size: 12px;
}

.attribute-table-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.attribute-table-page-info {
    color: #555;
    font-size: 12px;
}

.btn-table {
    background: #f3f4f6;
    border: 1px solid #ddd;
    color: #333;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

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

.attribute-table-select {
    background: #f9f9f9;
    color: #333;
    border: 1px solid #ddd;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.attribute-table-scroll {
    overflow: auto;
    flex: 1;
    min-height: 0;
}

#attributeTable,
.attribute-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: #000;
}

#attributeTable th,
#attributeTable td,
.attribute-data-table th,
.attribute-data-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

#attributeTable th,
.attribute-data-table th {
    position: sticky;
    top: 0;
    background: #f5f7ff;
    color: #4c5fd7;
    text-align: left;
    z-index: 1;
    padding: 4px 6px;
}

.th-content {
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.th-label {
    cursor: pointer;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.th-sort {
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
    cursor: pointer;
    gap: 0;
}

.sort-arrow {
    font-size: 8px;
    color: #c0c4d0;
    line-height: 8px;
}

.sort-arrow.active {
    color: #4c5fd7;
}

.th-filter-btn {
    background: none;
    border: none;
    color: #b0b4c0;
    font-size: 11px;
    cursor: pointer;
    padding: 1px 3px;
    border-radius: 3px;
    line-height: 1;
    flex-shrink: 0;
}

.th-filter-btn:hover {
    background: #e0e3f0;
    color: #4c5fd7;
}

.th-filter-btn.col-filter-active {
    color: #fff;
    background: #667eea;
}

/* Column filter dropdown */
.col-filter-dropdown {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    width: 220px;
    max-height: 360px;
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

.col-filter-search {
    padding: 6px;
    border-bottom: 1px solid #eee;
}

.col-filter-search input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
}

.col-filter-search input:focus {
    border-color: #667eea;
}

.col-filter-actions {
    display: flex;
    gap: 4px;
    padding: 4px 6px;
    border-bottom: 1px solid #eee;
}

.col-filter-actions .btn-table {
    font-size: 11px;
    padding: 3px 8px;
}

.col-filter-values {
    overflow-y: auto;
    flex: 1;
    max-height: 220px;
    padding: 4px 0;
}

.col-filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.col-filter-item:hover {
    background: #f0f2ff;
}

.col-filter-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.col-filter-item input[type="checkbox"] {
    flex-shrink: 0;
    accent-color: #667eea;
}

.col-filter-apply {
    display: flex;
    gap: 4px;
    padding: 6px;
    border-top: 1px solid #eee;
    justify-content: flex-end;
}

.col-filter-loading {
    padding: 20px;
    text-align: center;
    color: #999;
}

#attributeTable tbody tr,
.attribute-data-table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#attributeTable tbody tr:hover,
.attribute-data-table tbody tr:hover {
    background-color: #e8f4ff;
}

#attributeTable tbody tr.selected,
.attribute-data-table tbody tr.selected {
    background-color: #d0e7ff;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #58a6ff;
    font-size: 22px;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #8b949e;
    line-height: 1;
}

.btn-close-modal:hover {
    color: #c9d1d9;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #30363d;
}

.modal-footer .btn {
    min-width: 100px;
}

.upload-zone {
    border: 3px dashed #58a6ff;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
    background: #0d1117;
}

.upload-zone:hover {
    background: #1c2128;
    border-color: #79c0ff;
}

.upload-zone.dragging {
    background: #21262d;
    border-color: #58a6ff;
}

.upload-zone-icon {
    font-size: 48px;
    color: #58a6ff;
    margin-bottom: 10px;
}

/* Upload Type Toggle */
.dataset-type-toggle {
    display: flex;
    gap: 10px;
}

.type-toggle-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #30363d;
    background: #0d1117;
    color: #8b949e;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.type-toggle-btn:hover {
    border-color: #58a6ff;
    color: #c9d1d9;
}

.type-toggle-btn.active {
    border-color: #58a6ff;
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
}

/* Dataset Type Selector - Upload Modal */
.dataset-type-selector {
    display: flex;
    gap: 12px;
}

.type-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid #30363d;
    background: #161b22;
    color: #8b949e;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.type-btn:hover {
    border-color: #58a6ff;
    background: #21262d;
    color: #c9d1d9;
    transform: translateY(-2px);
}

.type-btn.active {
    border-color: #58a6ff;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.15), rgba(102, 126, 234, 0.15));
    color: #58a6ff;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

.type-btn i {
    font-size: 24px;
    margin-bottom: 8px;
}

.type-btn .type-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.type-btn .type-desc {
    font-size: 11px;
    color: #6e7681;
    line-height: 1.3;
}

.type-btn.active .type-desc {
    color: #8b949e;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #30363d;
    border-top: 3px solid #58a6ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Loading Message in Chat */
.loading-message {
    display: flex;
    align-items: center;
    gap: 12px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #30363d;
    border-top: 3px solid #58a6ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

.loading-text {
    color: #8b949e;
    font-style: italic;
}

/* Layer Panel Expand Button (when collapsed) */
.layer-panel-expand-btn {
    position: absolute;
    left: 10px;
    top: 80px;
    width: 40px;
    height: 40px;
    background: #161b22;
    border: 2px solid #58a6ff;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 850;
    font-size: 18px;
    color: #58a6ff;
    transition: all 0.3s;
}

.layer-panel-expand-btn:hover {
    background: #1f6feb;
    color: white;
    transform: scale(1.1);
}

.layer-panel.collapsed~.layer-panel-expand-btn {
    display: flex;
}

/* Measurement Tools */
.measurement-tools {
    position: absolute;
    left: 350px;
    bottom: 30px;
    display: flex;
    gap: 10px;
    z-index: 850;
}

.measure-tool-btn {
    width: 40px;
    height: 40px;
    background: #161b22;
    border: 2px solid #58a6ff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    font-size: 18px;
    color: #58a6ff;
    transition: all 0.3s;
}

.measure-tool-btn:hover {
    background: #1f6feb;
    color: white;
    transform: scale(1.1);
}

.measure-tool-btn.active {
    background: #1f6feb;
    color: white;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
}

/* Selection Tools */
.selection-tools {
    position: absolute;
    left: 350px;
    bottom: 80px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 850;
}

.select-tool-btn {
    width: 40px;
    height: 40px;
    background: #161b22;
    border: 2px solid #00ffff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    font-size: 18px;
    color: #00ffff;
    transition: all 0.3s;
}

.select-tool-btn:hover {
    background: #00a8a8;
    color: white;
    transform: scale(1.1);
}

.select-tool-btn.active {
    background: #00a8a8;
    color: white;
    border-color: #00ffff;
    box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.3);
}

.selection-badge {
    background: linear-gradient(135deg, #00ffff 0%, #00a8a8 100%);
    color: #161b22;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 255, 255, 0.3);
}

.selection-toast {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 10px 20px;
    color: #00ffff;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* View Toggle Tools (2D/3D) */
.view-toggle-tools {
    position: absolute;
    left: 350px;
    bottom: 130px;
    z-index: 850;
    display: flex;
    background: #161b22;
    border-radius: 8px;
    border: 2px solid #58a6ff;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.view-toggle-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #8b949e;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 50px;
}

.view-toggle-btn:first-child {
    border-right: 1px solid #30363d;
}

.view-toggle-btn:hover {
    background: #21262d;
    color: #c9d1d9;
}

.view-toggle-btn.active {
    background: #1f6feb;
    color: white;
}

.view-toggle-btn .view-icon {
    font-size: 18px;
}

.view-toggle-btn .view-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Shift toolbars up when attribute table panel is open */
.measurement-tools.attr-panel-open {
    bottom: 330px;
}

.selection-tools.attr-panel-open {
    bottom: 380px;
}

.view-toggle-tools.attr-panel-open {
    bottom: 430px;
}

.ask-ai-btn.attr-panel-open {
    bottom: 330px;
}

/* Shift toolbars up even more when expanded */
.measurement-tools.attr-panel-expanded {
    bottom: calc(50vh + 30px);
}

.selection-tools.attr-panel-expanded {
    bottom: calc(50vh + 80px);
}

.view-toggle-tools.attr-panel-expanded {
    bottom: calc(50vh + 130px);
}

.ask-ai-btn.attr-panel-expanded {
    bottom: calc(50vh + 30px);
}

/* Smooth transition for toolbar shifting */
.measurement-tools,
.selection-tools,
.view-toggle-tools,
.ask-ai-btn {
    transition: bottom 0.25s ease;
}

/* Cesium 3D Container */
#cesiumContainer {
    position: absolute;
    left: 320px;
    top: 60px;
    right: 0;
    bottom: 0;
    transition: left 0.3s ease, right 0.3s ease, bottom 0.25s ease;
}

#cesiumContainer.full-width {
    left: 0;
}

#cesiumContainer.chat-open {
    right: 500px;
}

#cesiumContainer.attr-panel-open {
    bottom: 300px;
}

#cesiumContainer.attr-panel-expanded {
    bottom: 50vh;
}

/* Hide Cesium default credits */
.cesium-credit-logoContainer,
.cesium-credit-expand-link {
    display: none !important;
}

/* Drawing Tools */
.btn-create-layer {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f0883e;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-create-layer:hover {
    background: #d97706;
    transform: scale(1.05);
}

.drawing-toolbar {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #f0883e;
    border-radius: 8px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.drawing-tool-btn {
    background: #f0883e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.drawing-tool-btn:hover {
    background: #d97706;
}

.drawing-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 27, 34, 0.95);
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1002;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.drawing-toast.success {
    border: 1px solid #238636;
    color: #3fb950;
}

.drawing-toast.error {
    border: 1px solid #f85149;
    color: #f85149;
}

.temporary-layer-list {
    border-bottom: 1px solid #30363d;
}

/* Measurement Tooltip */
.measurement-tooltip {
    position: relative;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #58a6ff;
    border-radius: 6px;
    padding: 8px 12px;
    color: #58a6ff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.measurement-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #58a6ff;
}

/* Measurement Info Box */
.measurement-info-box {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    background: rgba(22, 27, 34, 0.98);
    border: 1px solid #58a6ff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(10px);
}

.measurement-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #30363d;
    background: rgba(88, 166, 255, 0.1);
    border-radius: 8px 8px 0 0;
}

.measurement-info-title {
    color: #58a6ff;
    font-weight: 600;
    font-size: 14px;
}

.measurement-info-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 4px;
}

.measurement-info-close:hover {
    background: rgba(139, 148, 158, 0.2);
    color: #c9d1d9;
}

.measurement-info-content {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.measurement-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid #30363d;
    border-radius: 6px;
    transition: all 0.2s;
}

.measurement-info-item:hover {
    border-color: #58a6ff;
    background: rgba(88, 166, 255, 0.05);
}

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

.measurement-info-label {
    color: #8b949e;
    font-size: 13px;
    font-weight: 500;
}

.measurement-info-value {
    color: #58a6ff;
    font-size: 14px;
    font-weight: 600;
}

.measurement-info-footer {
    padding: 10px 15px;
    border-top: 1px solid #30363d;
    text-align: center;
    background: rgba(13, 17, 23, 0.6);
    border-radius: 0 0 8px 8px;
}

.hidden {
    display: none !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* Layer Menu Dropdown */
.layer-menu-item {
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #30363d;
    transition: background 0.2s;
    color: #c9d1d9;
}

#layerMenuDropdown {
    display: none;
    position: fixed;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    min-width: 160px;
}

.layer-menu-item:last-child {
    border-bottom: none;
}

.layer-menu-item:hover {
    background: #21262d;
}

/* Map Loading Spinner Overlay */
.map-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(22, 27, 34, 0.9);
    padding: 20px 30px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 2000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #30363d;
    backdrop-filter: blur(5px);
}

.spinner-circle {
    width: 40px;
    height: 40px;
    border: 4px solid #30363d;
    border-top: 4px solid #58a6ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-text {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ===== LAYER LEGEND ===== */
.layer-legend {
    position: absolute;
    bottom: 30px;
    left: 20px;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #30363d;
    border-radius: 8px;
    min-width: 200px;
    max-width: 280px;
    max-height: 400px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    font-weight: 600;
    color: #58a6ff;
    font-size: 13px;
}

.legend-content {
    padding: 10px 12px;
    max-height: 350px;
    overflow-y: auto;
}

.legend-layer {
    margin-bottom: 12px;
}

.legend-layer:last-child {
    margin-bottom: 0;
}

.legend-layer-title {
    font-weight: 600;
    color: #c9d1d9;
    font-size: 12px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.legend-color-box {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.legend-line {
    width: 24px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    flex-shrink: 0;
}

.legend-item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legend-item-count {
    color: #6e7681;
    font-size: 10px;
}

/* ===== CATEGORIZED SYMBOLOGY UI ===== */
.symbology-type-btn {
    transition: all 0.3s ease;
}

.symbology-type-btn:hover {
    border-color: #667eea !important;
}

.symbology-type-btn.active {
    background: #667eea !important;
    border-color: #667eea !important;
    color: white !important;
}

.category-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #21262d;
    border-radius: 6px;
    margin-bottom: 6px;
    border: 1px solid #30363d;
}

.category-color-row:hover {
    border-color: #58a6ff;
}

.category-color-input {
    width: 36px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}

.category-width-input {
    width: 50px;
    padding: 4px 8px;
    border: 1px solid #30363d;
    border-radius: 4px;
    background: #0d1117;
    color: #c9d1d9;
    font-size: 12px;
    text-align: center;
}

.category-label {
    flex: 1;
    font-size: 12px;
    color: #c9d1d9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-count {
    font-size: 10px;
    color: #6e7681;
    background: #0d1117;
    padding: 2px 6px;
    border-radius: 10px;
}

/* ===== Slash Command Dropdown ===== */

.slash-cmd-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #161b22;
    border: 1px solid #30363d;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    z-index: 10;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
}

.slash-cmd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #21262d;
    transition: background 0.15s;
}

.slash-cmd-item:last-child {
    border-bottom: none;
}

.slash-cmd-item:hover,
.slash-cmd-item.active {
    background: #21262d;
}

.slash-cmd-item .cmd-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 14px;
    color: #58a6ff;
    flex-shrink: 0;
}

.slash-cmd-item .cmd-name {
    color: #58a6ff;
    font-weight: 600;
    font-size: 13px;
    font-family: monospace;
    white-space: nowrap;
}

.slash-cmd-item .cmd-params {
    color: #6e7681;
    font-size: 11px;
    font-family: monospace;
    white-space: nowrap;
}

.slash-cmd-item .cmd-desc {
    color: #8b949e;
    font-size: 12px;
    margin-left: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ===== Layer Picker Dropdown ===== */

.slash-layer-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #161b22;
    border: 1px solid #58a6ff;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    z-index: 11;
    box-shadow: 0 -4px 12px rgba(88, 166, 255, 0.15);
}

.slash-layer-header {
    padding: 8px 14px;
    color: #58a6ff;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid #30363d;
    background: #0d1117;
    position: sticky;
    top: 0;
    z-index: 1;
}

.slash-layer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #21262d;
    transition: background 0.15s;
}

.slash-layer-item:last-child {
    border-bottom: none;
}

.slash-layer-item:hover,
.slash-layer-item.active {
    background: #21262d;
}

.slash-layer-item .layer-geom-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #58a6ff;
    flex-shrink: 0;
}

.slash-layer-item .layer-pick-name {
    color: #c9d1d9;
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slash-layer-item .layer-pick-info {
    color: #6e7681;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}
