:root {
    --gbif-green: #4caf50;
    --gbif-dark-green: #2e7d32;
    --gbif-light-green: #e8f5e9;
    --gbif-blue: #2196f3;
    --gbif-orange: #ff9800;
    --gbif-purple: #9c27b0;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.gbif-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 42px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.gbif-logo {
    font-weight: 700;
    color: var(--gbif-dark-green);
    font-size: 22px;
}

.mode-selector-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 20px;
}

.mode-selector {
    display: flex;
    background: #f0f0f0;
    border-radius: 30px;
    padding: 4px;
    position: relative;
    width: 220px;
    height: 42px;
}

.mode-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s;
    border-radius: 30px;
    padding: 8px 15px;
}

.mode-option.active {
    color: white;
}

.mode-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 50%;
    height: calc(100% - 8px);
    background: var(--gbif-green);
    border-radius: 30px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.mode-slider.ai-mode {
    transform: translateX(100%);
    background: var(--gbif-blue);
}

.mode-option i {
    margin-right: 8px;
    font-size: 14px;
}

.search-section {
    background: linear-gradient(rgba(0,0,0,0.85), rgba(0,0,0,0.85)), 
                url('https://images.unsplash.com/photo-1518837695005-2083093ee35b?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 70px 0 50px 0;
    transition: opacity 0.4s ease;
}

.search-container {
    max-width: 900px;
    margin: 0 auto;
}

.search-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.search-input-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid var(--gbif-green);
    border-radius: 8px;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: var(--gbif-dark-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.search-btn {
    background: var(--gbif-green);
    color: white;
    border: none;
    padding: 14px 35px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    cursor: pointer;
}

.search-btn:hover {
    background: var(--gbif-dark-green);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.3);
}
.image-gallery{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(170px,1fr));
  gap:14px;
}

.image-card{ cursor:pointer; }

.image-thumb-wrap{
  position:relative;
  width:100%;
  aspect-ratio: 1 / 1; /* trava o layout */
  border-radius:14px;
  overflow:hidden;
  background:#f3f3f3;
}

.image-thumb{
  width:100%;
  height:100%;
  object-fit:cover; /* ou "contain" se preferir exsicatas inteiras */
  display:block;
}

.image-badge{
  position:absolute;
  left:10px;
  bottom:10px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  background:rgba(0,0,0,.55);
  color:#fff;
  backdrop-filter: blur(6px);
}


.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.autocomplete-item:hover {
    background-color: var(--gbif-light-green);
}

.autocomplete-icon {
    width: 30px;
    height: 30px;
    background: var(--gbif-light-green);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--gbif-green);
}

.autocomplete-text {
    flex: 1;
}

.scientific-name {
    font-weight: 600;
    color: var(--gbif-dark-green);
}

.common-name {
    font-size: 13px;
    color: #666;
}

.ai-chat-container {
    display: none;
    max-width: 1200px;
    margin: 30px auto;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ai-chat-container.active {
    display: block;
    opacity: 1;
}

.ai-chat-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    overflow: hidden;
    height: 700px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.05);
}

.ai-chat-header {
    background: linear-gradient(135deg, var(--gbif-blue) 0%, #1976d2 100%);
    color: white;
    padding: 30px;
    flex-shrink: 0;
}

.ai-chat-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-subtitle {
    font-size: 15px;
    opacity: 0.9;
    line-height: 1.5;
}

.ai-chat-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
}

.message {
    max-width: 85%;
    padding: 18px 22px;
    border-radius: 18px;
    line-height: 1.6;
    position: relative;
    animation: messageAppear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

@keyframes messageAppear {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--gbif-green) 0%, var(--gbif-dark-green) 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.ai {
    align-self: flex-start;
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
}

.message-avatar {
    position: absolute;
    bottom: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: white;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.user .message-avatar {
    right: -10px;
    background: var(--gbif-dark-green);
}

.ai .message-avatar {
    left: -10px;
    background: var(--gbif-blue);
}

.message-content {
    font-size: 15px;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 5px;
}

.ai-chat-input-container {
    padding: 25px;
    border-top: 1px solid #eee;
    background: white;
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 16px 22px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    background: #fafafa;
}

.chat-input:focus {
    border-color: var(--gbif-blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.send-button {
    background: linear-gradient(135deg, var(--gbif-blue) 0%, #1976d2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.chat-examples {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.example-chip {
    background: #f0f7ff;
    border: 1px solid #d1e3ff;
    color: var(--gbif-blue);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.example-chip:hover {
    background: #e3f2fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.15);
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 18px 22px;
    border-radius: 18px;
    border: 1px solid #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.typing-dot {
    width: 9px;
    height: 9px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.species-list-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 30px auto;
    max-width: 1200px;
}

.list-header {
    background: linear-gradient(135deg, var(--gbif-dark-green) 0%, var(--gbif-green) 100%);
    color: white;
    padding: 20px;
    font-weight: 600;
    font-size: 18px;
}

.species-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
}

.species-item:hover {
    background-color: var(--gbif-light-green);
}

.species-item.active {
    background-color: var(--gbif-light-green);
    border-left: 4px solid var(--gbif-green);
}

.species-icon {
    width: 50px;
    height: 50px;
    background: var(--gbif-light-green);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gbif-green);
    font-size: 24px;
}

.species-info {
    flex: 1;
}

.species-scientific-name {
    font-weight: 600;
    color: var(--gbif-dark-green);
    font-size: 18px;
    margin-bottom: 5px;
}

.species-common-name {
    color: #666;
    font-style: italic;
    font-size: 14px;
}

.taxonomy-info {
    color: #777;
    font-size: 13px;
    margin-top: 5px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-accepted {
    background: #e8f5e9;
    color: var(--gbif-dark-green);
}

.status-synonym {
    background: #fff3e0;
    color: #e65100;
}

.species-details {
    display: none;
    background: white;
    border-top: 1px solid #eee;
    padding: 0;
}

.details-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 700px;
}

.details-sidebar {
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 30px;
    overflow-y: auto;
}

.details-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.menu-item {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #555;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: white;
    color: var(--gbif-dark-green);
}

.menu-item.active {
    background: white;
    color: var(--gbif-dark-green);
    border-left: 3px solid var(--gbif-green);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.menu-icon {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    color: var(--gbif-green);
}

.details-content {
    padding: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.occurrences-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: 600px;
    margin-top: 20px;
}

@media (max-width: 1200px) {
    .occurrences-container {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.occurrence-map {
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background-color: #f0f0f0;
}

.occurrence-list {
    height: 600px;
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: relative;
}

.occurrence-list-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: var(--gbif-dark-green);
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.occurrence-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.occurrence-item:hover {
    background: #e8f5e9;
}

.occurrence-item.active {
    background: var(--gbif-light-green);
    border-left: 4px solid var(--gbif-green);
}

.occurrence-item.has-image {
    background-color: #f0f9ff;
    border-left: 3px solid #2196f3;
}

.occurrence-location {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.occurrence-coords {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.occurrence-details {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.occurrence-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.occurrence-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
}

.type-herbarium {
    background: #fff3e0;
    color: #e65100;
}

.type-observation {
    background: #e8f5e9;
    color: var(--gbif-dark-green);
}

.type-material {
    background: #e3f2fd;
    color: var(--gbif-blue);
}

.type-literature {
    background: #f3e5f5;
    color: var(--gbif-purple);
}

.image-indicator {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #4caf50;
    border-radius: 50%;
    color: white;
    text-align: center;
    line-height: 20px;
    font-size: 10px;
    margin-right: 8px;
}

.hover-image-popup {
    position: fixed;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
    display: none;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.1);
}

.hover-image-popup img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.hover-popup-content {
    padding: 12px;
}

.hover-popup-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

.hover-popup-meta {
    font-size: 12px;
    color: #666;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.filter-section-bar {
    background: #f8f9fa;
    padding: 12px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.filter-select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 13px;
    outline: none;
}

.update-filter-btn {
    background: var(--gbif-green);
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.update-filter-btn:hover {
    background: var(--gbif-dark-green);
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-box {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    height: 180px;
    transition: all 0.3s;
    border: 1px solid #dee2e6;
}

.image-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 12px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-box:hover .image-caption {
    opacity: 1;
}

.image-type {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    z-index: 2;
}

.type-herbarium {
    background: var(--gbif-orange);
}

.type-field {
    background: var(--gbif-green);
}

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

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 36px;
    font-weight: 800;
    color: var(--gbif-dark-green);
    margin-bottom: 8px;
}

.stat-label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.taxonomy-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.taxonomy-tree {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.taxon-level {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: var(--gbif-light-green);
    border-radius: 8px;
    border-left: 4px solid var(--gbif-green);
}

.taxon-rank {
    font-weight: 600;
    color: var(--gbif-dark-green);
    min-width: 120px;
}

.citation-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    border-left: 4px solid var(--gbif-blue);
    transition: box-shadow 0.3s;
}

.citation-box:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.citation-text {
    font-family: 'Georgia', serif;
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}

.citation-meta {
    margin-top: 10px;
    color: #666;
    font-size: 13px;
}

.treatment-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.treatment-title {
    color: var(--gbif-dark-green);
    font-weight: 700;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.treatment-content {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.original-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 25px 0;
}

.original-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    border: 1px solid #dee2e6;
    transition: all 0.3s;
    flex: 1;
    min-width: 250px;
}

.original-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--gbif-green);
    color: var(--gbif-dark-green);
    text-decoration: none;
}

.link-icon {
    width: 40px;
    height: 40px;
    background: var(--gbif-light-green);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gbif-green);
    font-size: 18px;
}

.link-info h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.link-info small {
    color: #666;
    font-size: 13px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

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

.pagination-container {
    display: none !important; /* Escondemos a paginação antiga */
}

.page-item {
    margin: 0 5px;
}

.page-link {
    color: var(--gbif-green);
    border: 1px solid #dee2e6;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 500;
}

.page-link:hover {
    background: var(--gbif-light-green);
    color: var(--gbif-dark-green);
}

.page-item.active .page-link {
    background: var(--gbif-green);
    border-color: var(--gbif-green);
    color: white;
}

.gbif-footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 30px 0;
    margin-top: 60px;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin-right: 20px;
    font-size: 14px;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

.image-modal .modal-content {
    border-radius: 12px;
    overflow: hidden;
    border: none;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.image-metadata {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.load-more-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.btn-load-more {
    background: var(--gbif-green);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-load-more:hover {
    background: var(--gbif-dark-green);
    transform: scale(1.05);
}

.btn-load-more:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.dataset-card, .vernacular-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.dataset-card:hover, .vernacular-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--gbif-green);
}

.identifier-badge {
    display: inline-block;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px 8px;
    margin: 2px;
    font-family: monospace;
    font-size: 12px;
}

.map-legend {
    background: white;
    padding: 10px 15px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Botões e estilos para identificação de plantas */
.chat-image-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    padding: 12px 15px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-image-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.chat-image-btn:active {
    transform: scale(0.95);
}

/* Botão de geolocalização */
.chat-geo-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    padding: 12px 15px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-geo-btn.active {
    background: var(--gbif-green);
    color: white;
}

.chat-geo-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.geo-status {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.geo-status.active {
    color: var(--gbif-green);
    font-weight: 600;
}

.geo-coordinates {
    background: #e8f5e9;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--gbif-dark-green);
    border-left: 3px solid var(--gbif-green);
}

.preview-image-container {
    margin: 15px 0;
}

.preview-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid var(--gbif-blue);
    margin: 10px 0;
    display: block;
}

.remove-image-btn {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 5px;
    transition: all 0.2s;
}

.remove-image-btn:hover {
    background: #cc0000;
}

.plant-identification-result {
    background: #e8f5e9;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid var(--gbif-green);
}

.plant-confidence {
    display: inline-block;
    background: var(--gbif-green);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.plant-suggestions {
    margin-top: 15px;
}

.suggestion-item {
    background: white;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-item:hover {
    background: var(--gbif-light-green);
    border-color: var(--gbif-green);
}

.plant-details-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid #dee2e6;
}

.identification-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 10px 0;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--gbif-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Nova seção IA */
.ai-summary-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e3f2fd;
    border-left: 4px solid var(--gbif-blue);
}

.ai-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.ai-summary-title {
    color: var(--gbif-blue);
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-summary-content {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.ai-summary-content p {
    margin-bottom: 15px;
}

.ai-summary-loading {
    text-align: center;
    padding: 30px;
    color: #666;
}

.ai-summary-error {
    background: #ffebee;
    border-radius: 8px;
    padding: 15px;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.refresh-summary-btn {
    background: var(--gbif-blue);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.refresh-summary-btn:hover {
    background: #1976d2;
    transform: translateY(-2px);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-left: 4px solid var(--gbif-green);
    min-width: 300px;
    transform: translateX(400px);
    animation: slideIn 0.3s forwards;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toast.error {
    border-left-color: #f44336;
}

.toast.warning {
    border-left-color: #ff9800;
}

.toast.info {
    border-left-color: #2196f3;
}

.toast-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    margin-left: 15px;
}

@keyframes slideIn {
    to { transform: translateX(0); }
}

@keyframes slideOut {
    to { transform: translateX(400px); }
}

/* Loading para geolocalização */
.geo-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #666;
}

.spinner-tiny {
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--gbif-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsividade */
@media (max-width: 992px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .details-sidebar {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .original-link {
        min-width: 100%;
    }
    
    .ai-chat-box {
        height: 600px;
    }
}

@media (max-width: 768px) {
    .search-btn {
        width: 100%;
        margin-top: 15px;
    }
    
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .species-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .species-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-section-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .mode-selector {
        width: 180px;
        height: 38px;
    }
    
    .mode-option {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .header-logo {
        height: 35px;
        max-width: 120px;
    }
    
    .ai-chat-title {
        font-size: 20px;
    }
    
    .ai-chat-header {
        padding: 20px;
    }
    
    .message {
        max-width: 90%;
        padding: 15px 18px;
    }
    
    .chat-input-wrapper {
        flex-wrap: wrap;
    }
    
    .chat-image-btn, .chat-geo-btn {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .preview-image {
        max-width: 150px;
        max-height: 150px;
    }
}

@media (max-width: 576px) {
    .mode-selector-container {
        margin-right: 10px;
    }
    
    .header-logo {
        height: 30px;
        max-width: 100px;
    }
    
    .gbif-logo {
        font-size: 18px;
    }
    
    .ai-chat-box {
        height: 550px;
    }
    
    .ai-chat-messages {
        padding: 15px;
    }
    
    .ai-chat-input-container {
        padding: 15px;
    }
    
    .chat-input {
        padding: 14px 18px;
    }
    
    .send-button {
        padding: 0 20px;
        min-width: 80px;
    }
    
    .example-chip {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .chat-image-btn, .chat-geo-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
}
/* Taxonomy browser */
.taxonomy-browser{
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 14px 16px;
}

.taxonomy-panel{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e1e1e1;
}

.tax-label{
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #666;
}

.tax-select, .tax-input{
  border-radius: 10px;
}
/* =====================================================================
   AI Chat – UI/UX mais livre (estilo chats de IA modernos)
   - Remove a borda/caixa do chat (ai-chat-box)
   - Remove o cabeçalho azul grosso (ai-chat-header)
   - Mantém contraste e leitura
   ===================================================================== */

/* 1) Tira a “caixa” do chat */
.ai-chat-box{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* 2) Tira o header azul e deixa só texto */
.ai-chat-header{
  background: transparent !important;
  color: #111 !important;
  border-bottom: none !important;
  padding: 10px 0 6px 0 !important;
}

/* remove o padrão decorativo do header (se existir) */
.ai-chat-header::before{
  display: none !important;
}

/* título menor e discreto */
.ai-chat-title{
  font-size: 14px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  opacity: 0.75 !important;
}

/* opcional: esconder subtítulo grande do header (fica mais clean) */
.ai-chat-subtitle{
  display: none !important;
}

/* 3) Mensagens mais “soltas” no layout principal */
.ai-chat-messages{
  background: transparent !important;
  padding: 18px 0 !important;
  gap: 12px !important;
}

/* bolhas mais minimalistas */
.message{
  box-shadow: none !important;
  border-radius: 16px !important;
  padding: 14px 16px !important;
  max-width: 88% !important;
}

/* AI bubble: leve e sem cara de card */
.message.ai{
  background: rgba(0,0,0,0.035) !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
  color: #111 !important;
}

/* User bubble: mantém destaque, mas sem “peso” */
.message.user{
  background: rgba(76, 175, 80, 0.16) !important;
  border: 1px solid rgba(76, 175, 80, 0.20) !important;
  color: #0f2a17 !important;
}

/* 4) Remove avatares (mais clean) */
.message-avatar{
  display: none !important;
}

/* 5) Área de input mais integrada ao fundo */
.ai-chat-input-container{
  background: transparent !important;
  border-top: 1px solid rgba(0,0,0,0.06) !important;
  box-shadow: none !important;
  padding: 14px 0 0 0 !important;
}

.chat-input{
  background: rgba(0,0,0,0.035) !important;
  border: 1px solid rgba(0,0,0,0.10) !important;
}

.chat-input:focus{
  border-color: rgba(76, 175, 80, 0.40) !important;
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.14) !important;
}

.send-button{
  background: rgba(0,0,0,0.035) !important;
  border: 1px solid rgba(0,0,0,0.10) !important;
  color: #111 !important;
}

.send-button:hover{
  background: rgba(0,0,0,0.06) !important;
}

/* 6) Deixa a seção do chat com largura elegante */
.ai-chat-container{
  max-width: 980px;
  margin: 24px auto;
}

@media (max-width: 768px){
  .ai-chat-messages{
    padding: 14px 0 !important;
  }
}
/* Tooltip da geolocalização (popup em cima do botão) */
.geo-tooltip {
  position: fixed;
  z-index: 2000;
  display: none;
  pointer-events: none;

  padding: 10px 12px;
  border-radius: 10px;

  background: rgba(20, 20, 20, 0.92);
  color: #fff;

  font-size: 12px;
  line-height: 1.25;
  max-width: 260px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);

  transform: translate(-50%, -10px);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.geo-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid rgba(20, 20, 20, 0.92);
}

.geo-tooltip .muted {
  opacity: 0.85;
}
