/* Wisconsin Lake Search Styles */

.lake-search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 600;
}

.header-content p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.info-banner {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.banner-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.banner-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.banner-text {
    flex: 1;
    color: #004085;
}

.content-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

.search-main {
    min-width: 0;
}

.search-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.sidebar-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.sidebar-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.map-controls {
    margin-top: 1rem;
    text-align: center;
}

.search-form-container {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.search-primary {
    margin-bottom: 1rem;
}

.search-group-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: #212529;
}

.search-grid-primary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.search-actions {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-top: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #212529;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
}

.modal-close:hover {
    color: #212529;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Search Tips */
.search-tips-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.search-tips-collapsible {
    border: none;
}

.search-tips-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 1.1rem;
    color: #212529;
}

.search-tips-header::-webkit-details-marker {
    display: none;
}

.tips-indicator {
    margin-left: auto;
    transition: transform 0.3s ease;
}

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

.search-tips-content {
    padding-top: 1rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tip-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.tip-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tip-card h4 {
    margin: 0 0 1rem 0;
    color: #212529;
}

.tip-card p {
    margin: 0.5rem 0;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert i {
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .search-with-sidebar {
        grid-template-columns: 1fr;
    }

    .search-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .lake-results-grid {
        grid-template-columns: 1fr;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }
}

/* County Map Widget Styles */
.map-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.county-map-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.county-map-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.county-map-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.toggle-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: white;
    font-weight: 600;
}

.toggle-content p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95); /* Improved from 0.9 opacity */
    font-weight: 500; /* Make text slightly bolder */
}

.toggle-indicator {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.county-map-toggle.collapsed .toggle-indicator {
    transform: rotate(180deg);
}

.county-map-content {
    padding: 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.county-map-content.show {
    max-height: 600px;
}

#wisconsinCountyMap {
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
}

/* Loading state for county map */
.county-map-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 500px;
    color: #495057; /* Dark gray for good contrast */
}

.county-map-loading p {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: #495057; /* Dark gray text */
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.selected-county-info {
    padding: 1rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.county-info-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.county-selection {
    font-weight: 600;
    color: #007bff;
}

.clear-county-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.clear-county-btn:hover {
    background: #c82333;
}

/* Additional Form Styles for Verification Modal */
.form-control-lg {
    padding: 1rem;
    font-size: 1.25rem;
}

.text-center {
    text-align: center;
}

.btn-link {
    background: transparent;
    color: #007bff;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 0.125em;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* ============================================
   WATERBODY CLUSTERING STYLES
   ============================================ */

/* Cluster card styling */
.cluster-card {
    border: 2px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cluster-card.river-card {
    border-color: #0097a7;
}

.cluster-card.lake-card {
    border-color: #007bff;
}

.cluster-summary {
    padding: 1.5rem;
}

.cluster-info-banner {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.cluster-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.cluster-message {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cluster-message strong {
    color: #856404;
}

.cluster-help-text {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
}

.cluster-preview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.cluster-preview-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
    font-size: 0.875rem;
}

.river-card .cluster-preview-item {
    border-left-color: #0097a7;
}

.preview-wbic {
    font-weight: 600;
    color: #495057;
}

.preview-county {
    color: #6c757d;
}

.preview-size {
    color: #6c757d;
    margin-left: auto;
}

.cluster-preview-more {
    text-align: center;
    padding: 0.5rem;
    color: #6c757d;
    font-style: italic;
    font-size: 0.875rem;
}

.cluster-actions {
    display: flex;
    justify-content: center;
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
}

.btn-view-cluster {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Clustering notice in results header */
.clustering-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e7f3ff;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #004085;
}

.notice-icon {
    font-size: 1.1rem;
}

.notice-text {
    font-weight: 500;
}

/* ============================================
   CLUSTER COMPARISON MODAL STYLES
   ============================================ */

.cluster-modal-help {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.cluster-modal-help p {
    margin: 0;
    color: #004085;
}

.cluster-waterbody-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.cluster-waterbody-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    align-items: center;
    transition: all 0.2s ease;
}

.cluster-waterbody-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.cluster-item-color {
    width: 8px;
    min-width: 8px;
    height: 100%;
    border-radius: 4px;
    align-self: stretch;
}

.cluster-item-details {
    flex: 1;
}

.cluster-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.cluster-item-header strong {
    font-size: 1.1rem;
    color: #212529;
}

.cluster-item-wbic {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: normal;
}

.cluster-item-info {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.cluster-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cluster-item-actions .btn {
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.cluster-zoom-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    border-color: #6c757d !important;
    color: #6c757d !important;
}

.cluster-zoom-btn:hover {
    background-color: #6c757d !important;
    color: white !important;
    border-color: #6c757d !important;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Responsive adjustments for cluster modal */
@media (max-width: 768px) {
    .cluster-waterbody-item {
        flex-direction: column;
        align-items: stretch;
    }

    .cluster-item-color {
        width: 100%;
        height: 4px;
        min-width: unset;
    }

    .cluster-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cluster-item-info {
        flex-direction: column;
        gap: 0.25rem;
    }

    .cluster-item-actions {
        justify-content: stretch;
    }

    .cluster-item-actions .btn {
        width: 100%;
    }
}

/* Hide county map on mobile devices (phones only, not tablets) */
@media (max-width: 767px) {
    .county-map-widget,
    .map-sidebar {
        display: none !important;
    }
}

/* Text variants for mobile vs desktop (map visibility) */
.map-text-desktop {
    display: inline;
}

.map-text-mobile {
    display: none;
}

@media (max-width: 767px) {
    .map-text-desktop {
        display: none;
    }

    .map-text-mobile {
        display: inline;
    }
}

/* Waterbody Type Badge Styles */
.waterbody-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.waterbody-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.waterbody-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    white-space: nowrap;
}

.waterbody-type-badge:before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    margin-right: 0.5rem;
}

/* Has Results Badge */
.has-results-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    animation: subtle-pulse 2s ease-in-out infinite;
}

@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    }
    50% {
        box-shadow: 0 2px 8px rgba(40, 167, 69, 0.5);
    }
}

.search-grid-primary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

@media (max-width: 992px) {
    .waterbody-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .waterbody-badges {
        width: 100%;
    }
}

/* Map Modal Styles */
.modal-large {
    max-width: 900px;
    width: 90%;
}

.map-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.map-info p {
    margin: 0.25rem 0;
    color: #495057;
}

.map-info strong {
    color: #007bff;
    font-size: 1.1rem;
}

#waterbodyLocationMap {
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

/* Ensure Leaflet map displays correctly in modal */
.leaflet-container {
    height: 100%;
    width: 100%;
    border-radius: 8px;
}

/* Mobile responsive adjustments for map modal */
@media (max-width: 768px) {
    .modal-large {
        width: 95%;
        max-width: none;
    }

    #waterbodyLocationMap {
        height: 400px !important;
    }
}

/* Clustering Info Banner Styles */
.clustering-info-banner {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    animation: slideInFromTop 0.4s ease-out;
}

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

.clustering-info-banner .banner-icon {
    flex-shrink: 0;
    color: #1976d2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.clustering-info-banner .banner-icon svg {
    width: 24px;
    height: 24px;
}

.clustering-info-banner .banner-content {
    flex: 1;
}

.clustering-info-banner .banner-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0d47a1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clustering-info-banner .banner-text {
    margin: 0 0 1rem 0;
    color: #1565c0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.clustering-info-banner .banner-text strong {
    color: #0d47a1;
    font-weight: 600;
}

.clustering-info-banner .banner-examples {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border-left: 3px solid #2196f3;
}

.clustering-info-banner .example-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #1565c0;
}

.clustering-info-banner .example-icon {
    flex-shrink: 0;
    font-size: 1.2rem;
    line-height: 1;
}

.clustering-info-banner .banner-tip {
    margin: 0;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    color: #0d47a1;
    font-size: 0.9rem;
    border-left: 3px solid #4caf50;
}

.clustering-info-banner .banner-tip strong {
    color: #2e7d32;
}

/* Responsive adjustments for clustering banner */
@media (max-width: 768px) {
    .clustering-info-banner {
        flex-direction: column;
        padding: 1rem;
    }

    .clustering-info-banner .banner-icon {
        align-self: center;
    }

    .clustering-info-banner .banner-examples {
        padding: 0.75rem;
    }

    .clustering-info-banner .example-item {
        font-size: 0.85rem;
    }

    .clustering-info-banner .banner-tip {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Anonymous Submission Info Collapsible Styles */
.anonymous-info-details {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.anonymous-info-summary {
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f7ff 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #004085;
    border: none;
    outline: none;
    user-select: none;
    transition: background 0.2s ease;
    list-style: none;
}

.anonymous-info-summary::-webkit-details-marker {
    display: none;
}

.anonymous-info-summary:hover {
    background: linear-gradient(135deg, #d0e9ff 0%, #e0f0ff 100%);
}

.summary-icon {
    font-size: 1.2rem;
}

.summary-indicator {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.anonymous-info-details[open] .summary-indicator {
    transform: rotate(180deg);
}

.anonymous-info-details .anonymous-info-container {
    padding: 1.25rem;
    background: white;
    border-top: 1px solid #dee2e6;
    animation: slideDown 0.3s ease;
}

.anonymous-info-details .anonymous-info-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.anonymous-info-details .anonymous-info-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

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

/* Mobile responsive */
@media (max-width: 576px) {
    .anonymous-info-summary {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .anonymous-info-details .anonymous-info-container {
        padding: 1rem;
    }
}
