/* Network Page Styles */

/* Network Container - Flexbox Layout */
.network-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Network Header Map - 100% Width, Fixed Height */
.network-header-map {
    position: relative;
    height: 60vh;
    min-height: 500px;
    max-height: 600px;
    overflow: hidden;
    background: #0a0a0a;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Override header-image-bg height for network map - no parallax */
.network-header-map .header-image-bg,
#network-map {
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background: #0a0a0a;
    min-height: 500px;
    transform: none !important;
    will-change: auto !important;
}

#network-map .leaflet-container {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    background: #0a0a0a;
}

/* Hide Leaflet attribution */
#network-map .leaflet-control-attribution {
    display: none !important;
}

/* Leaflet zoom controls - top right */
#network-map .leaflet-control-zoom {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

#network-map .leaflet-control-zoom a {
    background-color: rgba(10, 10, 10, 0.8);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.2s ease;
}

#network-map .leaflet-control-zoom a span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: bold;
}

#network-map .leaflet-control-zoom a:hover {
    background-color: rgba(81, 172, 50, 0.8);
    border-color: #51ac32;
}

#network-map .leaflet-control-zoom-in {
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

#network-map .leaflet-control-zoom-out {
    border-radius: 0 0 4px 4px;
}

/* Leaflet marker cluster styles - all light green */
.marker-cluster-small {
    background-color: rgba(81, 172, 50, 0.6);
    border: 3px solid rgba(81, 172, 50, 0.8);
}

.marker-cluster-medium {
    background-color: rgba(81, 172, 50, 0.7);
    border: 3px solid rgba(81, 172, 50, 0.9);
}

.marker-cluster-large {
    background-color: rgba(81, 172, 50, 0.8);
    border: 3px solid rgba(81, 172, 50, 1);
}

.marker-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-cluster div {
    background-color: transparent;
    color: #fff;
    font-weight: bold !important;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    line-height: 1;
    text-align: center;
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
}

/* Ensure all text inside clusters is bold - override Leaflet defaults */
.marker-cluster div,
.marker-cluster div span,
.marker-cluster div *,
.leaflet-marker-icon.marker-cluster div,
.leaflet-marker-icon.marker-cluster div span,
.leaflet-marker-icon.marker-cluster div * {
    font-weight: bold !important;
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif !important;
}

/* Override Leaflet marker cluster default styles */
.leaflet-marker-icon.marker-cluster {
    font-weight: bold !important;
}

.leaflet-marker-icon.marker-cluster div {
    font-weight: bold !important;
}

/* Country markers */
.country-marker {
    cursor: pointer;
}

.country-marker div {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #51ac32;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Group markers */
.group-marker {
    cursor: pointer;
}

.group-marker div {
    border-radius: 50%;
    background-color: #51ac32;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.group-marker.zoom-large div {
    width: 12px;
    height: 12px;
}

.group-marker.zoom-small div {
    width: 10px;
    height: 10px;
}

/* User markers */
.user-marker {
    cursor: pointer;
}

.user-marker div {
    border-radius: 50%;
    background-color: #51ac32;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.user-marker.zoom-large div {
    width: 10px;
    height: 10px;
}

.user-marker.zoom-small div {
    width: 8px;
    height: 8px;
}

/* Map popup styles */
.leaflet-popup-content-wrapper {
    background: #1a1a1a;
    color: #fff;
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 0;
    padding: 0;
}

/* Popup arrow - match dark background */
.leaflet-popup-tip {
    background: #1a1a1a;
}

.leaflet-popup-tip-container {
    margin-top: -1px;
}

/* Override all links in popups to use Simuze green */
.leaflet-popup-content-wrapper a,
.leaflet-popup-content a,
.map-popup-content a {
    color: #51ac32 !important;
    text-decoration: none !important;
}

.leaflet-popup-content-wrapper a:hover,
.leaflet-popup-content a:hover,
.map-popup-content a:hover {
    color: #51ac32 !important;
    text-decoration: none !important;
    opacity: 0.8;
}

.map-popup-content {
    text-align: left;
    padding: 8px;
    min-width: 150px;
}

.map-popup-title {
    color: #51ac32;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.map-popup-title.country {
    color: #51ac32;
}

.map-popup-title.group {
    color: #51ac32;
}

.map-popup-title.user {
    color: #51ac32;
}

.map-popup-subtitle {
    color: #999;
    font-size: 11px;
    text-transform: capitalize;
    margin: 0 0 4px 0;
}

.map-popup-location {
    color: #ccc;
    font-size: 12px;
    margin: 4px 0;
}

.map-popup-link {
    color: #51ac32 !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
    margin-top: 8px;
}

.map-popup-link:hover {
    color: #51ac32 !important;
    text-decoration: none !important;
    opacity: 0.8;
}

.map-popup-center {
    text-align: center;
    padding: 5px;
}

.map-popup-center .map-popup-title {
    text-align: center;
}

.map-error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    text-align: center;
    padding: 20px;
    background: #0a0a0a;
}

/* Network header text overlay - bottom-left with gradient */
.network-header-map::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}
.network-header-map .header-text {
    display: block;
    position: absolute;
    bottom: 0; left: 0;
    z-index: 3;
    padding: 1.5rem 2rem 1.75rem;
    color: #fff;
}
.network-header-map .header-text h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,.6);
}
.network-header-map .header-text .location-meta {
    font-size: .9rem;
    color: rgba(255,255,255,.65);
    margin-top: .25rem;
}

/* Create Group Button */
.create-group-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--color-accent, #51ac32);
    color: #0a0a0a !important;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: none;
    font-size: 14px;
    line-height: 1.4;
}

.create-group-btn,
.create-group-btn *,
.create-group-btn i,
.create-group-btn svg,
.create-group-btn .icon {
    color: #0a0a0a !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
}

.create-group-btn:hover {
    background: var(--color-accent-hover, #45a028);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    color: #ffffff !important;
}

.create-group-btn:hover *,
.create-group-btn:hover i,
.create-group-btn:hover svg,
.create-group-btn:hover .icon {
    color: #ffffff !important;
}

/* Network Lists */
.network-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.network-item {
    margin-bottom: 12px;
}

.network-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-text, #fff);
    transition: opacity 0.2s ease;
}

.network-item a:hover {
    opacity: 0.8;
}

.network-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    flex-shrink: 0;
}

/* User avatars - always round */
.network-user-avatar {
    border-radius: 50% !important;
}

/* Group avatars - square with rounded corners */
.network-group-avatar {
    border-radius: 8px !important;
}

/* Location group icons: country (flag), province/city (map) – same size as avatar */
.network-location-icon-wrap {
    display: inline-block;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    vertical-align: middle;
}

/* Country: black background + 50% transparent flag so it blends with Simuze */
.network-location-icon-wrap--country {
    background: #000000 !important;
}

.network-location-icon-wrap--country .network-location-icon--country,
img.network-location-icon--country {
    opacity: 0.5 !important;
    object-fit: cover;
    object-position: center;
}

/* Province/city: map thumbnail in Simuze dark style (stored pre-darkened in uploads) */
.network-location-icon--province,
.network-location-icon--city {
    object-fit: cover;
    object-position: center;
}

.network-name {
    font-weight: 500;
}

/* Homepage Latest groups section */
.homepage-network-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 20px 0;
    padding: 0;
}
.homepage-network-header h3 {
    font-size: clamp(1.75rem, 2vw, 2.25rem);
    font-weight: 600;
    color: var(--color-text, #fff);
    margin: 0;
    padding: 0;
}

.view-all-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--color-accent, #51ac32);
    text-decoration: none;
    font-size: 0.9em;
}

.view-all-link:hover {
    text-decoration: underline;
}

#network_join .button {
    margin-top: 15px;
}

/* Network Location Filter Panel - Overlay on Map */
.network-location-filter {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    pointer-events: none;
}

.network-filters-inner {
    pointer-events: auto;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px 20px;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Search Box */
.network-search-box {
    margin-bottom: 20px;
}

.network-search-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.network-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.network-search-input:focus {
    outline: none;
    border-color: #51ac32;
    background: rgba(255, 255, 255, 0.08);
}

.network-type-filters {
    border: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.network-type-filters legend {
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 8px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
    width: 100%;
}

.network-type-filters label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: transparent;
    transition: all 0.2s ease;
    user-select: none;
    min-width: auto;
    text-align: center;
}

.network-type-filters label:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

/* Hide the actual checkbox visually but keep it accessible */
.network-type-filters input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Active state (checked) - filled button with active color */
.network-type-filters input[type="checkbox"]:checked + span,
.network-type-filters label:has(input[type="checkbox"]:checked) {
    background: #51ac32;
    border-color: #51ac32;
    color: #ffffff;
    font-weight: 600;
}/* For browsers that support :has() */
.network-type-filters label:has(input[type="checkbox"]:checked) {
    background: #51ac32;
    border-color: #51ac32;
    color: #ffffff;
    font-weight: 600;
}

.network-location-filter.filtering .network-filters-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.3);
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
}


/* Network Filtered Results Section - Below Map, Flexbox */
.network-filtered-results {
    width: 100%;
    background: #0a0a0a;
    padding: 40px 20px;
    min-height: 200px;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.network-filtered-results.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 60px 20px;
}

.network-filtered-results.empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 60px 20px;
}

.network-results-grid {
    max-width: var(--container-max-width, 1440px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.network-results-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
}

.network-results-section h3 {
    color: #51ac32;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    text-transform: capitalize;
}

/* Responsive Design */
@media (max-width: 768px) {
    .network-location-filter {
        top: 10px;
        left: 10px;
    }
    
    .network-filters-inner {
        padding: 12px 16px;
        max-width: calc(100vw - 40px);
    }
    
    .network-type-filters {
        gap: 10px 16px;
    }
    
    .network-type-filters label {
        font-size: 0.7rem;
        padding: 4px 8px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .network-location-filter {
        top: 5px;
        left: 5px;
    }
    
    .network-filters-inner {
        padding: 10px 12px;
        max-width: calc(100vw - 20px);
    }
    
    .network-type-filters {
        gap: 8px 12px;
    }
    
    .network-type-filters legend {
        font-size: 0.85rem;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .network-type-filters label {
        font-size: 0.65rem;
        padding: 3px 6px;
        min-width: auto;
    }
}