/* Map Container */
.map-container {
    position: relative;
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    min-height: 800px;
}

/* County Info Box */
.county-info {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    max-width: 300px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.county-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.county-details {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.8;
}

/* Florida Map SVG Container */
.florida-map {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
    max-width: 100%;
}

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

/* County Paths */
.county-path {
    fill: #e3f2fd;
    stroke: #0066cc;
    stroke-width: 1.5;
    cursor: pointer;
    transition: all 0.3s ease;
    transform-origin: center;
}

.county-path:hover {
    fill: #bbdefb;
    stroke: #ff6b00;
    stroke-width: 2.5;
    transform: scale(1.01);
    filter: drop-shadow(0 4px 8px rgba(0, 102, 204, 0.3));
}

.county-path.selected {
    fill: #90caf9;
    stroke: var(--accent-color);
    stroke-width: 3;
}

/* County Labels */
.county-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 7px;
    font-weight: 500;
    fill: #333;
    pointer-events: none;
    text-anchor: middle;
    user-select: none;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tooltip */
.county-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    transform: translate(-50%, -100%);
    margin-top: -10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.county-tooltip.visible {
    opacity: 1;
}

.county-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Status Legend */
.status-legend {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    max-width: 250px;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.legend-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.legend-item:last-child {
    border-bottom: none;
}

.legend-item:hover {
    background: #f8f8f8;
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: 4px;
}

.legend-item.total {
    font-weight: 600;
    font-size: 1.05rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.legend-color-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-label {
    font-size: 0.9rem;
    color: var(--text-color);
}

.legend-count {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color);
    background: #e3f2fd;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    min-width: 32px;
    text-align: center;
}

/* Status Colors */
.status-request-not-sent { background-color: #bdbdbd; }
.status-pending { background-color: #64b5f6; }
.status-no-reply { background-color: #9e9e9e; }
.status-explicit-refusal { background-color: #dc3545; }
.status-constructive-refusal { background-color: #ff9f1c; }
.status-substantive-reply { background-color: #4caf50; }
.status-lawsuit { background-color: #8b0000; }

/* County colors based on status */
.county-path.request-not-sent { fill: #bdbdbd; }
.county-path.pending { fill: #64b5f6; }
.county-path.no-reply { fill: #9e9e9e; }
.county-path.explicit-refusal { fill: #dc3545; }
.county-path.constructive-refusal { fill: #ff9f1c; }
.county-path.substantive-reply { fill: #4caf50; }
.county-path.lawsuit { fill: #8b0000; }

/* Modal */
body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

/* County Modal Grid Layout */
.county-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.county-modal-left,
.county-modal-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-section {
    margin-bottom: 0;
    background: #f9f9f9;
    padding: 1.25rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.modal-section h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    margin-top: 0;
}

.modal-section p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.modal-section strong {
    color: var(--secondary-color);
}

.status-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.status-badge.request-not-sent {
    background-color: #bdbdbd;
    color: white;
}

.status-badge.pending {
    background-color: #64b5f6;
    color: white;
}

.status-badge.no-reply {
    background-color: #9e9e9e;
    color: white;
}

.status-badge.refused {
    background-color: #ff6b6b;
    color: white;
}

.status-badge.constructive-refusal {
    background-color: #ff9f1c;
    color: white;
}

.status-badge.complete-response {
    background-color: #4caf50;
    color: white;
}

.status-badge.partial-response {
    background-color: #ffe66d;
    color: #333;
}

.status-badge.lawsuit {
    background-color: #8b0000;
    color: white;
}

/* View Questions Button */
.view-questions-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    transition: all 0.3s ease;
}

.view-questions-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
}

.view-questions-button:active {
    transform: translateY(0);
}

/* View Reply Button */
.view-reply-button {
    background: linear-gradient(135deg, var(--accent-color), #ff5722);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    margin-top: 0;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.25);
}

.view-reply-button:hover {
    background: linear-gradient(135deg, #ff5722, #ff3d00);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 0, 0.4);
}

.view-reply-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

#modal-reply-section {
    background: #fff3e0;
    border-left-color: var(--accent-color);
}

/* Reply Modal */
.reply-modal-content {
    max-width: 1200px;
}

.reply-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.reply-content,
.reply-documents {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
}

.reply-content h3,
.reply-documents h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

#reply-text {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 1rem;
    line-height: 1.8;
    white-space: pre-wrap;
    font-family: 'DM Sans', sans-serif;
}

#reply-date {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.document-item {
    background: white;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.2s ease;
}

.document-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.document-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.document-item a:hover {
    color: var(--accent-color);
}

.document-description {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.no-reply-message {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    border-radius: 6px;
    color: #856404;
}

.no-documents-message {
    background: #e3f2fd;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 6px;
    color: #0d47a1;
}

/* Questions List Styles */
#questions-list {
    counter-reset: question-counter;
}

.question-item {
    background: #f9f9f9;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    counter-increment: question-counter;
    position: relative;
}

.question-item::before {
    content: "QUESTION " counter(question-counter);
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.question-item p {
    line-height: 1.8;
    color: var(--text-color);
}

/* Responsive Adjustments */

/* Tablet (medium screens) */
@media (max-width: 1024px) {
    .status-legend {
        max-width: 200px;
        font-size: 0.85rem;
    }

    .legend-title {
        font-size: 0.9rem;
    }

    .legend-item {
        margin-bottom: 0.4rem;
    }

    .respondent-access-matrix {
        max-width: 350px;
    }

    .matrix-title {
        font-size: 0.85rem;
    }

    .access-matrix-table th,
    .access-matrix-table td {
        font-size: 0.7rem;
        padding: 0.35rem 0.4rem;
    }
}

/* Mobile (small screens) */
@media (max-width: 768px) {
    .reply-container {
        grid-template-columns: 1fr;
    }

    .county-modal-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .view-questions-button {
        font-size: 0.9rem;
        padding: 0.6rem 1.5rem;
    }

    .map-container {
        padding: 1rem;
        min-height: auto;
        display: block;
    }

    .florida-map {
        margin: 1.5rem 0;
        width: 100%;
    }

    .status-legend {
        position: static !important;
        margin-bottom: 1.5rem;
        width: 100%;
        max-width: 100%;
        padding: 1.25rem;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
    }

    .legend-title {
        font-size: 1rem;
    }

    .legend-item {
        padding: 0.5rem 0;
        font-size: 0.85rem;
    }

    .legend-item.total {
        font-size: 0.95rem;
    }

    .legend-label {
        font-size: 0.85rem;
    }

    .legend-count {
        font-size: 0.85rem;
    }

    .legend-color-box {
        width: 16px;
        height: 16px;
        min-width: 16px;
    }

    .respondent-access-matrix {
        position: static !important;
        margin-top: 1.5rem;
        margin-bottom: 0;
        max-width: 100%;
        width: 100%;
        padding: 1.25rem;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
    }

    .matrix-title {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .matrix-table-container {
        max-height: 300px;
    }

    .access-matrix-table {
        font-size: 0.8rem;
    }

    .access-matrix-table th {
        font-size: 0.75rem;
        padding: 0.6rem 0.4rem;
    }

    .access-matrix-table td {
        font-size: 0.75rem;
        padding: 0.5rem 0.4rem;
    }

    .county-label {
        font-size: 5px;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-title {
        font-size: 1.4rem;
    }
}

/* Extra small mobile screens */
@media (max-width: 480px) {
    .map-container {
        padding: 0.75rem;
    }

    .status-legend {
        padding: 1rem;
    }

    .legend-title {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .legend-item {
        font-size: 0.8rem;
        padding: 0.4rem 0;
    }

    .legend-item.total {
        font-size: 0.85rem;
    }

    .legend-label {
        font-size: 0.8rem;
    }

    .legend-count {
        font-size: 0.8rem;
    }

    .legend-color-box {
        width: 14px;
        height: 14px;
        min-width: 14px;
    }

    .respondent-access-matrix {
        padding: 1rem;
    }

    .matrix-title {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .access-matrix-table th {
        font-size: 0.65rem;
        padding: 0.4rem 0.25rem;
    }

    .access-matrix-table td {
        font-size: 0.65rem;
        padding: 0.35rem 0.25rem;
    }

    .access-matrix-table .checkmark {
        width: 14px;
        height: 14px;
        line-height: 14px;
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    #floating-donate-btn {
        bottom: 70px !important;
        right: 10px !important;
    }

    #floating-donate-btn .donate-btn {
        font-size: 14px;
        padding: 10px 20px;
    }
}

/* Floating Donate Button */
#floating-donate-btn {
    transition: all 0.3s ease;
}

#floating-donate-btn form {
    margin: 0;
    padding: 0;
}

#floating-donate-btn .donate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #0070ba, #1f8dd6);
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 112, 186, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
}

#floating-donate-btn .donate-btn:hover {
    background: linear-gradient(135deg, #005ea6, #1a7ac2);
    box-shadow: 0 6px 20px rgba(0, 112, 186, 0.4);
    transform: translateY(-2px);
}

#floating-donate-btn .donate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 112, 186, 0.3);
}

/* Main Donate Button (Support Tab) */
#main-donate-btn .donate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #0070ba, #1f8dd6);
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 600;
    padding: 16px 48px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 112, 186, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
}

#main-donate-btn .donate-btn:hover {
    background: linear-gradient(135deg, #005ea6, #1a7ac2);
    box-shadow: 0 8px 24px rgba(0, 112, 186, 0.4);
    transform: translateY(-3px);
}

#main-donate-btn .donate-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 112, 186, 0.3);
}

/* Respondent Access Matrix */
.respondent-access-matrix {
    position: absolute;
    bottom: 80px;
    left: 100px;
    max-width: 480px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    backdrop-filter: blur(4px);
}

/* Desktop only - hide on smaller screens to prevent overlap */
@media (max-width: 1200px) {
    .respondent-access-matrix {
        left: 60px;
        max-width: 400px;
    }
}

.matrix-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    text-align: center;
}

.matrix-table-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.access-matrix-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    position: relative;
}

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

.access-matrix-table thead th {
    background: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.access-matrix-table th {
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
}

.access-matrix-table th:first-child {
    width: 45%;
}

.access-matrix-table th:not(:first-child) {
    text-align: center;
    width: 18%;
}

.access-matrix-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: background 0.2s;
}

.access-matrix-table tbody tr:hover {
    background: #f8f9fa;
}

.access-matrix-table tbody tr:last-child {
    border-bottom: none;
}

.access-matrix-table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
}

.access-matrix-table td:not(:first-child) {
    text-align: center;
}

.access-matrix-table .county-name-cell {
    font-weight: 500;
    color: var(--text-color);
}

.access-matrix-table .checkmark {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: #28a745;
    color: white;
    text-align: center;
    line-height: 16px;
    font-size: 11px;
}

.access-matrix-table .checkmark.yes-access {
    background: #28a745;
}

.access-matrix-table .checkmark.no-access {
    background: #dc3545;
}

.access-matrix-table .checkmark.replied {
    background: #007bff;
}
