/* Global styles */
.map-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 15px 30px;
}

/* Header styling */
.map-header {
    background: linear-gradient(135deg, #172b4d, #1a237e);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.map-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-title h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 1rem;
}

.live-badge {
    background-color: #4caf50;
    color: white;
    font-size: 0.6rem;
    padding: 4px 8px;
    border-radius: 20px;
    animation: pulse 2s infinite;
    vertical-align: middle;
}

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

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

.view-controls {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.btn-view {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-view:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.btn-view.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.filter-select {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
    min-width: 150px;
    outline: none;
}

.filter-select option {
    background: #172b4d;
    color: white;
}

/* Statistics cards */
.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #2196f3, #1565c0);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #9c27b0, #6a1b9a);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #ff9800, #e65100);
}

.stat-data {
    flex-grow: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #172b4d;
    line-height: 1.1;
}

.stat-label {
    color: #6b778c;
    font-size: 0.9rem;
}

/* Map wrapper */
.map-wrapper {
    position: relative;
    height: 600px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

#product-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Map controls */
.map-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.map-btn {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: none;
    background: white;
    color: #172b4d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-btn:hover {
    background: #f5f5f5;
    color: #1a237e;
}

/* Map legend */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 12px;
    min-width: 180px;
}

.legend-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #172b4d;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #6b778c;
}

.legend-marker {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.marker-cw-paddle {
    background: #20c997;
}

.marker-qrq-keyer {
    background: #fd7e14;
}

.marker-hq {
    background: #f44336;
    border-radius: 50%;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    gap: 15px;
}

.loading-overlay.hidden {
    display: none;
}

.loading-text {
    color: white;
    font-size: 1rem;
}

/* Product detail panel */
.detail-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    width: 300px;
    max-width: calc(100% - 20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(320px);
    opacity: 0;
}

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

.detail-panel.hidden {
    display: none;
}

.detail-header {
    padding: 15px;
    background: #f5f7fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #172b4d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    background: transparent;
    border: none;
    color: #6b778c;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #172b4d;
}

.detail-content {
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
}

/* Product details */
.product-detail {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-detail.active {
    opacity: 1;
}

.product-detail-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #172b4d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.product-detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #6b778c;
}

.detail-value {
    font-weight: 500;
    color: #172b4d;
}

/* Products section */
.products-section {
    margin-bottom: 30px;
}

.products-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #172b4d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.product-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.product-card:nth-child(1) .product-icon {
    background: linear-gradient(135deg, #20c997, #0f9d58);
}

.product-card:nth-child(2) .product-icon {
    background: linear-gradient(135deg, #fd7e14, #e65100);
}

.product-content {
    flex-grow: 1;
}

.product-content h3 {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 10px;
    color: #172b4d;
}

.product-content p {
    color: #6b778c;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.product-btn {
    display: inline-block;
    background: #1a237e;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.product-btn:hover {
    background: #0d1442;
    color: white;
}

/* Footer */
.map-footer {
    text-align: right;
    color: #6b778c;
    font-size: 0.85rem;
    margin-top: 30px;
}

/* Custom map markers */
.map-marker {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    position: relative;
    border: 1.5px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.map-marker:hover {
    transform: scale(1.2);
    z-index: 1000;
}

.marker-paddle {
    background: #9c27b0;
}

.marker-keyer {
    background: #ff9800;
}

.marker-hq {
    width: 20px;
    height: 20px;
    background: #f44336;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.marker-count {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: white;
    color: #172b4d;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Marker highlight */
.marker-highlight {
    transform: scale(1.4);
    z-index: 1000 !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 8px 5px rgba(26, 35, 126, 0.5);
}

/* Popup styles */
.custom-popup {
    min-width: 200px;
}

.popup-header {
    background: #f5f7fa;
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
}

.popup-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #172b4d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-country {
    font-size: 0.8rem;
    color: #6b778c;
    display: block;
    margin-top: 3px;
}

.popup-content {
    padding: 10px 15px;
}

.popup-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.popup-row:last-child {
    border-bottom: none;
}

.popup-label {
    color: #6b778c;
}

.popup-value {
    font-weight: 500;
    color: #172b4d;
}

/* Fullscreen mode */
.fullscreen-active {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: white;
    padding: 0;
    overflow: hidden;
}

.fullscreen-active .map-wrapper {
    height: 100vh;
    border-radius: 0;
    margin: 0;
}

.exit-fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.exit-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Overflow control */
body.overflow-hidden {
    overflow: hidden;
}

/* Responsive styles */
@media (max-width: 1199.98px) {
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991.98px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
    }

    .map-wrapper {
        height: 500px;
    }

    .detail-panel {
        width: 250px;
    }

    .exit-fullscreen-btn span {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .product-cards {
        grid-template-columns: 1fr;
    }

    .map-wrapper {
        height: 400px;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .map-header {
        padding: 15px;
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

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

    .map-legend,
    .detail-panel {
        max-width: calc(100% - 20px);
    }

    .product-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
