@font-face {
    font-family: 'Marlos';
    src: url('fonts/Marlos-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Marlos';
    src: url('fonts/Marlos-Italic.otf') format('opentype');
    font-weight: normal;
    font-style: italic;
}

:root {
    --borda: #073e1d;
    --gold: #073e1d;
    --text-color: #ffffff;
    --ink: #000000;
    --accent: #d3b665;
    --glow: 0 0 10px rgba(255, 255, 255, 0.3);
    --text-glow: 0 0 15px rgba(255, 255, 255, 0.5);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --font-primary: 'Marlos', serif;
    --font-secondary: 'Crimson Text', serif;
    --container-border: 2px solid var(--gold);
    --border-color: rgba(255, 255, 255, 0.5);
    --title-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

body {
    background: transparent;
    color: var(--text-color);
    display: none;
    height: 100vh;
    width: 100vw;
    font-family: var(--font-secondary);
    margin: 0;
    padding: 0;
}

body.active {
    display: block;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    animation: fadeIn 0.3s ease-out;
}

.overlay.fadeout {
    opacity: 0;
    animation: fadeOut 0.3s ease-in;
}

.container {
    display: grid;
    grid-template-columns: 200px 1fr;
    width: 90%;
    max-width: 1400px;
    height: 75vh;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin: 50px auto;
    background-size: cover;
    background-position: center;
    box-shadow: var(--card-shadow), var(--glow);
    border: 2px solid var(--borda);
    transition: all 0.3s ease-in-out;
    animation: fadeIn 0.3s ease-out;
    min-height: 600px;
}

/* Overlay escuro sobre o background */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1;
}

.sidebar, .content {
    position: relative;
    z-index: 2;
}

.sidebar {
    background: #02291d;
    backdrop-filter: blur(5px);
    width: 200px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
}

.logo {
    margin-bottom: 10px;
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px; /* Adicionado espaço entre o texto e a imagem */
    color: var(--title-color);
    font-size: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: var(--glow);
}

.logo h1 .highlight {
    color: var(--accent); /* Cor dourada definida no :root */
}

.logo-stamp {
    width: 140px;  /* Reduzido de 170px para 140px */
    height: auto;
    margin-top: 10px;
    margin-bottom: 15px;
}

.logo-divider {
    width: 150px;
    height: auto;
    margin-bottom: 30px;  /* Aumentado o espaço após o divisor */
}

nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;  /* Aumentado o espaço entre os botões */
    margin: 10px 0;
    margin-top: 30px;  /* Adicionado margem superior para aumentar o espaço */
    transform: translateY(-50px);  /* Ajustado para manter o alinhamento */
}

.nav-btn {
    width: 100%;
    padding: 10px 15px;
    margin: 5px 0;  /* Reduzido a margem individual dos botões */
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    letter-spacing: 1px;
    font-family: var(--font-primary);
    text-transform: uppercase;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.nav-btn:hover, 
.nav-btn.active {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(255, 235, 155, 0.3);
}

.content {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    background: url('assets/carta1.png') center/cover;
    backdrop-filter: blur(3px);
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    position: relative;
    padding: 20px;
    height: 100%;
    flex: 1;
    width: 100%;
    min-height: 100%;
    overflow: visible;
}

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

.action-btn {
    padding: 10px 15px;
    margin: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-primary);
    font-size: 14px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow);
    background: rgba(255, 255, 255, 0.2);
}

/* Estilização do sistema de mensagens */
.mail-list {
    width: 300px;
    border-right: 3px solid var(--gold);
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    position: relative;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
}

.mail-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.mail-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mail-item.unread::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.mail-item .sender {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.mail-item .subject {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.mail-item .date {
    font-size: 0.8em;
    color: var (--text-color);
    opacity: 0.6;
}

/* Visualização da mensagem */
.mail-view {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    border-left: 3px solid var(--gold);
    margin-left: -3px;
    background: url('assets/parchment-bg.png') center/cover;
    position: relative;
}

.mail-content {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--gold);
    margin-top: 20px;
}

.mail-header {
    border-bottom: 2px solid var(--gold);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.mail-subject {
    font-size: 1.2em;
    color: var(--text-color);
    margin-bottom: 10px;
}

.mail-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-color);
    font-size: 0.9em;
}

/* Composição de mensagem */
.compose-form {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--gold);
}

.compose-form input,
.compose-form textarea {
    width: 100%;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px;
    border-radius: 4px;
}

.compose-form textarea {
    height: 200px;
    resize: vertical;
}

/* Opção anônima */
.compose-options {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.anonymous-option {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px;
}

.anonymous-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Sistema de amigos */
.friends-section {
    padding: 20px;
    border-radius: 10px;
    margin: 20px;
}

.friends-header,
.friend-requests {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Ajustes na lista de amigos para compensar a remoção do background */
.friends-list, .friend-requests {
    background: rgba(0, 0, 0, 0.5); /* Alterado de 0.7 para 0.5 */
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.friend-item, 
.friend-request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.5); /* Alterado de 0.6 para 0.5 */
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.friend-actions {
    display: flex;
    gap: 10px;
}

.no-friends,
.no-requests {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
    opacity: 0.8;
}

/* Responsividade */
@media screen and (max-width: 1400px) {
    .container {
        width: 95%;
    }
}

@media screen and (max-height: 800px) {
    .container {
        height: 90vh;
    }
}

/* Ajustes na visualização de mensagem */
.message-body {
    line-height: 1.6;
    white-space: pre-wrap;
    margin: 20px 0;
    color: var(--text-color);
}

.message-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Ajustes nos inputs e textareas */
input, textarea {
    background: rgba(0, 0, 0, 0.5); /* Alterado de 0.3 para 0.5 */
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-family: var(--font-secondary);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--glow);
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Container de mensagens */
.mail-container {
    display: flex;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

/* Ajustes na lista de amigos */
.friends-list, .friend-requests {
    background: rgba(0, 0, 0, 0.5); /* Atualizado para manter consistência */
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.friends-list h3, .friend-requests h3 {
    color: var(--text-color);
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.friend-name {
    color: var(--text-color);
    font-weight: bold;
}

/* Ajustes nos botões de ação */
.action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

/* Ajuste específico para o botão de adicionar amigo */
#add-friend-btn.action-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

#add-friend-btn.action-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: var(--accent);
}

/* Correções de layout */
.tab-content {
    height: 100%;
    overflow-y: auto;
    position: relative;
}

.mail-view, .mail-list {
    height: 100%;
    overflow-y: auto;
}

/* Melhorias visuais */
.mail-item {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.mail-item:hover {
    border-left-color: var(--gold);
}

.mail-item.unread {
    background: rgba(255, 255, 255, 0.05);
}

/* Estado ativo dos elementos */
.nav-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    box-shadow: var(--glow);
}

/* Estilo para preview e exibição de imagens */
.preview-container {
    max-width: 200px;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 4px;
}

.preview-container img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.message-image {
    margin: 10px 0;
    max-width: 100%;
}

.message-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

#image-preview {
    margin: 10px 0;
}

/* Estilos para o modal de imagem */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    padding: 20px;
}

.image-modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease-out;
}

.image-modal.zoomed img {
    transform: scale(1.5);
    cursor: grab;
}

.image-modal.zoomed img:active {
    cursor: grabbing;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--gold);
    border-radius: 50%;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 1001;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
    box-shadow: var(--glow);
}

.image-modal img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 2px solid var(--gold);
    border-radius: 8px;
    box-shadow: var(--glow);
    transition: transform 0.2s ease;
    transform-origin: center center;
    will-change: transform;
    cursor: grab;
    user-select: none;
}

.image-modal img:active {
    cursor: grabbing;
}

.image-modal img:hover {
    transform: scale(1.02);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.message-image img {
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image img:hover {
    transform: scale(1.05);
}

/* Estilos para o Berrador */
.berrador-form {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--gold);
}

.record-controls {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

#recording-status {
    text-align: center;
    margin-top: 20px;
    color: var(--text-color);
    font-style: italic;
}

.recording #start-record {
    background: rgba(255, 0, 0, 0.3);
}

#berrador-recipient {
    width: 100%;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px;
    border-radius: 4px;
}
