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

:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #3B82F6;
    --accent: #06B6D4;
    --bg: #0F172A;
    --bg-light: #1E293B;
    --surface: rgba(15, 23, 42, 0.85);
    --surface-solid: #1E293B;
    --text: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --success: #10B981;
    --border: rgba(148, 163, 184, 0.2);
    --border-hover: rgba(148, 163, 184, 0.4);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

#map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
}

.navbar {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    z-index: 100;
    min-width: max-content;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    height: 36px;
    width: auto;
}

.logo svg {
    display: block;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--text);
    background: rgba(37, 99, 235, 0.2);
}

.nav-actions {
    display: flex;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.search-panel {
    position: fixed;
    top: 88px;
    left: 16px;
    bottom: 80px;
    width: 400px;
    border-radius: var(--radius-lg);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-header {
    padding: 20px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.search-bar-container {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 44px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.15s ease;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    border-radius: 4px;
}

.search-clear:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.filters-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.filter-row {
    margin-bottom: 12px;
}

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

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    padding: 6px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.filter-chip:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.filter-chip.active {
    background: rgba(37, 99, 235, 0.2);
    border-color: var(--primary);
    color: var(--primary-light);
}

.results-header {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.results-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.jobs-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.jobs-list::-webkit-scrollbar {
    width: 6px;
}

.jobs-list::-webkit-scrollbar-track {
    background: transparent;
}

.jobs-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.jobs-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.job-card {
    padding: 16px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.job-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.job-card.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    border-left-width: 3px;
}

.job-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.company-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.job-card-info {
    flex: 1;
    min-width: 0;
}

.job-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-name {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.job-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.job-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.job-meta-item svg {
    width: 14px;
    height: 14px;
}

.salary {
    color: var(--success) !important;
    font-weight: 500;
}

.job-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.job-tag {
    padding: 4px 10px;
    background: var(--surface);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.job-tag.remote {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.job-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.job-card-actions .btn {
    flex: 1;
    padding: 8px;
    font-size: 0.8rem;
}

.detail-panel {
    position: fixed;
    top: 88px;
    right: 16px;
    bottom: 80px;
    width: 420px;
    border-radius: var(--radius-lg);
    z-index: 100;
    transform: translateX(calc(100% + 32px));
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.detail-panel.open {
    transform: translateX(0);
    opacity: 1;
}

.detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 10;
}

.detail-close:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

.detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.detail-content::-webkit-scrollbar {
    width: 6px;
}

.detail-content::-webkit-scrollbar-track {
    background: transparent;
}

.detail-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.detail-header {
    margin-bottom: 24px;
}

.detail-company {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.detail-company-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.5rem;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.detail-company-name {
    color: var(--text-secondary);
    font-size: 1rem;
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detail-badge svg {
    width: 16px;
    height: 16px;
}

.detail-badge.salary-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.detail-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.detail-list {
    list-style: none;
}

.detail-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.detail-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

.detail-map-preview {
    height: 150px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.detail-map-preview .mini-map {
    width: 100%;
    height: 100%;
}

.detail-location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.detail-actions {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.detail-actions .btn {
    flex: 1;
    padding: 14px;
}

.detail-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.detail-actions .btn-primary:hover {
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.map-controls {
    position: fixed;
    right: 16px;
    bottom: 96px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.map-control-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-solid);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.map-control-btn:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

.stats-bar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 32px;
    padding: 14px 28px;
    border-radius: var(--radius-xl);
    z-index: 100;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-item svg {
    color: var(--primary);
}

.no-results {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 90;
    text-align: center;
}

.no-results-content {
    padding: 40px;
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.no-results-content svg {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.no-results-content h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.no-results-content p {
    color: var(--text-secondary);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

.custom-marker {
    background: none;
    border: none;
}

.marker-pin {
    position: relative;
    width: 36px;
    height: 48px;
}

.marker-pin svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.marker-pin.selected svg .pin-fill {
    fill: var(--accent);
}

.marker-pin.selected .marker-pulse {
    display: block;
}

.marker-pulse {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(6, 182, 212, 0.3);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.cluster-marker {
    background: var(--primary);
    border: 3px solid white;
    border-radius: 50%;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.leaflet-popup-content-wrapper {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.leaflet-popup-content {
    margin: 12px 16px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
}

.leaflet-popup-tip {
    background: var(--surface-solid);
    border: 1px solid var(--border);
}

.popup-content {
    min-width: 200px;
}

.popup-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.popup-company {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.popup-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.popup-salary {
    color: var(--success) !important;
    font-weight: 500;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

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

.autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.autocomplete-item svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.autocomplete-text {
    flex: 1;
}

.autocomplete-main {
    font-size: 0.9rem;
}

.autocomplete-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-bar-container {
    position: relative;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.autocomplete-dropdown.show {
    animation: fadeIn 0.2s ease;
}

@media (max-width: 1024px) {
    .search-panel {
        width: 360px;
    }
    
    .detail-panel {
        width: 380px;
    }
}

@media (max-width: 768px) {
    .navbar {
        left: 16px;
        right: 16px;
        transform: none;
        gap: 16px;
        padding: 10px 16px;
    }
    
    .nav-links {
        display: none;
    }
    
    .nav-actions .btn-ghost {
        display: none;
    }
    
    .search-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 50vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .detail-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 70vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
    }
    
    .detail-panel.open {
        transform: translateY(0);
    }
    
    .stats-bar {
        display: none;
    }
}
