/* State-wise Data Page Styles */

.state-wise-main {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

/* Top search bar used between the selector strip and the main district view */
.state-selector-bar .state-wise-search-section {
    margin-bottom: 0;
}

.state-selector-bar .state-wise-search-section .search-split {
    margin: 0 auto;
}

/* Hide Data Table Section */
.data-table-section {
    display: none !important;
}

/* Map Section */
.map-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

/* State-wise map share strip — same controls as dataset-share.js / category cards */
.map-share-wrap {
    /* margin: 0 0 20px; */
    padding: 16px 18px;
    /* border: 1px solid var(--border-color); */
    border-radius: 8px;
    /* background: var(--bg-white); */
    /* box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); */
}
.map-share-wrap-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.map-share-wrap .map-share-header,
.map-share-wrap .dataset-header {
    flex: 1;
    min-width: 200px;
    margin: 0;
    padding-right: 8px;
}
.map-share-wrap .map-share-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
}
.map-share-wrap .dataset-description,
.map-share-wrap .map-share-desc {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.45;
    max-width: 52ch;
}
.map-share-wrap .dataset-share {
    position: static;
    top: auto;
    right: auto;
    flex-shrink: 0;
    align-self: center;
}
@media (max-width: 640px) {
    .map-share-wrap-inner {
        flex-direction: column;
    }
    .map-share-wrap .dataset-share {
        align-self: flex-start;
    }
}

.state-wise-main .related-posts-section {
    margin: 0 0 30px;
    padding-top: 8px;
}

.state-wise-main .related-posts-section .section-title {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin: 0 0 24px;
}

.state-wise-main .related-posts-section .landing-card-link {
    text-decoration: none;
}

.state-wise-main .related-posts-section .card-content h3 {
    font-size: 17px;
    line-height: 1.35;
}

/* Map Layout Container - 2 Column Layout */
.map-layout-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
    min-height: 0;
}

/* Left Column: Map (70%) - fills available space */
.map-column {
    flex: 1 1 70%;
    min-width: 0;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.map-column .map-container1,
.map-column .map-container {
    flex: 1;
    min-height: 400px;
}

/* Right Column: Results Panel (30%) - fixed width, scrollable panel */
.results-column {
    flex: 0 0 30%;
    width: 30%;
    max-width: 380px;
    min-width: 0;
    /* max-height: calc(100vh - 120px); */
    display: flex;
    flex-direction: column;
}

.results-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    position: sticky;
    top: 20px;
    flex: 1 1 auto;
    min-height: 200px;
    /* max-height: calc(100vh - 120px); */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

.results-header {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-header i {
    color: #3b82f6;
}

.state-results-content {
    min-height: 200px;
}

.no-selection {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.no-selection i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 15px;
    display: block;
}

.no-selection p {
    font-size: 14px;
    margin: 0;
}

.no-selection p.no-data-hint {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 10px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.no-selection p.no-data-hint a {
    color: #3b82f6;
}

table .no-data-row td {
    text-align: center;
    color: #6b7280;
    padding: 24px 16px;
    font-size: 14px;
}

/* State Details Display */
.state-details {
    animation: fadeIn 0.3s ease-in;
}

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

.state-details-header {
    position: relative;
    background: #ffffff;
    color: #111827;
    padding: 16px 54px 16px 78px;
    border-radius: 16px;
    margin-bottom: 16px;
    text-align: left;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

.state-details-header::before,
.state-details-header::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
.state-details-header::after{
    display: none;
}

.state-details-header::before {
    content: "\f201";
    left: 16px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    color: #1e40af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.state-details-header::after {
    content: "\f061";
    right: 18px;
    color: #9ca3af;
    font-size: 16px;
}

.state-details-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.state-details-header .data-type {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
    display: block;
}

.state-details-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-item {
    background: white;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
}

.detail-item-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 600;
}

.detail-item-value {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.detail-item-value.currency {
    color: #059669;
}

.detail-item-value.percentage {
    color: #3b82f6;
}

.detail-item-value.negative {
    color: #dc2626;
}

/* Year-wise Data Table */
.year-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}

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

.year-data-table th {
    /* background: #f3f4f6; */
    font-weight: 600;
    color: #374151;
    font-size: 11px;
    text-transform: uppercase;
}

.year-data-table td {
    color: #1f2937;
}

.year-data-table tr:hover {
    background: #f9fafb;
}

/* Current value highlight with growth */
.current-value-highlight .detail-item-value {
    font-size: 20px;
}
.current-value-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.current-value-growth {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}
.current-value-growth.positive {
    color: #059669;
    background: #d1fae5;
}
.current-value-growth.negative {
    color: #dc2626;
    background: #fee2e2;
}

/* Quick Stats */
.quick-stats-block .detail-item-label {
    margin-bottom: 10px;
}
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.quick-stat-item {
    background: #f3f4f6;
    padding: 10px 12px;
    border-radius: 6px;
    text-align: center;
}
.quick-stat-label {
    display: block;
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.quick-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}
.quick-stat-value.positive {
    color: #059669;
}
.quick-stat-value.negative {
    color: #dc2626;
}

/* Top Producing States */
.top-producing-block .detail-item-label {
    margin-bottom: 10px;
}
.top-producing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}
.top-producing-table th,
.top-producing-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.top-producing-table th {
    /* background: #f3f4f6; */
    font-weight: 600;
    color: #374151;
    font-size: 11px;
    text-transform: uppercase;
}
.top-producing-table td {
    color: #1f2937;
}
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}
.rank-badge.rank-1 { background: var(--rank-badge-1-bg, #0066cc); color: var(--rank-badge-1-fg, #ffffff); }
.rank-badge.rank-2 { background: var(--rank-badge-2-bg, #3399ff); color: var(--rank-badge-2-fg, #ffffff); }
.rank-badge.rank-3 { background: var(--rank-badge-3-bg, #66ccff); color: var(--rank-badge-3-fg, #0f172a); }
.rank-badge.rank-4 { background: var(--rank-badge-4-bg, #99ddff); color: var(--rank-badge-4-fg, #0f172a); }

/* Production Trend Chart */
.trend-chart-block .detail-item-label {
    margin-bottom: 10px;
}
.trend-chart-container {
    position: relative;
    width: 100%;
    /* min-height: 180px; */
    margin-top: 8px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .map-layout-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .map-column,
    .results-column {
        flex: 0 0 100%;
        width: 100%;
        max-width: none;
        max-height: none;
    }
    
    .results-panel {
        position: relative;
        top: 0;
        max-height: none;
    }
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.map-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-toggle {
    display: flex;
    gap: 0;
    background: #e5e7eb;
    border-radius: 25px;
    padding: 4px;
}

.view-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 600;
    font-size: 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn.active {
    background: #3b82f6;
    color: white;
}

.view-btn:hover:not(.active) {
    background: #d1d5db;
    color: #374151;
}

/* Gradient Legend */
.gradient-legend {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.legend-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.gradient-bar {
    width: 100%;
    height: 20px;
    background: linear-gradient(to right, #ff6b35, #f7931e, #ffd23f, #4ecdc4, #44a5ff, #0066cc);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.gradient-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #ff6b35 0%, #f7931e 20%, #ffd23f 40%, #4ecdc4 60%, #44a5ff 80%, #0066cc 100%);
    border-radius: 10px;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.map-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-white);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.legend-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-color);
    padding: 5px;
    border-radius: 5px;
    transition: background 0.3s;
}

.legend-item:hover {
    background: var(--bg-light);
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.map-container,
.map-container1 {
    position: relative;
    width: 100%;
    /* height: 700px; */
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
    border-radius: 12px;
    overflow: hidden;
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 15px;
}

/* Watermark overlay in map section (logo-dark.svg) – responsive on all screens */
.map-watermark {
    position: absolute;
    top: 20%;
    right: 25%;
    left: auto;
    top: auto;
    z-index: 5;
    pointer-events: none;
    opacity: 1;
    max-width: 28%;
}
.map-watermark img {
    width: 100%;
    max-width: 120px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    display: block;
}
@media (min-width: 1200px) {
    .map-watermark {
        top: 20%;
    right: 25%;
        max-width: 22%;
    }
    .map-watermark img {
        max-width: 120px;
        max-height: 80px;
    }
}
@media (max-width: 991px) {
    .map-watermark {
        bottom: 2%;
        right: 2%;
        max-width: 28%;
    }
    .map-watermark img {
        max-width: 100px;
        max-height: 65px;
    }
}
@media (max-width: 768px) {
    .map-watermark {
        bottom: 1.5%;
        right: 1.5%;
        max-width: 32%;
    }
    .map-watermark img {
        max-width: 90px;
        max-height: 55px;
    }
}
@media (max-width: 480px) {
    .map-watermark {
        bottom: 1%;
        right: 1%;
        max-width: 38%;
    }
    .map-watermark img {
        max-width: 70px;
        max-height: 45px;
    }
}
@media (max-width: 360px) {
    .map-watermark {
        bottom: 1%;
        right: 1%;
        max-width: 42%;
    }
    .map-watermark img {
        max-width: 55px;
        max-height: 36px;
    }
}

/* Watermark on Tamil Nadu district map – left side, top (same logo, class map-watermark-district) */
.map-watermark-district {
    position: absolute;
    top: 2%;
    left: 2%;
    right: auto;
    bottom: auto;
    z-index: 5;
    pointer-events: none;
    opacity: 1;
    max-width: 28%;
}
.map-watermark-district img {
    width: 100%;
    max-width: 120px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    display: block;
}
@media (min-width: 1200px) {
    .map-watermark-district {
        top: 2%;
        left: 2%;
        max-width: 22%;
    }
    .map-watermark-district img {
        max-width: 120px;
        max-height: 80px;
    }
}
@media (max-width: 991px) {
    .map-watermark-district {
        top: 2%;
        left: 2%;
        max-width: 28%;
    }
    .map-watermark-district img {
        max-width: 100px;
        max-height: 65px;
    }
}
@media (max-width: 768px) {
    .map-watermark-district {
        top: 1.5%;
        left: 1.5%;
        max-width: 32%;
    }
    .map-watermark-district img {
        max-width: 90px;
        max-height: 55px;
    }
}
@media (max-width: 480px) {
    .map-watermark-district {
        top: 1%;
        left: 1%;
        max-width: 38%;
    }
    .map-watermark-district img {
        max-width: 70px;
        max-height: 45px;
    }
}
@media (max-width: 360px) {
    .map-watermark-district {
        top: 1%;
        left: 1%;
        max-width: 42%;
    }
    .map-watermark-district img {
        max-width: 55px;
        max-height: 36px;
    }
}

.map-container1 #indiaMap,
.map-container #indiaMap {
    width: 100%;
    height: 100%;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-container1 #indiaMap svg,
.map-container #indiaMap svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.india-map {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
}

.india-map svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.india-map path {
    fill: #e6f3ff;
    stroke: #ffffff;
    stroke-width: 2;
    cursor: pointer;
    transition: all 0.3s ease;
    vector-effect: non-scaling-stroke;
}

.india-map path:hover {
    stroke-width: 4;
    stroke: var(--primary-color);
    filter: brightness(1.3) drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    z-index: 10;
    transform: scale(1.02);
    transform-origin: center;
}

.india-map path.selected {
    stroke-width: 4;
    stroke: var(--accent-color);
    filter: brightness(1.2);
}

.india-map path.high-value {
    fill: #0066cc;
    stroke: #004499;
}

.india-map path.medium-high-value {
    fill: #3399ff;
    stroke: #0066cc;
}

.india-map path.medium-value {
    fill: #66ccff;
    stroke: #3399ff;
}

.india-map path.low-value {
    fill: #99ddff;
    stroke: #66ccff;
}

.india-map path.very-low-value {
    fill: #e6f3ff;
    stroke: #99ddff;
}

.india-map path.no-data {
    fill: #cccccc;
    stroke: #999999;
    opacity: 0.6;
}

/* State Name and Value Labels */
.india-map .state-name-label,
.map-container1 .state-name-label {
    font-size: 10px;
    font-weight: 700;
    fill: #1f2937;
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: middle;
}

.india-map .state-value-label,
.map-container1 .state-value-label {
    font-size: 14px;
    font-weight: 600;
    fill: #333;
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: middle;
}

/* Style labels on hover */
.india-map path:hover ~ .state-name-label,
.map-container1 path:hover ~ .state-name-label {
    font-size: 12px;
    font-weight: 700;
    fill: #1e3a8a;
}

.india-map path:hover ~ .state-value-label,
.map-container1 path:hover ~ .state-value-label {
    font-size: 13px;
    font-weight: 700;
    fill: #1e3a8a;
}

.india-map path:hover + .state-value-label,
.india-map path:hover ~ .state-value-label {
    font-size: 13px;
    font-weight: 700;
    fill: #1e3a8a;
}

/* Tamil Nadu district name labels on map */
.map-container1 .district-name-label {
    font-size: 14px;
    font-weight: 600;
    fill: #1f2937;
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: middle;
}

.map-container1 .district-value-label {
    font-size: 14px;
    font-weight: 900;
    fill: #374151;
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: middle;
}

@media (max-width: 768px) {
    .map-container1 .district-name-label {
        font-size: 10px;
    }
    .map-container1 .district-value-label {
        font-size: 9px;
    }
}

/* India Border Styling */
.india-map .india-border {
    stroke: #1e3a8a !important;
    stroke-width: 6 !important;
    fill: none !important;
    stroke-linejoin: round;
    stroke-linecap: round;
    pointer-events: none;
    z-index: 1000;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
    opacity: 1 !important;
}

.india-map .india-coastline {
    stroke: #004499;
    stroke-width: 3.5;
    fill: none;
    stroke-linejoin: round;
    stroke-linecap: round;
    pointer-events: none;
    opacity: 0.9;
}

.map-tooltip {
    position: absolute;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(59, 130, 246, 0.95) 100%);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.map-tooltip.show {
    display: block;
    animation: tooltipFadeIn 0.3s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1);
    }
}

.map-tooltip h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
}

.map-tooltip p {
    margin: 5px 0;
    font-size: 13px;
    opacity: 0.95;
    line-height: 1.6;
}

.map-tooltip strong {
    color: #fbbf24;
    font-weight: 600;
}

/* Summary Statistics */
.summary-stats {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.summary-stats h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.summary-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.summary-card h4 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: 500;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* Table Enhancements */
.data-table-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.comprehensive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.comprehensive-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--primary-color);
}

.comprehensive-table thead th {
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.comprehensive-table tbody td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.comprehensive-table tbody tr:hover {
    background: var(--bg-light);
}

.comprehensive-table .state-name {
    font-weight: 600;
    color: var(--primary-color);
}

.comprehensive-table .nsdp-value {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.comprehensive-table .growth-positive {
    color: var(--success-color);
    font-weight: 600;
}

.comprehensive-table .growth-negative {
    color: #ef4444;
    font-weight: 600;
}

.comprehensive-table .growth-error {
    color: var(--text-light);
    font-style: italic;
}

/* Map Loading State */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-light);
    z-index: 1;
}

.map-loading i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.map-loading p {
    font-size: 16px;
    margin: 0;
}

.map-container.loaded .map-loading {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .map-container {
        height: 500px;
    }

    .map-header {
        flex-direction: column;
    }

    .legend-items {
        flex-direction: column;
        gap: 8px;
    }

    .comprehensive-table {
        font-size: 11px;
    }

    .comprehensive-table th,
    .comprehensive-table td {
        padding: 8px 5px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* State Tooltip Styles */
.state-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    pointer-events: none;
    z-index: 10000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    max-width: 250px;
    line-height: 1.5;
}

/* Hide growth columns for patents data */
.data-type-patents .growth-column {
    display: none;
}

.state-tooltip.show {
    display: block;
}

.state-tooltip .state-name {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 6px;
}

.state-tooltip .state-value {
    font-size: 13px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.9);
}

.state-tooltip .state-value:last-child {
    margin-bottom: 0;
}

.state-tooltip .state-value strong {
    color: #fff;
    font-weight: 600;
}

/* Upload Section Styles */
.upload-section {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

.upload-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.download-template-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #10b981;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

.download-template-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.upload-status {
    margin: 15px auto;
    max-width: 1200px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.upload-status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.upload-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.upload-status.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* Data Type Info Panel */
.data-info-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.data-info-panel.expanded {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s;
}

.info-header:hover {
    background: #f0f4f8;
}

.info-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    flex: 1;
}

.map-share-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    margin-right: 12px;
}
.map-share-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}
.map-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 24px;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
}
.map-share-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}
.map-share-btn i {
    font-size: 16px;
}
.map-share-reddit { background: #ff4500; color: #fff; }
.map-share-linkedin { background: #0a66c2; color: #fff; }
.map-share-whatsapp { background: #25d366; color: #fff; }
.map-share-copy-url {
    background: #64748b;
    color: #fff;
    border: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
}
.map-share-copy-url:hover {
    background: #475569;
}
.map-share-facebook { background: #1877f2; color: #fff; }
.map-share-twitter  { background: #14171a; color: #fff; }
.map-share-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: #fff; }
.map-share-x-icon { display: block; width: 16px; height: 16px; }
.map-share-btn .map-share-x-icon { color: inherit; }
.map-share-btn i.fa-brands { font-size: 16px; color: inherit; }

.map-download-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}
/* Override .btn-secondary so Download is visible on light panel (btn-secondary uses white text elsewhere) */
/* Radius matches .data-info-panel (8px) — avoids “stretched pill” on full-width mobile */
.map-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 24px;
    background: #f3f4f6 !important;
    color: #1f2937 !important;
    border: 1px solid #d1d5db !important;
    box-sizing: border-box;
    max-width: 100%;
}
.map-download-btn:hover {
    background: #e5e7eb !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
}
.map-download-btn i {
    font-size: 1em;
    color: inherit;
}
.map-download-option {
    color: #1f2937;
}
.map-download-option:hover {
    background: #f3f4f6;
}

.info-toggle-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.info-toggle-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.info-content {
    padding: 20px;
    display: block;
}

.info-description {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 15px 0;
}

.info-source {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.info-source i {
    color: #3b82f6;
}

.info-source a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.info-source a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Mobile safety: prevent Source row overflow */
.info-source {
    flex-wrap: wrap;
    align-items: flex-start;
}
.info-source a {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Mobile safety: avoid Top States Value/Share overlap */
@media (max-width: 600px) {
    .top-producing-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .top-producing-table thead,
    .top-producing-table tbody {
        width: 100%;
    }
    .top-producing-table th,
    .top-producing-table td {
        padding: 7px 8px;
        font-size: 12px;
    }
    .top-producing-table th:nth-child(3),
    .top-producing-table td:nth-child(3),
    .top-producing-table th:nth-child(4),
    .top-producing-table td:nth-child(4) {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .upload-section {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        justify-content: flex-start;
    }
    
    .state-selector-content {
        flex-wrap: wrap;
    }
    
    /* Category inner pages: data info panel header — center title, share row, download */
    .data-info-panel .info-header {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    .data-info-panel .info-header h3 {
        font-size: 18px;
        line-height: 1.35;
        order: 1;
        flex: 1 1 100%;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        /* Room for expand/chevron top-right; tighter than before for more title width */
        padding: 0 32px;
    }
    
    .data-info-panel .info-header .map-share-wrap {
        order: 2;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 0;
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .map-share-label {
        font-size: 12px;
    }
    
    .map-share-btn {
        width: 32px;
        height: 32px;
    }
    
    .map-share-btn i {
        font-size: 14px;
    }
    
    .map-share-x-icon {
        width: 14px;
        height: 14px;
    }
    
    .data-info-panel .info-header .map-download-wrap {
        order: 3;
        flex: 0 1 100%;
        width: 100%;
        max-width: 150px;
        min-width: 0;
        margin-left: auto;
        margin-right: auto;
        margin-top: 2px;
        display: flex;
        justify-content: center;
    }

    .data-info-panel .info-header .map-download-btn {
        width: 100%;
        max-width: 100%;
        min-height: 48px;
        font-size: 16px;
        font-weight: 600;
        padding: 14px 20px;
        border-radius: 24px;
    }

    .data-info-panel .info-header .map-download-btn i {
        font-size: 1.1em;
    }
    
    .data-info-panel .info-header .info-toggle-btn {
        order: 4;
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    .info-description {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .data-info-panel .info-header h3 {
        font-size: 18px;
        line-height: 1.35;
        padding: 0 26px;
        text-align: center;
    }
    
    .data-info-panel .info-header .map-share-wrap {
        gap: 6px;
        justify-content: center;
    }
    
    .map-share-btn {
        width: 30px;
        height: 30px;
    }
    
    .map-share-btn i {
        font-size: 13px;
    }
    
    .map-share-x-icon {
        width: 13px;
        height: 13px;
    }

    /* Centered column; cap width (inherits max-width 200px from 768px rule) */
    .data-info-panel .info-header .map-download-wrap {
        margin-top: 6px;
        max-width: 200px;
        margin-left: auto;
        margin-right: auto;
    }

    .data-info-panel .info-header .map-download-btn {
        min-height: 50px;
        font-size: 16px;
        padding: 16px 20px;
        border-radius: 24px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 300px;
    }
}
