/* Texas Counties Map - Frontend Styles v1.1.0 */

.tx-counties-map-container {
    position: relative;
    width: 100%;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(43, 62, 80, 0.15);
}

.tx-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px 50px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(43, 62, 80, 0.25);
    z-index: 2000;
    text-align: center;
}

.tx-spinner {
    border: 3px solid #C4C4C4;
    border-top: 3px solid #47B8E0;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tx-loading-text {
    color: #2B3E50;
    font-weight: 500;
    font-size: 14px;
}

.tx-map-wrapper {
    display: flex;
    height: 100%;
    position: relative;
}

.tx-map {
    flex: 1;
    min-width: 0;
}

.tx-sidebar {
    width: 350px;
    background: #2B3E50;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tx-sidebar-header {
    background: linear-gradient(135deg, #2B3E50 0%, #1a2633 100%);
    color: white;
    padding: 24px;
    border-bottom: 3px solid #47B8E0;
}

.tx-sidebar-header h2 {
    font-size: 22px;
    margin: 0 0 8px 0;
    font-weight: 700;
    color: white;
}

.tx-sidebar-header p {
    font-size: 13px;
    opacity: 0.85;
    margin: 0;
    line-height: 1.4;
}

.tx-sidebar-content {
    padding: 24px;
    flex: 1;
    background: white;
}

.tx-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #C4C4C4;
}

.tx-placeholder-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.4;
}

.tx-placeholder p {
    font-size: 14px;
    line-height: 1.6;
    color: #888;
    margin: 0;
}

.tx-county-info {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tx-county-name {
    font-size: 26px;
    font-weight: 700;
    color: #2B3E50;
    margin-bottom: 8px;
    line-height: 1.2;
}

.tx-county-subtitle {
    font-size: 13px;
    color: #C4C4C4;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #47B8E0;
}

/* ── Uninsured Rate Badge ── */

.tx-uninsured-badge {
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: #28a9e0;
    color: #fff;
    text-align: center;
}

.tx-uninsured-rate {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.tx-uninsured-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.92;
}

/* ── Info Items ── */

.tx-info-item {
    margin-bottom: 18px;
}

.tx-info-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #E67E52;
    margin-bottom: 5px;
    letter-spacing: 0.8px;
}

.tx-info-value {
    font-size: 16px;
    color: #2B3E50;
    font-weight: 500;
    line-height: 1.5;
}

.tx-info-value a {
    color: #47B8E0;
    text-decoration: none;
}

.tx-info-value a:hover {
    text-decoration: underline;
}

.tx-pdf-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.tx-pdf-button {
    display: inline-block;
    padding: 12px 20px;
    background: linear-gradient(135deg, #C1554E 0%, #a94842 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(193, 85, 78, 0.3);
}

.tx-pdf-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(193, 85, 78, 0.4);
    color: white;
    text-decoration: none;
}

.tx-pdf-button:active {
    transform: translateY(0);
}

/* ── Hover Tooltip ── */

.tx-map-tooltip {
    display: none;
    position: absolute;
    z-index: 3000;
    background: rgba(43, 62, 80, 0.92);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ── Choropleth Legend (horizontal, in sidebar header) ── */

.tx-legend-horizontal {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.tx-legend-horizontal .tx-legend-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.tx-legend-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.tx-legend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tx-legend-swatch {
    display: block;
    width: 28px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tx-legend-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

/* ── Responsive Design ── */

@media (max-width: 968px) {
    .tx-map-wrapper {
        flex-direction: column;
    }

    .tx-map {
        height: 400px;
        order: 2;
    }

    .tx-sidebar {
        width: 100%;
        order: 1;
        max-height: 400px;
    }

}

@media (max-width: 640px) {
    .tx-county-name {
        font-size: 22px;
    }

    .tx-sidebar {
        max-height: 350px;
    }

    .tx-map {
        height: 350px;
    }

    .tx-sidebar-header h2 {
        font-size: 18px;
    }

    .tx-uninsured-rate {
        font-size: 26px;
    }

}
