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

.explore-container {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: calc(260px + 20px);
    padding-right: 20px;
    min-height: 100vh;
}

.explore-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.search-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 8px 20px;
    width: 70%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.search-box i {
    color: #667eea;
    margin-right: 10px;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 10px;
    font-size: 16px;
    outline: none;
    background: transparent;
    z-index: 2;
}

.search-box button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.search-box button:hover {
    background: #5a67d8;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 5px;
}

.suggestion-item {
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #f7fafc;
}

.suggestion-item h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3748;
    margin-bottom: 5px;
}

.suggestion-company .company-code {
    color: #718096;
    font-size: 13px;
    margin-bottom: 5px;
}

.suggestion-item .company-distance {
    color: #48bb78;
    font-size: 12px;
    font-weight: 600;
}

.user-location {
    display: flex;
    align-items: center;
    font-size: 14px;
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
}

.user-location i {
    margin-right: 8px;
}

.main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.explore-filters {
    width: 300px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.category-filter {
    margin-bottom: 25px;
}

.category-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
    color: #4a5568;
    font-size: 16px;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.category-toggle span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-toggle i.bx-chevron-down {
    transition: transform 0.2s ease;
    display: none;
}

.category-filter.open .category-toggle i.bx-chevron-down {
    transform: rotate(180deg);
}

.category-options {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.category-filter.open .category-options {
    display: flex;
}

.category-option {
    display: block;
    cursor: pointer;
    position: relative;
}

.category-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.category-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #fff;
    color: #4a5568;
    font-weight: 600;
    transition: all 0.2s ease;
}

.category-pill i {
    font-size: 1.2rem;
    color: #94a3b8;
}

.category-option input:checked + .category-pill {
    background: #4361ee;
    border-color: #4361ee;
    color: #fff;
    box-shadow: 0 6px 14px rgba(67, 97, 238, 0.18);
}

.category-option input:checked + .category-pill i {
    color: #fff;
}

.category-pill:hover {
    border-color: #4361ee;
}

.map-area {
    flex: 1;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    height: 400px;
    min-height: 260px;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    min-height: 260px;
}

.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.map-controls button {
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    transition: all 0.3s;
}

.map-controls button:hover {
    background: #667eea;
    color: white;
}

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

.marker-icon {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    color: #4361ee;
    border: 2px solid #4361ee;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(67, 97, 238, 0.2);
}

.marker-icon i {
    font-size: 20px;
}

.marker-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    min-width: 22px;
    text-align: center;
}

.user-marker-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #111827;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(17, 24, 39, 0.25);
}

.map-popup h3 {
    margin-bottom: 6px;
    color: #1f2937;
}

.map-popup p {
    margin: 4px 0;
    font-size: 13px;
    color: #4b5563;
}

.map-popup .popup-btn {
    margin-top: 8px;
    background: #4361ee;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.companies-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

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

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4a5568;
}

.sort-options select {
    padding: 8px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

#companies-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.company-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e2e8f0;
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.company-card-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.company-logo-container {
    position: relative;
    width: 50px;
    height: 50px;
    min-width: 50px;
    margin-right: 15px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo-container .company-initials {
    font-size: 18px;
    font-weight: 600;
    color: white;
    z-index: 1;
    position: relative;
}

.company-logo-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    display: none;
}

.company-info {
    flex: 1;
}

.company-info h3 {
    margin-bottom: 5px;
    color: #2d3748;
}

.company-code {
    color: #718096;
    font-size: 14px;
    margin-bottom: 5px;
}

.company-category-text {
    color: #667eea;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.company-distance {
    background: #f7fafc;
    padding: 8px 12px;
    border-radius: 8px;
    color: #4a5568;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.company-card-body {
    margin-bottom: 15px;
}

.company-bio {
    color: #718096;
    font-size: 14px;
    line-height: 1.5;
}

.company-card-footer {
    display: flex;
    justify-content: flex-end;
}

.directions-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.directions-btn:hover {
    background: #38a169;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #718096;
    display: none;
}

.loading i {
    margin-right: 8px;
}

@media (max-width: 1200px) {
    .explore-container {
        padding-left: 20px;
    }
}

@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }

    .explore-filters {
        width: 100%;
    }

    .search-container {
        flex-direction: column;
        gap: 15px;
    }

    .search-box {
        width: 100%;
    }

    .user-location {
        width: 100%;
        justify-content: center;
    }

    #companies-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .explore-container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .category-toggle i.bx-chevron-down {
        display: inline-block;
    }

    .category-filter {
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px;
    }

    .category-filter.open {
        background: #f8fafc;
    }
}

html[data-theme='dark'] body {
    background: #020617;
    color: #e2e8f0;
}

html[data-theme='dark'] .search-box {
    background: #0f172a;
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.35);
}

html[data-theme='dark'] .search-box i {
    color: #93c5fd;
}

html[data-theme='dark'] .search-box input {
    color: #e2e8f0;
}

html[data-theme='dark'] .search-box input::placeholder {
    color: #94a3b8;
}

html[data-theme='dark'] .suggestions-dropdown {
    background: #0f172a;
    border: 1px solid #334155;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.45);
}

html[data-theme='dark'] .suggestion-item {
    border-bottom-color: #334155;
}

html[data-theme='dark'] .suggestion-item:hover {
    background: rgba(59, 130, 246, 0.16);
}

html[data-theme='dark'] .suggestion-item h4 {
    color: #e2e8f0;
}

html[data-theme='dark'] .suggestion-company .company-code {
    color: #94a3b8;
}

html[data-theme='dark'] .user-location {
    background: rgba(15, 23, 42, 0.5);
}

html[data-theme='dark'] .explore-filters {
    background: #0f172a;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
    border: 1px solid #334155;
}

html[data-theme='dark'] .category-toggle {
    color: #e2e8f0;
}

html[data-theme='dark'] .category-pill {
    border-color: #334155;
    background: #111827;
    color: #cbd5e1;
}

html[data-theme='dark'] .category-pill i {
    color: #94a3b8;
}

html[data-theme='dark'] .category-pill:hover {
    border-color: #60a5fa;
}

html[data-theme='dark'] .map-controls button {
    background: #0f172a;
    color: #e2e8f0;
    box-shadow: 0 10px 20px rgba(2, 6, 23, 0.35);
    border: 1px solid #334155;
}

html[data-theme='dark'] .map-controls button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}

html[data-theme='dark'] .marker-icon {
    background: #0f172a;
    color: #93c5fd;
    border-color: #3b82f6;
}

html[data-theme='dark'] .marker-count {
    border-color: #0f172a;
}

html[data-theme='dark'] .user-marker-icon {
    background: #2563eb;
}

html[data-theme='dark'] .map-popup h3 {
    color: #e2e8f0;
}

html[data-theme='dark'] .map-popup p {
    color: #cbd5e1;
}

html[data-theme='dark'] .leaflet-popup-content-wrapper,
html[data-theme='dark'] .leaflet-popup-tip {
    background: #111827;
    color: #e2e8f0;
}

html[data-theme='dark'] .companies-section {
    background: #0f172a;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
    border: 1px solid #334155;
}

html[data-theme='dark'] .section-header h2 {
    color: #f1f5f9;
}

html[data-theme='dark'] .sort-options select {
    border-color: #334155;
    background: #111827;
    color: #e2e8f0;
}

html[data-theme='dark'] .company-card {
    background: #111827;
    border-color: #334155;
    box-shadow: 0 8px 22px rgba(2, 6, 23, 0.3);
}

html[data-theme='dark'] .company-card:hover {
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.45);
}

html[data-theme='dark'] .company-info h3 {
    color: #f1f5f9;
}

html[data-theme='dark'] .company-code {
    color: #94a3b8;
}

html[data-theme='dark'] .company-distance {
    background: #0f172a;
    color: #cbd5e1;
}

html[data-theme='dark'] .company-bio {
    color: #94a3b8;
}

html[data-theme='dark'] .loading {
    color: #94a3b8;
}

@media (max-width: 768px) {
    html[data-theme='dark'] .category-filter {
        border-color: #334155;
    }

    html[data-theme='dark'] .category-filter.open {
        background: #111827;
    }
}
