@font-face {
    font-family: 'ClashGrotesk';
    src: url('Font/ClashGrotesk-Bold.otf') format('opentype');
    font-weight: 700;
}

@font-face {
    font-family: 'ClashGrotesk';
    src: url('Font/ClashGrotesk-Regular.otf') format('opentype');
    font-weight: 400;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'ClashGrotesk', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.app-header {
    padding: 10px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

h1 {
    text-align: center;
    font-size: 1.4em;
    font-family: 'ClashGrotesk', sans-serif;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.header-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

#search-input,
#country-filter {
    padding: 8px 18px;
    font-size: 1em;
    border: 2px solid #ccc;
    border-radius: 25px;
    background-color: white;
    font-family: 'ClashGrotesk', sans-serif;
    min-width: 200px;
    transition: border-color 0.3s;
}

#search-input:focus,
#country-filter:focus {
    outline: none;
    border-color: #007bff;
}

#country-filter { cursor: pointer; }

/* App Body */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Side Panel */
.side-panel {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: width 0.3s ease;
}

.side-panel.collapsed { width: 28px; }

.panel-header,
.lab-list {
    transition: opacity 0.2s ease;
}

.side-panel.collapsed .panel-header,
.side-panel.collapsed .lab-list {
    opacity: 0;
    pointer-events: none;
}

.panel-toggle {
    position: absolute;
    top: 50%;
    right: -14px;
    transform: translateY(-50%);
    width: 28px;
    height: 48px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 1.2em;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: color 0.2s;
}

.panel-toggle:hover { color: #000; }
.side-panel.collapsed .panel-toggle { transform: translateY(-50%) rotate(180deg); }

.panel-header {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.results-count {
    font-size: 0.85em;
    color: #888;
}

.lab-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.lab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.lab-item:hover { background: #f9f9f9; }

.lab-item.active {
    border-left: 4px solid currentColor;
    background: #f5f8ff;
}

.lab-item-img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.lab-item-img-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: #e8e8e8;
    flex-shrink: 0;
}

.lab-item-info { min-width: 0; }

.lab-item-name {
    font-weight: 700;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lab-item-location {
    font-size: 0.78em;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Map */
#map {
    flex: 1;
    background-color: #ffffe0;
}

/* Leaflet popup */
.leaflet-popup-content {
    font-family: 'ClashGrotesk', sans-serif;
    text-align: center;
}

.leaflet-popup-content img {
    border-radius: 8px;
    margin-bottom: 8px;
}

.leaflet-popup-content h3 {
    margin: 5px 0;
    color: #007bff;
    transition: color 0.3s;
    cursor: pointer;
}

.leaflet-popup-content h3:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Custom Markers */
.custom-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    transition: transform 0.2s;
    cursor: pointer;
}

/* Modal Overlay */
.modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

/* Modal Container */
.modal {
    background-color: white;
    border-radius: 15px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-overlay.active .modal { transform: scale(1); }

/* Modal Close */
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover { color: #000; }

/* Modal Content */
.modal-content {
    font-family: 'ClashGrotesk', sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

.modal-content h2 {
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 20px;
}

.modal-content p { margin: 10px 0; }
.modal-content strong { color: #555; }

/* Social Media Icons */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #333;
    font-size: 1.3em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.social-link.instagram:hover { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: white; }
.social-link.facebook:hover { background-color: #1877f2; color: white; }
.social-link.twitter:hover { background-color: #000; color: white; }
.social-link.spotify:hover { background-color: #1db954; color: white; }
.social-link.linkedin:hover { background-color: #0a66c2; color: white; }
.social-link.tiktok:hover { background-color: #000; color: white; }
.social-link.twitch:hover { background-color: #9146ff; color: white; }
.social-link.youtube:hover { background-color: #ff0000; color: white; }
.social-link.flickr:hover { background-color: #0063dc; color: white; }
.social-link.website:hover { background-color: #007bff; color: white; }

/* Representative Section */
.representative-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.representative-section h3 {
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    body { overflow: auto; }
    h1 { font-size: 1.1em; }

    .header-controls { flex-direction: column; align-items: stretch; }

    #search-input,
    #country-filter { min-width: unset; width: 100%; }

    .side-panel { display: none; }
    .app-body { flex-direction: column; }

    #map {
        height: calc(100vh - 160px);
        flex: none;
    }

    /* Bottom Sheet */
    .modal-overlay { align-items: flex-end; }

    .modal {
        border-radius: 20px 20px 0 0;
        width: 100%;
        max-width: 100%;
        max-height: 80vh;
        transform: translateY(100%);
        padding: 20px;
        margin: 0;
    }

    .modal-overlay.active .modal { transform: translateY(0); }

    .modal::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
        margin: 0 auto 15px;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 0.95em; }
    #map { height: calc(100vh - 185px); }
}
