html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#app-container, #admin-page {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px;
    height: 95vh;
    max-height: 900px; 
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: filter 0.3s ease-in-out;
    position: relative;
}

header {
    background-color: #00796b; 
    color: white;
    padding: 0.75rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #00695c;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .header-content {
    flex-grow: 1;
    margin-right: 1rem;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.header-subtitle {
    font-size: 0.85rem;
    font-weight: 400;
    margin: 0;
    color: #e0f2f1; 
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

#language-selector-container {
    position: relative;
}

#language-selector {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.4-5.4-13z%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 0.7em top 50%;
    background-size: 0.65em auto;
    padding-right: 2.5em;
    transition: all 0.2s ease-in-out;
}

#language-selector:hover {
    border-color: #bbb;
    background-color: #e9e9e9;
}

#share-app-button {
    background: none;
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

#share-app-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

#share-app-button:disabled {
    cursor: default;
    background-color: #00796b;
    border-color: #f0f0f0;
}

#share-app-button:disabled svg {
    fill: #f0f0f0;
}


#image-slideshow-container {
    width: 100%;
    height: 130px; 
    background-color: #e0e0e0; 
    position: relative;
    overflow: hidden;
    flex-shrink: 0; 
}

#slideshow-image {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    transition: opacity 0.7s ease-in-out;
    opacity: 1;
}

#slideshow-image.fade-out {
    opacity: 0;
}

#slideshow-loading-indicator, #slideshow-error-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 10;
}

#slideshow-error-indicator {
    background-color: rgba(211, 47, 47, 0.8); 
}


main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1.5rem;
    overflow: hidden; 
    transition: padding 0.3s ease-in-out;
}

#chat-container, #admin-container {
    display: flex;
    flex-direction: column;
    height: 100%; 
}

#chat-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    margin-bottom: 0.5rem;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    margin-bottom: 0.75rem;
    max-width: 80%;
    line-height: 1.5;
    word-wrap: break-word;
    transition: all 0.3s ease-in-out;
}

.message:last-child {
    margin-bottom: 0;
}

.user-message {
    background-color: #007bff; 
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.user-message-translation-original {
    background-color: #e3f2fd;
    color: #1d3557;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    border: 1px dashed #457b9d;
}

.ai-message {
    background-color: #e9e9eb; 
    color: #333;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    display: flex; 
    flex-direction: column; 
}

.ai-message.speaking {
    outline: 2px solid #009688;
    box-shadow: 0 0 10px #009688;
}

.ai-message.direct-ai-message {
    background-color: #f4ecf7;
    border-left: 4px solid #8e44ad;
}

.ai-message.visto-ai-message {
    background-color: #e3f2fd;
    border-left: 4px solid #1e88e5;
}

.ai-message.voo-ai-message {
    background-color: #e3f2fd;
    border-left: 4px solid #2196F3;
}

.ai-message.mapa-ai-message {
    background-color: #f0f8ff;
    border-left: 4px solid #3367D6;
}

.ai-message.util-ai-message {
    background-color: #f3e5f5;
    border-left: 4px solid #8e24aa;
}

.ai-message.dinheiro-ai-message {
    background-color: #fffde7;
    border-left: 4px solid #f9a825;
}

.ai-message.cultura-ai-message {
    background-color: #ede7f6;
    border-left: 4px solid #673ab7;
}

.ai-message.restaurante-ai-message {
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
}

.ai-message.compras-ai-message {
    background-color: #e0f7fa;
    border-left: 4px solid #0097a7;
}

.ai-message.raiz-ai-message {
    background-color: #efebe9;
    border-left: 4px solid #795548;
}

.ai-message.experiencias-ai-message {
    background-color: #f5f5f5;
    border-left: 4px solid #8d6e63;
}

.ai-message.zen-ai-message {
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.ai-message.curioso-ai-message {
    background-color: #fff8e1;
    border-left: 4px solid #ffb74d;
}

.ai-message.historiador-ai-message {
    background-color: #fdf5e6;
    border-left: 4px solid #8b4513;
}

.ai-message.aventura-ai-message {
    background-color: #fff3e0;
    border-left: 4px solid #ff6d00;
}

.ai-message.missao-ai-message {
    background-color: #e0f2f1;
    border-left: 4px solid #00796b;
}

.ai-message.eventos-ai-message {
    background-color: #e8eaf6;
    border-left: 4px solid #3f51b5;
}

.ai-message.planejamento-ai-message {
    background-color: #f5f5f5;
    border-left: 4px solid #616161;
}

.ai-message.exclusivo-ai-message {
    background-color: #ede7f6;
    border-left: 4px solid #5e35b1;
}

.ai-message.promocao-ai-message {
    background-color: #f1f8e9;
    border-left: 4px solid #66bb6a;
}

.ai-message.desafios-ai-message {
    background-color: #fff9c4;
    border-left: 4px solid #fbc02d;
}

.ai-message.jogos-ai-message {
    background-color: #e0f2f1;
    border-left: 4px solid #009688;
}

.ai-message.instantaneo-ai-message {
    background-color: #e0f7fa;
    border-left: 4px solid #00bcd4;
}

.ai-message.postal-ai-message {
    background-color: #f5e1da;
    border-left: 4px solid #bcaaa4;
}

.ai-message.balada-ai-message {
    background-color: #fce4ec;
    border-left: 4px solid #e91e63;
}

.ai-message.boemio-ai-message {
    background-color: #f3e5f5;
    border-left: 4px solid #7b1fa2;
}

.ai-message.servicos-ai-message {
    background-color: #eceff1;
    border-left: 4px solid #546e7a;
}

.ai-message.grupos-ai-message {
    background-color: #e0f7fa;
    border-left: 4px solid #00acc1;
}

.ai-message.emergency-ai-message {
    background-color: #fddede;
    border-left: 4px solid #d32f2f;
}

.translation-ai-message {
    background-color: #ede7f6;
    border-left: 4px solid #673ab7;
}

.ai-message.direct-ai-message .message-content::before,
.ai-message.visto-ai-message .message-content::before,
.ai-message.util-ai-message .message-content::before,
.ai-message.dinheiro-ai-message .message-content::before,
.ai-message.cultura-ai-message .message-content::before,
.ai-message.restaurante-ai-message .message-content::before,
.ai-message.compras-ai-message .message-content::before,
.ai-message.raiz-ai-message .message-content::before,
.ai-message.experiencias-ai-message .message-content::before,
.ai-message.zen-ai-message .message-content::before,
.ai-message.curioso-ai-message .message-content::before,
.ai-message.historiador-ai-message .message-content::before,
.ai-message.aventura-ai-message .message-content::before,
.ai-message.missao-ai-message .message-content::before,
.ai-message.eventos-ai-message .message-content::before,
.ai-message.planejamento-ai-message .message-content::before,
.ai-message.exclusivo-ai-message .message-content::before,
.ai-message.promocao-ai-message .message-content::before,
.ai-message.desafios-ai-message .message-content::before,
.ai-message.jogos-ai-message .message-content::before,
.ai-message.instantaneo-ai-message .message-content::before,
.ai-message.postal-ai-message .message-content::before,
.ai-message.balada-ai-message .message-content::before,
.ai-message.boemio-ai-message .message-content::before,
.ai-message.servicos-ai-message .message-content::before,
.ai-message.grupos-ai-message .message-content::before,
.ai-message.emergency-ai-message .message-content::before,
.ai-message.voo-ai-message .message-content::before,
.ai-message.mapa-ai-message .message-content::before,
.translation-ai-message .message-content::before {
    content: attr(data-mode-title);
    font-weight: 600;
    font-size: 0.9em;
    display: block;
    margin-bottom: 0.5em;
    padding-bottom: 0.3em;
    border-bottom-style: dashed;
    border-bottom-width: 1px;
}

.ai-message.direct-ai-message .message-content::before {
    color: #8e44ad;
    border-bottom-color: #8e44ad;
}

.ai-message.visto-ai-message .message-content::before {
    color: #1565c0;
    border-bottom-color: #1e88e5;
}

.ai-message.voo-ai-message .message-content::before {
    color: #1565c0;
    border-bottom-color: #2196F3;
}

.ai-message.mapa-ai-message .message-content::before {
    color: #2a56c2;
    border-bottom-color: #3367D6;
}

.ai-message.util-ai-message .message-content::before {
    color: #6a1b9a;
    border-bottom-color: #8e24aa;
}

.ai-message.dinheiro-ai-message .message-content::before {
    color: #f57f17;
    border-bottom-color: #f9a825;
}

.ai-message.cultura-ai-message .message-content::before {
    color: #4527a0;
    border-bottom-color: #673ab7;
}

.ai-message.restaurante-ai-message .message-content::before {
    color: #e65100;
    border-bottom-color: #ff9800;
}

.ai-message.compras-ai-message .message-content::before {
    color: #006064;
    border-bottom-color: #0097a7;
}

.ai-message.raiz-ai-message .message-content::before {
    color: #5d4037;
    border-bottom-color: #795548;
}

.ai-message.experiencias-ai-message .message-content::before {
    color: #6d4c41;
    border-bottom-color: #8d6e63;
}

.ai-message.zen-ai-message .message-content::before {
    color: #2e7d32;
    border-bottom-color: #4caf50;
}

.ai-message.curioso-ai-message .message-content::before {
    color: #e65100;
    border-bottom-color: #ffb74d;
}

.ai-message.historiador-ai-message .message-content::before {
    color: #8b4513;
    border-bottom-color: #8b4513;
}

.ai-message.aventura-ai-message .message-content::before {
    color: #ff6d00;
    border-bottom-color: #ff6d00;
}

.ai-message.missao-ai-message .message-content::before {
    color: #004d40;
    border-bottom-color: #00796b;
}

.ai-message.eventos-ai-message .message-content::before {
    color: #303f9f;
    border-bottom-color: #3f51b5;
}

.ai-message.planejamento-ai-message .message-content::before {
    color: #424242;
    border-bottom-color: #616161;
}

.ai-message.exclusivo-ai-message .message-content::before {
    color: #512da8;
    border-bottom-color: #5e35b1;
}

.ai-message.promocao-ai-message .message-content::before {
    color: #43a047;
    border-bottom-color: #66bb6a;
}

.ai-message.desafios-ai-message .message-content::before {
    color: #fbc02d;
    border-bottom-color: #fbc02d;
}

.ai-message.jogos-ai-message .message-content::before {
    color: #00796b;
    border-bottom-color: #009688;
}

.ai-message.instantaneo-ai-message .message-content::before {
    color: #00838f;
    border-bottom-color: #00bcd4;
}

.ai-message.postal-ai-message .message-content::before {
    color: #8d6e63;
    border-bottom-color: #a1887f;
}

.ai-message.balada-ai-message .message-content::before {
    color: #c2185b;
    border-bottom-color: #e91e63;
}

.ai-message.boemio-ai-message .message-content::before {
    color: #7b1fa2;
    border-bottom-color: #7b1fa2;
}

.ai-message.servicos-ai-message .message-content::before {
    color: #37474f;
    border-bottom-color: #546e7a;
}

.ai-message.grupos-ai-message .message-content::before {
    color: #00838f;
    border-bottom-color: #00acc1;
}

.ai-message.emergency-ai-message .message-content::before {
    color: #b71c1c;
    border-bottom-color: #d32f2f;
}

.translation-ai-message .message-content::before {
    color: #4527a0;
    border-bottom-color: #673ab7;
}

.translation-prefix {
    font-weight: bold;
    font-size: 0.9em;
    color: #4527a0;
    display: block;
    margin-bottom: 0.3em;
}

.message-controls-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #ddd;
}

.share-button {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 0.1rem 0.25rem; 
    display: flex;
    align-items: center;
    gap: 0.4rem; 
    font-size: 0.85em; 
    line-height: 1; 
}

.share-button svg {
    width: 1em; 
    height: 1em; 
    fill: currentColor;
}

.share-button:hover, .share-button:focus {
    color: #00796b; 
    outline: none;
}

.share-button:disabled svg path {
    fill: #888; 
}

.message-content p:first-child, .message-content ul:first-child, .message-content ol:first-child {
    margin-top: 0;
}
.message-content p:last-child, .message-content ul:last-child, .message-content ol:last-child {
    margin-bottom: 0;
}

.message-content a[href*="wa.me"] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: #25D366;
    color: white !important;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    margin-top: 10px;
    transition: background-color 0.2s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
.message-content a[href*="wa.me"]:hover {
    background-color: #128C7E;
    transform: translateY(-1px);
}
.message-content a[href*="wa.me"]::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="white"><path d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 221.9-99.6 221.9-222 0-59.3-25.2-115-67.1-157zM223.9 439.6c-38.2 0-73.7-11.8-103.6-32.5L36 445.6l29.9-81.8c-22.7-32.9-36.2-72.3-36.2-114.5 0-108.8 88.5-197.3 197.3-197.3 52.9 0 101.3 20.5 138.3 57.5 37 37 57.5 85.5 57.5 138.3 0 108.8-88.5 197.3-197.3 197.3zm101.5-143.8c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.rating-widget {
    margin-top: 0; 
    padding-top: 0; 
    display: flex;
    flex-direction: column; 
    align-items: center;
}

.rating-question {
    font-size: 0.85em; 
    color: #555;
    margin-bottom: 0.3rem; 
    text-align: center;
    padding-left: 0; 
}

.stars-container {
    display: flex;
    gap: 0.15rem; 
    align-items: center;
}

.star {
    font-size: 1.1rem; 
    color: #ccc; 
    cursor: pointer;
    transition: color 0.2s ease-in-out, transform 0.1s ease-in-out;
    padding: 0 0.05rem; 
}

.star:hover {
    transform: scale(1.15);
}

.star.filled {
    color: #ffc107; 
}

.star.rated {
    cursor: default; 
}
.star.rated:hover {
    transform: none; 
}

/* --- New Action Bar Styles --- */
#chat-actions-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.action-button {
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.action-button:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}

.action-button:disabled {
    background-color: #e9e9e9;
    color: #aaa;
    cursor: not-allowed;
    border-color: #ddd;
    transform: scale(1) !important;
    opacity: 0.6 !important;
    filter: grayscale(80%) !important;
}

.fixed-action-button {
    /* For Resposta Direta and Limpar */
}

#clear-chat-button {
    background-color: #fbe9e7;
    border-color: #ffccbc;
    color: #d84315;
}

#clear-chat-button:hover {
    background-color: #ffccbc;
}

.scroll-container-wrapper {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.scroll-container-wrapper::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 30px;
    background: radial-gradient(circle, rgba(0, 121, 107, 0.15) 0%, rgba(0, 121, 107, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    transition: opacity 0.3s ease;
}

#scrollable-actions {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 40%;
    gap: 1rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#scrollable-actions::-webkit-scrollbar {
    display: none;
}

.scroll-action-button {
    scroll-snap-align: center;
    transform: scale(0.85);
    opacity: 0.7;
    filter: grayscale(50%);
}

.scroll-action-button.is-center {
    transform: scale(1.05);
    opacity: 1;
    font-weight: 600;
    filter: grayscale(0%);
}

/* Active State Styles */
.action-button[aria-pressed="true"] {
    transform: scale(1.05);
    opacity: 1;
    filter: grayscale(0%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

[data-mode="direct"][aria-pressed="true"] {
    background-color: #8e44ad;
    color: white;
    border-color: #6c3483;
}

[data-mode="visto"][aria-pressed="true"] {
    background-color: #1e88e5;
    color: white;
    border-color: #1565c0;
}

[data-mode="voo"][aria-pressed="true"] {
    background-color: #2196F3;
    color: white;
    border-color: #1976D2;
}

[data-mode="mapa"][aria-pressed="true"] {
    background-color: #3367D6;
    color: white;
    border-color: #2a56c2;
}

[data-mode="util"][aria-pressed="true"] {
    background-color: #8e24aa;
    color: white;
    border-color: #6a1b9a;
}

[data-mode="translator"][aria-pressed="true"] {
    background-color: #673ab7;
    color: white;
    border-color: #512da8;
}

[data-mode="dinheiro"][aria-pressed="true"] {
    background-color: #f9a825;
    color: white;
    border-color: #f57f17;
}

[data-mode="cultura"][aria-pressed="true"] {
    background-color: #673ab7;
    color: white;
    border-color: #512da8;
}

[data-mode="restaurante"][aria-pressed="true"] {
    background-color: #ff9800;
    color: white;
    border-color: #f57c00;
}

[data-mode="compras"][aria-pressed="true"] {
    background-color: #0097a7;
    color: white;
    border-color: #006064;
}

[data-mode="raiz"][aria-pressed="true"] {
    background-color: #795548;
    color: white;
    border-color: #5d4037;
}

[data-mode="experiencias"][aria-pressed="true"] {
    background-color: #8d6e63;
    color: white;
    border-color: #6d4c41;
}

[data-mode="zen"][aria-pressed="true"] {
    background-color: #4caf50;
    color: white;
    border-color: #388e3c;
}

[data-mode="curioso"][aria-pressed="true"] {
    background-color: #ffb74d;
    color: white;
    border-color: #f57c00;
}

[data-mode="historiador"][aria-pressed="true"] {
    background-color: #8b4513;
    color: white;
    border-color: #5a2d0c;
}

[data-mode="aventura"][aria-pressed="true"] {
    background-color: #ff6d00;
    color: white;
    border-color: #e65100;
}

[data-mode="missao"][aria-pressed="true"] {
    background-color: #00796b;
    color: white;
    border-color: #004d40;
}

[data-mode="eventos"][aria-pressed="true"] {
    background-color: #3f51b5;
    color: white;
    border-color: #283593;
}

[data-mode="planejamento"][aria-pressed="true"] {
    background-color: #616161;
    color: white;
    border-color: #424242;
}

[data-mode="exclusivo"][aria-pressed="true"] {
    background-color: #5e35b1;
    color: white;
    border-color: #4527a0;
}

[data-mode="promocao"][aria-pressed="true"] {
    background-color: #66bb6a;
    color: white;
    border-color: #43a047;
}

[data-mode="desafios"][aria-pressed="true"] {
    background-color: #fbc02d;
    color: white;
    border-color: #f9a825;
}

[data-mode="jogos"][aria-pressed="true"] {
    background-color: #009688;
    color: white;
    border-color: #00796b;
}

[data-mode="instantaneo"][aria-pressed="true"] {
    background-color: #00bcd4;
    color: white;
    border-color: #00838f;
}

[data-mode="postal"][aria-pressed="true"] {
    background-color: #a1887f;
    color: white;
    border-color: #795548;
}

[data-mode="balada"][aria-pressed="true"] {
    background-color: #e91e63;
    color: white;
    border-color: #c2185b;
}

[data-mode="boemio"][aria-pressed="true"] {
    background-color: #7b1fa2;
    color: white;
    border-color: #4a148c;
}

[data-mode="servicos"][aria-pressed="true"] {
    background-color: #546e7a;
    color: white;
    border-color: #37474f;
}

[data-mode="grupos"][aria-pressed="true"] {
    background-color: #00acc1;
    color: white;
    border-color: #00838f;
}

[data-mode="emergency"][aria-pressed="true"] {
    background-color: #d32f2f;
    color: white;
    border-color: #b71c1c;
}

#input-area {
    display: flex;
    align-items: flex-end;
    padding: 0.5rem;
    border-top: 1px solid #e0e0e0;
}

#user-input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 1rem;
    margin-right: 0.75rem;
    outline: none;
    transition: border-color 0.2s, height 0.2s ease-in-out;
    resize: none;
    overflow-y: hidden;
    line-height: 1.5;
    max-height: 120px;
}

#user-input:focus {
    border-color: #00796b;
}

#input-action-button {
    background-color: #00796b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s ease-in-out;
    flex-shrink: 0;
}

#input-action-button:hover {
    background-color: #005f56;
}

#input-action-button.send-mode svg {
    transform: translateX(1px);
}

#input-action-button.recording {
    background-color: #d32f2f;
    transform: scale(1.1);
}
#input-action-button.recording:hover {
    background-color: #b71c1c;
}

#input-action-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#loading-indicator {
    text-align: center;
    padding: 0.5rem;
    color: #555;
    font-style: italic;
}

.hidden {
    display: none !important;
}

.system-notification {
    text-align: center;
    padding: 0.5rem 1rem;
    margin: 0.75rem auto;
    border-radius: 8px;
    background-color: #e0f2f1;
    color: #004d40;
    font-size: 0.9em;
    font-style: italic;
    max-width: 90%;
    border: 1px solid #b2dfdb;
}

.system-notification.error {
    background-color: #fddede !important;
    color: #d32f2f !important;
    border: 1px solid #d32f2f !important;
}

.language-selection-box {
    padding: 1.5rem;
    margin: 1rem auto;
    border: 1px solid #b2dfdb;
    background-color: #f0f8f7;
    border-radius: 12px;
    text-align: center;
    max-width: 95%;
}

.language-selection-box p {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #004d40;
}

.language-selection-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.lang-select-button {
    background-color: #ffffff;
    color: #00796b;
    border: 1px solid #00796b;
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.lang-select-button:hover {
    background-color: #00796b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}


.error-message {
    color: #d32f2f !important; 
    background-color: #fddede !important; 
    border: 1px solid #d32f2f !important;
    font-weight: normal; 
    padding: 0.75rem 1rem !important;
}

.error-message p { 
    color: #d32f2f !important;
}


footer {
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.8em;
    color: #666;
    border-top: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    flex-shrink: 0; 
}

.contact-info {
    margin-bottom: 0.5rem; 
}

.contact-info p {
    margin: 0; 
}

.contact-info a {
    color: #00796b; 
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

footer p {
    margin: 0;
}


#chat-box::-webkit-scrollbar, #admin-container .table-container::-webkit-scrollbar {
    width: 8px;
}

#chat-box::-webkit-scrollbar-track, #admin-container .table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#chat-box::-webkit-scrollbar-thumb, #admin-container .table-container::-webkit-scrollbar-thumb {
    background: #00796b;
    border-radius: 10px;
}

#chat-box::-webkit-scrollbar-thumb:hover, #admin-container .table-container::-webkit-scrollbar-thumb:hover {
    background: #005f56;
}

.map-container-wrapper {
    margin-top: 0.75rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.map-container {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    height: 0;
    background-color: #e0e0e0; /* placeholder bg */
}
.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.grounding-sources-container {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #bdbdbd;
}

.grounding-sources-header {
    font-size: 0.9em;
    font-weight: 600;
    color: #004d40;
    margin: 0 0 0.5rem 0;
}

.grounding-sources-list {
    list-style-type: decimal;
    margin: 0;
    padding-left: 1.5rem;
    font-size: 0.85em;
}

.grounding-sources-list li {
    margin-bottom: 0.4rem;
}

.grounding-sources-list a {
    color: #00796b;
    text-decoration: none;
    word-break: break-all;
}

.grounding-sources-list a:hover {
    text-decoration: underline;
}

/* --- Camera and Postal Styles --- */
#camera-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

#camera-feed {
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    border: 3px solid white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

#capture-photo-button {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    background-color: #fff;
    color: #00796b;
    border: 2px solid #00796b;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#capture-photo-button:hover {
    background-color: #00796b;
    color: white;
    transform: scale(1.05);
}

.postcard-container {
    width: 100%;
    max-width: 400px;
    border: 10px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    margin-top: 0.5rem;
    position: relative;
    background-color: #e0e0e0;
}

.postcard-image {
    width: 100%;
    display: block;
    aspect-ratio: 1 / 1;
}

.postcard-signature {
    position: absolute;
    bottom: 12px;
    right: 15px;
    font-family: cursive, sans-serif;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    transform: rotate(-4deg);
    pointer-events: none;
}