/**
 * HelpMap Custom Styles
 * Additional styles for enhanced UI/UX
 */

/* Default Avatar Styles */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.helpmapp-default-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 600;
    line-height: 1;
    color: #ffffff;
    text-transform: uppercase;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.helpmapp-avatar-image {
    display: inline-block;
    border-radius: 9999px;
    object-fit: cover;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Hide scrollbar on mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        display: none;
    }
    
    body {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* Line Clamp Utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-clamp: 1;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

/* Aspect Ratio Utilities */
.aspect-w-16 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
}

.aspect-w-16 > * {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-open {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-in-progress {
    background-color: #fef3c7;
    color: #d97706;
}

.status-resolved {
    background-color: #d1fae5;
    color: #059669;
}

.status-closed {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Premium Badge */
.premium-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

/* Interactive Elements */
.interactive {
    transition: all 0.2s ease;
    cursor: pointer;
}

.interactive:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.interactive:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Map Container Enhancements */
.map-container {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    height: 400px;
    width: 100%;
}

/* Mobile map height */
@media (max-width: 768px) {
    .map-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .map-container {
        height: 250px;
    }
}

.map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    pointer-events: none;
    z-index: 1;
}

#chartdiv {
    width: 100%;
    height: 100%;
}

/* Map Loading State */
.map-container.loading {
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-container.loading::after {
    content: 'Loading map...';
    color: #64748b;
    font-size: 1.125rem;
    font-weight: 500;
}

/* Map Error State */
.map-container.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.map-container.error::after {
    content: 'Failed to load map. Please check your internet connection.';
    color: #dc2626;
    font-size: 1rem;
    text-align: center;
    padding: 1rem;
}

/* User Avatar Enhancements */
.user-avatar {
    position: relative;
    display: inline-block;
}

.user-avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border: 2px solid white;
    border-radius: 50%;
}

.user-avatar.offline::after {
    background-color: #6b7280;
}

.user-avatar.premium::after {
    background-color: #f59e0b;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    max-width: 24rem;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background-color: #10b981;
    color: white;
}

.notification.error {
    background-color: #ef4444;
    color: white;
}

.notification.info {
    background-color: #3b82f6;
    color: white;
}

/* Form Enhancements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Button Variants */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.hero-actions {
    max-width: 480px;
    margin: 0 auto;
}

.hero-actions .btn {
    min-width: 150px;
    flex: 1 1 150px;
}

.hero-actions .btn + .btn {
    margin-left: 0;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-icon {
    padding: 0.75rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-floating {
    position: fixed;
    bottom: 5rem;
    right: 1rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 40;
}

/* Card Variants */
.card-elevated {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-flat {
    box-shadow: none;
    border: 1px solid #e5e7eb;
}

.card-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Responsive Utilities */
@media (max-width: 640px) {
    .hero-actions .btn {
        width: auto;
        flex: 1 1 140px;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .text-responsive {
        font-size: 0.875rem;
    }
    
    .btn-responsive {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .card-responsive {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .text-gray-600 {
        color: #000 !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Comment Styles */
.comment-item {
    border-left: 4px solid #e5e7eb;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.solution-comment {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

.solution-badge {
    margin-bottom: 0.75rem;
}

.comment-content {
    position: relative;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.comment-text {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.comment-actions button {
    color: #6b7280;
    transition: color 0.2s ease;
}

.comment-actions button:hover {
    color: #3b82f6;
}

/* Comment Form Styles */
.comment-form {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

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

.comment-form .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.comment-form .form-input,
.comment-form .form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form .form-input:focus,
.comment-form .form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-form .form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Comment Threading */
.comment-item .children {
    margin-left: 2rem;
    margin-top: 1rem;
    border-left: 2px solid #e5e7eb;
    padding-left: 1rem;
}

.comment-item .children .comment-item {
    background: #ffffff;
    border-left-color: #d1d5db;
}

/* Comment Moderation */
.comment-awaiting-moderation {
    background: #fef3c7;
    border-left-color: #f59e0b;
    color: #92400e;
}

.comment-awaiting-moderation::before {
    content: "⏳ ";
    font-weight: bold;
}

/* Comment Rating */
.comment-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.comment-rating .stars {
    color: #fbbf24;
}

.comment-rating .stars.empty {
    color: #d1d5db;
}

/* Comment Meta */
.comment-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.comment-meta .comment-author {
    font-weight: 500;
    color: #374151;
}

.comment-meta .comment-date {
    margin-left: 0.5rem;
}

/* Comment Actions */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.comment-actions button {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.comment-actions button:hover {
    color: #3b82f6;
}

.comment-actions button.liked {
    color: #ef4444;
}

.comment-actions button.solution {
    color: #10b981;
    font-weight: 500;
}

/* Comment Reply Form */
.comment-reply-form {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    display: none;
}

.comment-reply-form.active {
    display: block;
}

.comment-reply-form .form-textarea {
    min-height: 100px;
}

/* Comment Pagination */
.comment-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.comment-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid #d1d5db;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

.comment-pagination .page-numbers:hover,
.comment-pagination .page-numbers.current {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .auto-dark {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .auto-dark .card {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .auto-dark .form-input {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .auto-dark .comment-item {
        background: #374151;
        border-left-color: #4b5563;
    }
    
    .auto-dark .solution-comment {
        background: linear-gradient(135deg, #064e3b, #065f46);
        border-left-color: #10b981;
    }
    
    .auto-dark .comment-form {
        background: #374151;
        border-color: #4b5563;
    }
}

/* Comment mentions styling */
.comment-text a[href*="/author/"] {
    background-color: #EFF6FF;
    color: #1D4ED8;
    padding: 2px 6px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
    margin: 0 2px;
}

.comment-text a[href*="/author/"]:hover {
    background-color: #DBEAFE;
    color: #1E40AF;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Comment form highlighting */
#commentform.highlighted {
    border: 2px solid #3B82F6 !important;
    border-radius: 8px;
    transition: border-color 0.3s ease;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Reply button styling */
.comment-actions button[onclick*="replyToComment"] {
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.comment-actions button[onclick*="replyToComment"]:hover {
    background: linear-gradient(135deg, #1D4ED8, #1E40AF);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Mention input styling */
#comment:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Dark mode for mentions */
@media (prefers-color-scheme: dark) {
    .comment-text a[href*="/author/"] {
        background-color: #1E3A8A;
        color: #DBEAFE;
    }
    
    .comment-text a[href*="/author/"]:hover {
        background-color: #1E40AF;
        color: #EFF6FF;
    }
}

/* Notifications System Styles */
#notifications-dropdown {
    max-height: 500px;
    overflow-y: auto;
}

.notification-item {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background-color: #f8fafc;
    border-left-color: #3b82f6;
}

.notification-item.unread {
    background-color: #eff6ff;
    border-left-color: #3b82f6;
}

.notification-item.read {
    opacity: 0.7;
}

#notification-count {
    animation: pulse 2s infinite;
}

@keyframes notificationPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.notification-item.new {
    animation: notificationPulse 0.5s ease-out;
}

/* Mobile notifications */
@media (max-width: 768px) {
    #notifications-dropdown {
        width: 100vw;
        max-width: 320px;
        right: -10px;
    }
    
    .notification-item {
        padding: 0.75rem;
    }
}

/* Notification icons */
.notification-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.notification-icon.comment {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.notification-icon.reply {
    background-color: #dcfce7;
    color: #16a34a;
}

.notification-icon.like {
    background-color: #fecaca;
    color: #dc2626;
}

.notification-icon.follow {
    background-color: #e9d5ff;
    color: #7c3aed;
}

.notification-icon.problem {
    background-color: #fed7aa;
    color: #ea580c;
}

.notification-icon.solution {
    background-color: #dcfce7;
    color: #15803d;
}

.notification-icon.system {
    background-color: #f3f4f6;
    color: #6b7280;
}

.notification-icon.premium {
    background-color: #fef3c7;
    color: #d97706;
}

/* Notifications dropdown styling - always light theme */
#notifications-dropdown {
    background-color: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.notification-item {
    border-bottom-color: #e5e7eb;
    color: #374151;
}

.notification-item:hover {
    background-color: #f8fafc;
}

.notification-item.unread {
    background-color: #eff6ff;
    border-left-color: #3b82f6;
}

.notification-item h4 {
    color: #111827;
}

.notification-item p {
    color: #6b7280;
}

/* Remove dark mode styles since we don't use dark mode */

/* Priority Tags */
.priority-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.priority-low {
    background-color: #f3f4f6;
    color: #6b7280;
}

.priority-normal {
    background-color: #dbeafe;
    color: #1e40af;
}

.priority-high {
    background-color: #fef3c7;
    color: #d97706;
}

.priority-urgent {
    background-color: #fecaca;
    color: #dc2626;
    animation: urgentPulse 2s infinite;
}

@keyframes urgentPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Location display */
.location-display {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #f0f9ff;
    color: #0369a1;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.location-display i {
    margin-right: 0.25rem;
}

/* City selector */
.helpmapp-city-selector {
    position: relative;
}

.helpmapp-city-selector .helpmapp-city-wrapper {
    position: relative;
}

.helpmapp-city-selector .helpmapp-city-search {
    width: 100%;
}

.helpmapp-city-selector .helpmapp-city-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    display: none;
}

.helpmapp-city-selector.has-selection .helpmapp-city-clear {
    display: block;
}

.helpmapp-city-selector .helpmapp-city-status {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.35rem;
    display: none;
}

.helpmapp-city-selector .helpmapp-city-status.is-visible {
    display: block;
}

.helpmapp-city-selector .helpmapp-city-suggestions {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    z-index: 25;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12);
    max-height: 280px;
    overflow-y: auto;
}

.helpmapp-city-selector .helpmapp-city-suggestions.hidden {
    display: none;
}

.helpmapp-city-selector .helpmapp-city-suggestion {
    width: 100%;
    text-align: left;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.helpmapp-city-selector .helpmapp-city-suggestion:hover,
.helpmapp-city-selector .helpmapp-city-suggestion:focus {
    background: #eff6ff;
    outline: none;
}

.helpmapp-city-selector .helpmapp-city-suggestion .population {
    font-size: 0.75rem;
    color: #6b7280;
}

.helpmapp-city-selector .helpmapp-city-suggestion.is-empty {
    cursor: default;
    justify-content: center;
    color: #6b7280;
    font-style: italic;
}

/* Problem cards */
.problem-card {
    position: relative;
    overflow: hidden;
}

.problem-card .stretched-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.problem-card .category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #f1f5f9;
    color: #1f2937;
    font-size: 0.75rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    margin-top: 0.25rem;
}

.problem-card .category-pill:hover {
    background-color: #3b82f6;
    color: #ffffff;
}

@media (max-width: 640px) {
    .problem-card {
        padding: 1.25rem;
    }
    
    #latest-problems .grid {
        gap: 1.25rem;
    }
}

/* Partner logos */
.partner-logos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    align-items: center;
}

.partner-logo {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.partner-logo span {
    display: inline-block;
}

@media (max-width: 640px) {
    .partner-logos {
        gap: 1rem;
    }
    
    .partner-logo {
        padding: 1.25rem;
        font-size: 1.25rem;
    }
}

/* Map topic popup */
.map-topic-popup {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: 360px;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12);
    padding: 1.25rem 1.5rem 1.5rem;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-height: calc(80vh);
    display: flex;
    flex-direction: column;
}

.map-topic-popup:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.map-topic-popup.active {
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.map-topic-popup .map-topic-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.map-topic-popup .map-topic-close:hover {
    color: #3b82f6;
}

.map-topic-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.map-topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    font-size: 0.75rem;
    color: #475569;
    margin-bottom: 0.85rem;
}

.map-topic-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.map-topic-actions .btn {
    width: 100%;
}

.map-topic-content.preview h4 {
    margin-bottom: 0.25rem;
}

.map-topic-content.cluster-list,
.map-topic-content:not(.preview) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.map-topic-content.cluster-list h4 {
    margin-bottom: 0.75rem;
}

.map-topic-hint {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: -0.25rem;
    margin-bottom: 0.75rem;
}

.map-topic-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5f5 transparent;
}

.map-topic-list::-webkit-scrollbar {
    width: 6px;
}

.map-topic-list::-webkit-scrollbar-track {
    background: transparent;
}

.map-topic-list::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.35);
    border-radius: 999px;
}

.map-topic-list-item .map-topic-link {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-decoration: none;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    color: #0f172a;
}

.map-topic-list-item .map-topic-link:hover,
.map-topic-list-item .map-topic-link:focus {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.08);
    outline: none;
}

.map-topic-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.map-topic-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.75rem;
    color: #475569;
}

.map-topic-details span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.map-topic-empty {
    font-size: 0.85rem;
    color: #64748b;
}

.map-topic-more {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.map-topic-zoom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background-color: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.map-topic-zoom:hover,
.map-topic-zoom:focus {
    background-color: rgba(59, 130, 246, 0.18);
    border-color: rgba(37, 99, 235, 0.55);
    color: #1e3a8a;
    outline: none;
}

.map-topic-popup.cluster-mode .map-topic-list {
    max-height: 340px;
}

@media (max-width: 768px) {
    .map-topic-popup {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        max-width: none;
        border-radius: 1.25rem;
        max-height: calc(75vh);
        padding: 1.1rem 1.25rem 1.35rem;
    }

    .map-topic-popup.cluster-mode .map-topic-list {
        max-height: calc(55vh);
    }
}

@media (max-width: 520px) {
    .map-topic-popup.cluster-mode {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        border-radius: 1.25rem;
        max-height: calc(78vh);
    }

    .map-topic-popup {
        max-height: calc(82vh);
    }

    .map-topic-popup.cluster-mode .map-topic-list {
        max-height: calc(58vh);
    }
}