/**
 * Insurance Cost Maps - Styles
 * Interactive US maps displaying insurance cost metrics
 * ContractorNerd Brand Styling
 */

/* Import brand fonts */
@import url('https://fonts.googleapis.com/css2?family=Saira+Extra+Condensed:wght@700&family=Poppins:wght@400;500;600;700&family=Inter:wght@400;600;700&display=swap');

#insurance-map-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.map-header {
    text-align: center;
    margin-bottom: 30px;
}

.map-header h2 {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Saira Extra Condensed', sans-serif;
    color: #181815;
}

.metric-toggles {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.metric-btn {
    padding: 10px 20px;
    border: 2px solid #B5B4AE;
    background: white;
    color: #353433;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.3s;
}

.metric-btn:hover {
    background: #F3F3F0;
    color: #353433;
}

.metric-btn.active {
    background: #F0CC4C;
    color: #181815;
    border-color: #F0CC4C;
}

.map-content-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.map-wrapper {
    position: relative;
    background: #F3F3F0;
    border-radius: 12px;
    padding: 20px;
    min-height: 400px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex: 1;
}

#map-svg-container svg {
    width: 100%;
    height: auto;
    display: block;
}

/* State path styles */
.state-path {
    stroke: #fff;
    stroke-width: 0.5;
    cursor: pointer;
    transition: all 0.2s;
    fill: #E3E3DB;
}

.state-path:hover {
    stroke: #353433;
    stroke-width: 1.5;
}

.state-path.selected {
    stroke: #F0CC4C !important;
    stroke-width: 2 !important;
    fill: #FFE898 !important;
}

/* TEAL Heat colors - ContractorNerd brand */
.heat-0 { fill: #D9F0EE; }
.heat-1 { fill: #BFDBDB; }
.heat-2 { fill: #99CFCF; }
.heat-3 { fill: #5B979A; }
.heat-4 { fill: #5B979A; }
.heat-5 { fill: #416E72; }
.heat-6 { fill: #416E72; }
.heat-7 { fill: #416E72; }

.legend-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.legend-label {
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: #8F8D85;
}

.legend-gradient {
    width: 200px;
    height: 20px;
    background: linear-gradient(to right, #D9F0EE, #416E72);
    border-radius: 4px;
    border: 1px solid #B5B4AE;
}

.legend-min, .legend-max {
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    color: #B5B4AE;
}

/* Mobile Dropdown Styles */
.mobile-selector {
    display: none;
    margin-bottom: 30px;
    text-align: center;
}

.mobile-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: #585752;
}

#state-dropdown {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 2px solid #B5B4AE;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    background: white;
    cursor: pointer;
}

.map-subtitle {
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    color: #8F8D85;
    margin: 0;
}

.wc-sub-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: -20px;
    margin-bottom: 20px;
}

.wc-sub-btn {
    padding: 8px 16px;
    border: 2px solid #B5B4AE;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    color: #585752;
}

.wc-sub-btn:hover {
    background: #F3F3F0;
    color: #585752;
    border-color: #8F8D85;
}

.wc-sub-btn.active {
    background: #181815;
    color: white;
    border-color: #181815;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 320px;
    flex-shrink: 0;
    align-self: flex-start;
    text-align: center;
}

.state-name {
    font-size: 24px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: #5B979A;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: #5B979A;
    margin: 10px 0;
}

.metric-description {
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #8F8D85;
    margin: 10px 0 20px 0;
    line-height: 1.5;
}

.cta-link {
    display: inline-block;
    padding: 12px 24px;
    background: #F0CC4C;
    color: #181815;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: background 0.3s ease;
    text-align: center;
    line-height: 1.4;
}

.cta-link:hover {
    background: #E0B004;
    color: #181815;
}

/* Hover tooltip */
.info-box-hover {
    position: absolute;
    background: white;
    border: 1px solid #B5B4AE;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
    z-index: 1000;
    min-width: 200px;
}

.info-box-hover .state-name {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: #181815;
    margin-bottom: 4px;
}

.info-box-hover .metric-label {
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    color: #8F8D85;
    margin-bottom: 2px;
}

.info-box-hover .metric-value {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: #5B979A;
}

/* Hide the source SVG */
#hidden-svg-source {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* SEO Data Table Styles */
details.insurance-data-table-section {
    max-width: 1160px;
    margin: 40px auto 0;
    padding: 0 20px;
}

summary.table-toggle {
    cursor: pointer;
    padding: 15px 20px;
    background: #F3F3F0;
    border: 2px solid #E3E3DB;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #181815;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

summary.table-toggle:hover {
    background: #E3E3DB;
    border-color: #B5B4AE;
}

summary.table-toggle::-webkit-details-marker {
    display: none;
}

.toggle-text {
    font-weight: 600;
}

.toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
    display: inline-block;
}

details[open] .toggle-icon {
    transform: rotate(180deg);
}

.insurance-data-table-wrapper {
    margin-top: 20px;
}

.insurance-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.insurance-data-table th,
.insurance-data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.insurance-data-table th {
    background-color: #416E72;
    color: #FFFFFF;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.insurance-data-table tr:last-child td {
    border-bottom: none;
}

.insurance-data-table tr:nth-child(even) {
    background-color: #F3F3F0;
}

.insurance-data-table tr:hover {
    background-color: #D9F0EE;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .map-header h2 {
        font-size: 24px;
    }

    .metric-toggles {
        gap: 8px;
    }

    .metric-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .map-wrapper {
        display: none;
    }

    .mobile-selector {
        display: block;
    }

    .info-card {
        width: 100%;
        padding: 20px;
    }

    .state-name {
        font-size: 20px;
    }

    .insurance-data-table {
        font-size: 12px;
    }

    .insurance-data-table th,
    .insurance-data-table td {
        padding: 8px 6px;
    }
}
