/**
 * Terranet Map Styles
 */

/* Container */
.tapt2m-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin: 20px 0;
    position: relative;
}

/* Legend Sidebar */
.tapt2m-legend {
    width: 320px;
    flex-shrink: 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    max-height: 600px;
    overflow-y: auto;
}

.tapt2m-legend-title {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-family: Arial, sans-serif;
    font-weight: 600;
    font-size: 18px;
    text-align: center;
    border-bottom: 3px solid #3498db;
    padding-bottom: 8px;
}

/* Legend Items */
.tapt2m-legend-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    gap: 10px;
}

.tapt2m-legend-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tapt2m-legend-item.active {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #3498db;
    font-weight: 600;
}

.tapt2m-show-all {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-weight: 600;
    margin-bottom: 15px;
}

.tapt2m-show-all:hover {
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.5);
}

.tapt2m-show-all .tapt2m-legend-label {
    color: white;
}

.tapt2m-legend-icon {
    font-size: 16px;
}

.tapt2m-legend-svg {
    margin-right: 5px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.tapt2m-legend-label {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
    font-family: Arial, sans-serif;
    flex: 1;
}

.tapt2m-legend-count {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: normal;
}

/* Map Wrapper */
.tapt2m-map-wrapper {
    flex: 1;
    min-width: 0;
}

.tapt2m-map {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Info Window */
.tapt2m-info-window {
    max-width: 300px;
    font-family: Arial, sans-serif;
}

.tapt2m-info-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
}

.tapt2m-info-image {
    margin: 10px 0;
}

.tapt2m-info-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

.tapt2m-info-excerpt {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.tapt2m-info-categories {
    margin: 8px 0;
    font-size: 13px;
    color: #666;
}

.tapt2m-info-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #3498db;
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.tapt2m-info-link:hover {
    background: #2980b9;
}

/* Error Message */
.tapt2m-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-family: Arial, sans-serif;
}

/* Scrollbar Styling for Legend */
.tapt2m-legend::-webkit-scrollbar {
    width: 8px;
}

.tapt2m-legend::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.tapt2m-legend::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.5);
    border-radius: 4px;
}

.tapt2m-legend::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.7);
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .tapt2m-container {
        flex-direction: column;
    }

    .tapt2m-legend {
        width: 100%;
        max-height: 300px;
        order: 2;
    }

    .tapt2m-map-wrapper {
        width: 100%;
        order: 1;
    }

    .tapt2m-map {
        min-height: 400px;
    }
}

@media screen and (max-width: 768px) {
    .tapt2m-legend {
        padding: 15px;
        max-height: 250px;
    }

    .tapt2m-legend-title {
        font-size: 16px;
    }

    .tapt2m-legend-item {
        padding: 8px 10px;
        font-size: 13px;
    }

    .tapt2m-legend-svg {
        width: 16px;
        height: 20px;
    }

    .tapt2m-map {
        min-height: 350px;
    }

    .tapt2m-info-window {
        max-width: 250px;
    }

    .tapt2m-info-title {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .tapt2m-container {
        gap: 15px;
        margin: 15px 0;
    }

    .tapt2m-legend {
        padding: 12px;
        border-radius: 8px;
        max-height: 200px;
    }

    .tapt2m-legend-title {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .tapt2m-legend-item {
        padding: 6px 8px;
        margin-bottom: 6px;
        font-size: 12px;
    }

    .tapt2m-legend-svg {
        width: 14px;
        height: 18px;
    }

    .tapt2m-legend-count {
        font-size: 11px;
    }

    .tapt2m-map {
        min-height: 300px;
        border-radius: 6px;
    }

    .tapt2m-info-window {
        max-width: 200px;
    }

    .tapt2m-info-title {
        font-size: 13px;
    }

    .tapt2m-info-excerpt {
        font-size: 12px;
    }

    .tapt2m-info-link {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .tapt2m-legend {
        display: none;
    }

    .tapt2m-map-wrapper {
        width: 100%;
    }

    .tapt2m-map {
        height: 600px !important;
    }
}
