/* ============================= */
/* RESET GLOBAL */
/* ============================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Noto Color Emoji';
}

body, html {
    overflow: auto !important;
    overflow-x: hidden !important;
    min-height: 100%;
    height: auto !important;
    scroll-behavior: smooth !important;
}


/* ============================= */
/* BACKGROUND GLOBAL */
/* ============================= */

body.stApp {
    background: linear-gradient(135deg, #6670A0 0%, #4A5280 100%) !important;
    color: #ffffff;
    min-height: 100vh;
}

/* ============================= */
/* LAYOUT GLOBAL */
/* ============================= */

.block-container {
    max-width: 1250px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 90px 1rem 180px 1rem !important; /* Espaço aumentado para 180px para garantir scroll livre no final */
}



/* ============================= */
/* NAVBAR FIXA - CLICÁVEL */
/* ============================= */

.custom-navbar-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 70px !important;
    background: transparent !important;
    z-index: 100 !important;
}

.custom-navbar { 
    background: linear-gradient(135deg, #1E1E2F 0%, #2A2A40 100%); 
    padding: 0.5rem 2rem; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    border-bottom: 2px solid #f1fa8c; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.2); 
    height: 70px; 
}
.custom-navbar-logo { display:flex; align-items:center; gap:15px; }
.custom-navbar-logo img { width:40px; height:40px; border-radius:8px; }
.custom-navbar-logo span { color:white; font-weight:bold; font-size:1.2rem; }
.custom-navbar-links { display:flex; gap:20px; }
.custom-navbar-links a { 
    color:white; 
    text-decoration:none; 
    padding:0.5rem 1rem; 
    border-radius:20px; 
    border:1px dashed #f1fa8c; 
}
#menu-toggle{ display:none; }
.custom-hamburger{ display:none; flex-direction:column; cursor:pointer; }
.custom-hamburger span{ width:28px; height:3px; background:#f1fa8c; margin:4px 0; border-radius:2px; transition: all 0.3s ease; }
.custom-mobile-menu{ display:none; position:fixed; top:70px; right:20px; background:#1E1E2F; border:1px solid #f1fa8c; border-radius:8px; flex-direction:column; min-width:160px; z-index: 1000; }
.custom-mobile-menu a{ color:white; padding:10px; text-decoration:none; border-bottom: 1px solid rgba(241, 250, 140, 0.2); }
.custom-mobile-menu a:last-child { border-bottom: none; }
/* Seletor ~ funciona pois input, .custom-navbar-wrapper e .custom-mobile-menu são irmãos diretos do body */
#menu-toggle:checked ~ .custom-mobile-menu{ display:flex; }
@media (max-width:768px){ 
    .custom-navbar-links{ display:none; } 
    .custom-hamburger{ display:flex; } 
    .custom-navbar { padding: 0.5rem 1rem; }
    .custom-navbar-logo { gap: 8px; }
}
@media (max-width: 550px) {
    .custom-navbar-logo span { display: none; }
    #gpu-pill { display: none !important; }
}


/* SIDEBAR - Adaptação do botão */
.sidebar {
    position: fixed;
    top: 70px;
    left: -300px;
    width: 300px;
    height: calc(100vh - 70px);
    background: rgba(30, 30, 47, 0.9) !important;
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(241, 250, 140, 0.15);
    z-index: 500;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 30px 20px;
    overflow-y: auto;
    box-shadow: 10px 0 30px rgba(0,0,0,0.3);
}
.sidebar.open { left: 0; }
.sidebar h3 { 
    color: #f1fa8c; 
    font-size: 1.2rem; 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    gap: 10px;
}
.sidebar p { 
    margin-bottom: 20px; 
    line-height: 1.5; 
    font-size: 0.9rem; 
    color: rgba(255,255,255,0.7);
}
.sidebar .sidebar-box { 
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}



.sidebar-toggle-btn {
    position: fixed;
    top: 85px;
    left: 15px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #1E1E2F;
    border: 2px solid #f1fa8c;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #f1fa8c;
    z-index: 1005; /* Must be extremely high so it sits above the sidebar layer (500) and the input layer (1000) */
}
.sidebar-toggle-btn.open {
    left: 315px; /* Moves to the right alongside the sidebar edge! */
    transform: rotate(180deg); /* Flip the arrow for UX feeling */
}
.sidebar-toggle-btn:hover {
    transform: scale(1.1);
    background: #2A2A40;
}
.sidebar-toggle-btn svg { fill: #f1fa8c; width: 24px; height: 24px; }

/* TÍTULOS E CHAT */
.main-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: .3rem;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(241,250,140,0.3);
    animation: fadeIn .8s ease;
    position: relative;
    z-index: 10; /* Lower z-index to not overlap sidebar toggle icons */
}

.main-subtitle {
    font-size: clamp(.9rem, 2vw, 1rem);
    text-align: center;
    color: rgba(255,255,255,.85);
    margin-bottom: 2rem;
    animation: fadeIn .8s ease .2s both;
}

/* Dynamic Push for Main Area */
.chat-input-container, .block-container {
    transition: padding-left 0.3s ease;
}

@media (min-width: 769px) { 
    body.sidebar-open .chat-input-container {
        padding-left: calc(300px + 20px) !important;
    }
    body.sidebar-open .block-container {
        padding-left: calc(300px + 1rem) !important; /* Base layout has 1rem padding + 300 sidebar */
        padding-right: 1rem !important;
    }
    .block-container {
        max-width: 1000px;
        margin: 0 auto;
        padding-top: 100px;
        padding-bottom: 200px;
    }
}
@media (max-width: 768px) {
    /* Mobile doesn't push, since the sidebar acts as a total overlay */
    .block-container {
        padding-top: 140px !important; /* Empurra o conteúdo pra baixo, fugindo do botão da sidebar */
    }
    .chat-input-container {
        bottom: 115px; /* Aumentado para compensar o footer de múltiplas linhas no mobile */
        padding: 5px 10px;
        z-index: 400 !important; /* Força que fique atrás da sidebar na versão mobile */
    }
    [data-testid="stChatInputSubmitButton"] {
        display: flex !important;
        position: absolute;
        right: 8px;
        bottom: 8px;
        width: 40px !important;
        height: 40px !important;
        padding: 5px !important;
        margin: 0 !important;
        z-index: 10;
        background: rgba(241,250,140,.3) !important;
    }
    [data-testid="stChatInputSubmitButton"] svg {
        display: block !important;
        width: 18px !important;
        height: 18px !important;
    }
    [data-testid="stChatInputTextArea"] {
        min-height: 44px;
        padding: 0.7rem 3rem 0.7rem 1.2rem !important; /* Add space on the right for the floating button */
        font-size: 0.95rem;
    }
}


[data-testid="stChatMessage"] {
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    max-width: 850px;
    width: 95%; /* Pequena margem lateral no mobile */
    border: 1px solid rgba(241,250,140,.18);
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
    padding: 1.2rem;
    transition: all .25s ease;
    margin: 0 auto 3.5rem auto; /* Sempre centralizado na área principal */
}

/* Bolha do Usuário (Destaque sutil) */
[data-testid="stChatMessage"].user-msg {
    background: rgba(241, 250, 140, 0.08); /* Tom sutil da cor principal */
    border-color: rgba(241, 250, 140, 0.4);
    box-shadow: 0 8px 24px rgba(241,250,140, 0.05);
}

/* Bolha do Agente (Padrão) */
[data-testid="stChatMessage"].agent-msg {
    margin-right: auto;
    margin-left: auto;
}

[data-testid="stChatMessage"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,.2);
}

/* ============================= */
/* MARDKOWN RENDER (TYPOGRAPHY)  */
/* ============================= */

.stMarkdown {
    color: #E2E8F0;
    line-height: 1.7;
    font-size: 1rem;
    word-wrap: break-word;
}

.stMarkdown h1, .stMarkdown h2, .stMarkdown h3, .stMarkdown h4, .stMarkdown h5 { 
    color: #f1fa8c; 
    font-weight: 700;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.stMarkdown h1 { font-size: 1.8rem; border-bottom: 1px solid rgba(241,250,140,0.2); padding-bottom: 0.4rem; }
.stMarkdown h2 { font-size: 1.5rem; border-bottom: 1px solid rgba(241,250,140,0.1); padding-bottom: 0.3rem; }
.stMarkdown h3 { font-size: 1.25rem; }

.stMarkdown p { 
    margin-bottom: 1rem; 
}

.stMarkdown strong {
    color: #f1fa8c;
    font-weight: 600;
}

.stMarkdown em {
    font-style: italic;
    color: #cbd5e1;
}

.stMarkdown ul, .stMarkdown ol {
    padding-left: 1.8rem;
    margin-bottom: 1rem;
}

.stMarkdown li {
    margin-bottom: 0.3rem;
}

.stMarkdown li > p {
    margin-bottom: 0.3rem;
}

.stMarkdown ul ul, .stMarkdown ol ol, .stMarkdown ul ol, .stMarkdown ol ul {
    margin-bottom: 0;
}

.stMarkdown blockquote {
    border-left: 4px solid #f1fa8c;
    color: #94a3b8;
    background: rgba(0,0,0,0.2);
    padding: 0.8rem 1.2rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.2rem;
    font-style: italic;
}

.stMarkdown blockquote p:last-child {
    margin-bottom: 0;
}

.stMarkdown code {
    background: rgba(0,0,0,0.3);
    color: #38bdf8;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.stMarkdown pre {
    background: #0f172a;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.2rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.stMarkdown pre code {
    background: transparent;
    color: #f8fafc;
    padding: 0;
    border: none;
    font-size: 0.9em;
}

.stMarkdown table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.95em;
}

.stMarkdown th, .stMarkdown td {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: left;
}

.stMarkdown th {
    background: rgba(241,250,140,0.1);
    color: #f1fa8c;
    font-weight: 600;
}

.stMarkdown tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.03);
}

.stMarkdown a {
    color: #f1fa8c;
    text-decoration: none;
    border-bottom: 1px dashed rgba(241,250,140,0.5);
    transition: all 0.2s;
}

.stMarkdown a:hover {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

.stMarkdown hr {
    border: 0;
    height: 1px;
    background: rgba(255,255,255,0.15);
    margin: 2rem 0;
}

.stMarkdown img { 
    max-width: 512px; 
    width: 100%;
    border-radius: 8px; 
    margin: 1.2rem auto; 
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.stMarkdown audio { 
    width: 100%; 
    margin: 1.2rem 0; 
    border-radius: 8px;
    outline: none;
}

/* INPUT DO CHAT */
.chat-input-container {
    position: fixed;
    bottom: 35px; /* Offset to sit above the footer */
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, #1E1E2F 0%, transparent 100%);
    z-index: 400; /* Fica atrás da Sidebar (500) se estiver sobreposta */
}

.chat-input-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    gap: 15px;
    align-items: center;
    position: relative;
}


[data-testid="stChatInputTextArea"] {
    flex-grow: 1;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border: 2px solid #f1fa8c;
    border-radius: 40px;
    padding: 0.9rem 1.6rem;
    min-height: 56px;
    transition: all .25s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
    color: #ffffff;
    font-size: 1rem;
    resize: none;
}
[data-testid="stChatInputTextArea"]::placeholder {
    color: rgba(255,255,255,0.6);
}

[data-testid="stChatInputTextArea"]:focus {
    border-color: #f1fa8c;
    box-shadow: 0 0 12px rgba(241,250,140,.5);
    background: rgba(255,255,255,0.08);
    outline: none;
}

[data-testid="stChatInputSubmitButton"] {
    background: rgba(241,250,140,.18);
    border-radius: 50%;
    transition: all .25s ease;
    border: none;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

[data-testid="stChatInputSubmitButton"]:hover {
    background: rgba(241,250,140,.35);
    transform: scale(1.05);
}
[data-testid="stChatInputSubmitButton"] svg { fill: #f1fa8c; width: 24px; height: 24px; }

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

/* ============================= */
/* AGENT LOADING & THINKING      */
/* ============================= */

.agent-loading-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.ear-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(241, 250, 140, 0.1);
    border-top: 2px solid #f1fa8c;
    border-radius: 50%;
    animation: ear-spin 0.8s linear infinite;
}

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

.dynamic-loading-text {
    font-size: 0.85rem;
    color: #f1fa8c;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.reasoning-details { 
    transition: all 0.3s ease; 
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.02);
}
.reasoning-details summary::marker { color: #f1fa8c; }
.reasoning-details[open] summary { border-bottom: 1px solid rgba(241, 250, 140, 0.1); padding-bottom: 8px; margin-bottom: 10px; }

/* Scrollbar do Pensamento do Agente */
.reasoning-details .stMarkdown::-webkit-scrollbar {
    width: 4px;
}
.reasoning-details .stMarkdown::-webkit-scrollbar-track {
    background: transparent;
}
.reasoning-details .stMarkdown::-webkit-scrollbar-thumb {
    background: rgba(241, 250, 140, 0.1);
    border-radius: 10px;
    transition: background 0.3s ease;
}
.reasoning-details .stMarkdown:hover::-webkit-scrollbar-thumb {
    background: rgba(241, 250, 140, 0.3);
}

/* Sidebar Selectors */
.sidebar-field { margin-bottom: 20px; display: flex; flex-direction: column; }
.sidebar-field label { font-size: 0.9rem; color: #f1fa8c; margin-bottom: 5px; font-weight: bold;}
.sidebar-field select {
    background: rgba(0, 0, 0, 0.2); 
    color: white; 
    border: 1px solid rgba(241, 250, 140, 0.3); 
    padding: 10px 12px; 
    border-radius: 10px; 
    width: 100%; 
    outline: none; 
    margin-bottom: 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.sidebar-field select:hover {
    border-color: #f1fa8c;
    background: rgba(241, 250, 140, 0.05);
}

/* ====== DONATE MODAL AND BUTTON ====== */
.btn-donate-app {
    background: transparent;
    border: 1px solid rgba(241,250,140, 0.4);
    color: #f1fa8c;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(5px);
}
.btn-donate-app:hover {
    background: rgba(241,250,140, 0.15);
    border-color: #f1fa8c;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}
.modal-content {
    background: #1E1E2F;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 2rem;
    border-radius: 16px;
    width: 90%; max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    color: white;
}
.modal-close {
    position: absolute; top: 15px; right: 15px;
    background: none; border: none; color: white;
    font-size: 1.2rem; cursor: pointer; opacity: 0.7;
}
.modal-close:hover { opacity: 1; color: #f1fa8c; }
.sidebar-field select option { background: #2A2A40; }

/* FOOTER */
.footer { position: fixed; bottom: 0; left: 0; width: 100%; background: linear-gradient(135deg, #1E1E2F 0%, #2A2A40 100%); color: #ffffff; font-size: 0.85rem; border-top: 1px solid rgba(241, 250, 140, 0.3); backdrop-filter: blur(10px); z-index: 9999; padding: 0.6rem 0; box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); }
.footer-container { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 0 16px; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; }
.footer a { color: #ffffff; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: all 0.25s ease; font-weight: 500; }
.footer a:hover { transform: translateY(-2px); }
.footer svg { width: 16px; height: 16px; fill: #ffffff; }
.separator { color: #ffffff; font-weight: 300; }
.credit b { font-weight: 600; color: #ffffff; }
.visitor-badge { background: rgba(241, 250, 140, 0.1); border: 1px solid #f1fa8c; padding: 2px 8px; border-radius: 12px; font-size: 0.8rem; color: #f1fa8c; }
@media (max-width: 768px) { 
    .footer { font-size: 0.8rem; padding: 0.5rem 0; } 
    .footer-container { gap: 8px; padding: 0 12px; } 
}

/* ====== ACTION BUTTONS (LESSONS & CHAT) ====== */
.view-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(44, 46, 58, 0.4);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.05);
    flex-wrap: wrap;
}

.btn-action {
    padding: 10px 20px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-pdf { background: rgba(241, 250, 140, 0.18); color: #f1fa8c; border: 1px solid #f1fa8c; }
.btn-anki { background: rgba(80, 250, 123, 0.18); color: #50fa7b; border: 1px solid #50fa7b; }
.btn-share { background: rgba(139, 233, 253, 0.18); color: #8be9fd; border: 1px solid #8be9fd; }
.btn-back { background: rgba(255,255,255,0.1); color: #ccc; }

.btn-action:hover { transform: translateY(-2px); filter: brightness(1.2); }

@media (max-width: 768px) {
    .view-actions { flex-direction: column; width: 100%; }
    .btn-action { width: 100%; justify-content: center; }
}
/* ============================= */
/* AUTH & PILLS */
/* ============================= */

.user-auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.google-login-wrapper {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.google-login-wrapper:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.google-login-wrapper .g_id_signin {
    opacity: 0.95;
    transition: opacity 0.2s ease;
}

.google-login-wrapper:hover .g_id_signin {
    opacity: 1;
}

@media (max-width: 600px) {
    .google-login-wrapper {
        padding: 2px 4px;
        background: transparent;
        border: none;
        backdrop-filter: none;
    }
    .google-login-wrapper .g_id_signin[data-size="large"] {
        transform: scale(0.8);
        transform-origin: center center;
    }
}
@media (max-width: 400px) {
    .google-login-wrapper .g_id_signin[data-size="large"] {
        transform: scale(0.7);
    }
}



.login-btn-google {
    background: #ffffff;
    color: #3c4043;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
    transition: all 0.2s;
}

.login-btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-profile-pill:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #f1fa8c;
}

.user-profile-pill img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #f1fa8c;
}

.user-profile-pill span {
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.conv-history-pill {
    background: rgba(241, 250, 140, 0.15);
    color: #f1fa8c;
    border: 1px solid rgba(241, 250, 140, 0.4);
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(241, 250, 140, 0.1);
}

.conv-history-pill:hover {
    background: rgba(241, 250, 140, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 250, 140, 0.2);
}

.conv-history-pill svg {
    width: 16px;
    height: 16px;
    fill: #f1fa8c;
}

/* LISTA DE CONVERSAS NO MODAL */
.conv-list {
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
    padding-right: 10px;
}

.conv-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.conv-item:hover {
    background: rgba(241, 250, 140, 0.1);
    border-color: #f1fa8c;
    transform: translateX(5px);
}

.conv-item-link {
    text-decoration: none;
    flex: 1;
    min-width: 0; /* Permite que o flex child diminua abaixo do tamanho do conteúdo */
}

.conv-item-title {
    color: #f1fa8c;
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* No máximo 2 linhas */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal; /* Permite quebrar linha */
}

.conv-item-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.conv-list::-webkit-scrollbar { width: 6px; }
.conv-list::-webkit-scrollbar-track { background: transparent; }
.conv-list::-webkit-scrollbar-thumb { background: rgba(241, 250, 140, 0.3); border-radius: 10px; }

@media (max-width: 600px) {
    .custom-navbar-links { display: none !important; }
    .user-auth-section { gap: 8px; }
    .user-profile-pill span { display: none; }
    .conv-history-pill span, 
    .conv-history-pill text,
    .conv-history-pill { 
        padding: 6px;
        font-size: 0; /* Hides text but keeps button accessible */
    }
    .conv-history-pill svg { margin: 0; width: 20px; height: 20px; }
}


/* ============================= */
/* MODAL DIALOG PREMIUM          */
/* ============================= */

.eardialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 10, 20, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.eardialog-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.eardialog-box {
    background: linear-gradient(145deg, rgba(40, 42, 64, 0.95), rgba(30, 32, 52, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 36px 40px 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04) inset;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    opacity: 0;
    text-align: center;
}

.eardialog-overlay.visible .eardialog-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.eardialog-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
}

.eardialog-icon.info    { background: rgba(139, 233, 253, 0.12); box-shadow: 0 0 24px rgba(139, 233, 253, 0.25); }
.eardialog-icon.warn    { background: rgba(255, 184, 108, 0.12); box-shadow: 0 0 24px rgba(255, 184, 108, 0.25); }
.eardialog-icon.danger  { background: rgba(255, 85, 85, 0.12);   box-shadow: 0 0 24px rgba(255, 85, 85, 0.25); }
.eardialog-icon.success { background: rgba(80, 250, 123, 0.12);  box-shadow: 0 0 24px rgba(80, 250, 123, 0.25); }

.eardialog-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f8f8f2;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.eardialog-message {
    font-size: 0.95rem;
    color: rgba(248, 248, 242, 0.65);
    line-height: 1.6;
    margin-bottom: 28px;
}

.eardialog-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.eardialog-btn {
    padding: 11px 28px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.eardialog-btn:hover { transform: translateY(-2px); filter: brightness(1.15); }
.eardialog-btn:active { transform: translateY(0); }

.eardialog-btn.cancel {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(248, 248, 242, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.eardialog-btn.cancel:hover { background: rgba(255, 255, 255, 0.12); }

.eardialog-btn.confirm-info    { background: linear-gradient(135deg, #8be9fd, #50d0fa); color: #1a1a2e; }
.eardialog-btn.confirm-warn    { background: linear-gradient(135deg, #ffb86c, #ff9c4a); color: #1a1a2e; }
.eardialog-btn.confirm-danger  { background: linear-gradient(135deg, #ff5555, #cc2222); color: #fff; }
.eardialog-btn.confirm-success { background: linear-gradient(135deg, #50fa7b, #27c95a); color: #1a1a2e; }
