@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --bg-color: #0e1015;
    --sidebar-bg-color: #050507;
    --input-bg-color: #1a1d24;

    --text-color: #e5e7eb;
    --placeholder-color: #8b8f9c;

    --border-color: rgba(255,255,255,0.08);

    --accent-color: #6366f1;
    --accent-glow: rgba(99,102,241,0.6);

    --user-msg-bg: linear-gradient(135deg, #3b82f6, #6366f1);
    --ai-msg-bg: rgba(255,255,255,0.06);
}

/* --- ESTRUTURA PRINCIPAL --- */
body {
    font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(90deg,rgba(10, 4, 4, 1) 0%, rgba(37, 42, 99, 1) 98%);
    color: var(--text-color);
    margin: 0;
    padding: 10px;
    display: flex;
    height: 98vh;
    overflow: hidden;
}

/* --- COLUNA ESQUERDA: SIDEBAR --- */
.sidebar {
    background: rgba(10, 4, 4, 0.17);
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(7.8px);
    border: 1px solid rgba(255, 255, 255, 0.34);
    display: flex;
    width: 290px;
    justify-content: space-between;
    padding: 15px; 
    padding-bottom: 15px;   
    padding-right: 0;
    gap: 3%;
    box-sizing: border-box;
    
}

.containercontent{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100vw;
}

/* --- RESIZER --- */
.sidebar-resizer {
    cursor: ew-resize;
    background: transparent;
    height: 100vh;
    width: 7%;
}



.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    font-family: 'Montserrat', 'sans-serif';
    font-size: 1.5em;
    font-weight: 600;
}
.logo:hover{
    transform: scale(1.05);
    color: var(--accent-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Botão Novo Chat */
.new-chat-btn {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    border: 1px solid rgba(99,102,241,0.4);
    border-radius: 40px;
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    backdrop-filter: blur(6px);
    transition: all 0.25s ease;
    font-size: 0.9em;
    font-family: Poppins;
}
.new-chat-btn:hover {
    box-shadow: 0 0 12px var(--accent-glow);
    transform: translateY(-1px);
}

/* Histórico */
.chat-history {
    flex-grow: 1;
    overflow-y: auto;
}

.history-item {
    position: relative;
    padding: 10px;
    color: #f7f7f7;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.history-item:focus,
.history-item:hover,
.history-item.active {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.4);
    box-shadow: 0 0 10px rgba(99,102,241,0.15);
}


.chat-actions {
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
}
.chat-actions:hover {
    color: white;
}

.chat-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 38px;
    background: #111;
    border: 1px solid #333;
    border-radius: 6px;
    width: 120px;
    z-index: 10;
}
.chat-menu-item {
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
}
.chat-menu-item:hover {
    background: #222;
}

/* Footer da sidebar */
.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    padding-bottom: 20px;
    font-size: 0.9em;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.settings-btn {
    text-decoration: none;
    font-size: 20px;
}

.settings-btn:hover {
    opacity: 1;
}

i{
    color:white;
    font-size: 18px;
}

i:hover{
    color: rgb(219, 219, 219);
    transform: scale(1.06);
    transition: all 0.3s ease;
}

.login-btn {
    color: white;
    font-size: 18px;
    text-decoration: none;
    padding: 10px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s ease;
}
.login-btn:hover {
    transform:translateY(-3px);
    box-shadow: 0px 0px 10px 5px var(--accent-glow);
}

.perso-btn {
    color: white;
    font-size: 18px;
    text-decoration: none;
    padding: 10px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s ease;

    /* 🔥 animação contínua */
    animation: persoPulse 1.8s infinite ease-in-out;
}

.perso-btn:hover {
    transform: translateY(-2px) ;
    box-shadow: 0px 0px 10px 5px var(--accent-glow);
}

/* 🎯 animação de pulsar */
@keyframes persoPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 10px 3px rgba(99, 102, 241, 0.9);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6);
    }
}


.logout-btn{
     color: white;
    font-size: 18px;
    text-decoration: none;
    border: none;
    padding: 10px;
    background: linear-gradient(90deg,rgba(204, 59, 62, 1) 0%, rgba(196, 45, 123, 1) 98%);
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    transform:translateY(-3px);
    box-shadow: 0px 0px 10px 5px rgba(204, 59, 62, 0.6);
}

/* --- COLUNA DIREITA: CHAT --- */
.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* Janela de Chat */
.chat-window {
    cursor: pointer;
    row-gap: 30px;
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
}


/* Mensagem inicial */
.welcome-message {
    margin: auto;
    text-align: center;
}
.welcome-message h1,
.welcome-message h2 {
    
    font-size: 3.5em;
    font-weight: 600;
}

.welcome-message h1{
    margin: 0;
}

.welcome-message h2 {
    color: var(--accent-color);
    font-size: 4.5em;    
    margin: 0;
}

/* Mensagens */
.message {
    margin-bottom: 15px;
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 65%;
    width: fit-content;
    line-height: 1.6;
    box-shadow: 8px 8px 25px 5px rgba(0, 0, 0, 0.35);
    animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-msg {
    background: var(--user-msg-bg);
    color: white;
    margin-left: auto;
    box-shadow: 0 0 15px rgba(59,130,246,0.4);
}

.ai-msg {
    background: var(--ai-msg-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    margin-right: auto;
}

/* Mídia */
.message img,
.message video {
    width: 100%;
    border-radius: 8px;
}

/* --- ÁREA DE INPUT --- */
.bottom-area {
    position: relative;
    bottom: 0;
    width: 100%;
    padding: 20px;
    padding-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}


/* Sugestões */
.suggestions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.suggestion-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    transition: all 0.2s ease;
}
.suggestion-btn:hover {
    background: rgba(99,102,241,0.15);
    box-shadow: 0 0 12px rgba(99,102,241,0.3);
}

/* Input */
.input-group {
    display: flex;
    align-items: center;
    background: rgba(26,29,36,0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 40px;
    padding: 8px 12px;
    width: 100%;
    max-width: 800px;
    transition: all 0.3s ease;
}
.input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 25px rgba(99,102,241,0.35);
}

#userInput {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    padding: 10px;
    font-size: 1em;
    resize: none;
}

#sendBtn {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: white;
    font-size: 20px;
    border: none;
    border-radius: 40px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(99,102,241,0.6);
    transition: all 0.2s ease;
}
#sendBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(99,102,241,0.9);
}

/* Footer */
.chat-footer {
    padding-top: 15px;
    font-size: 0.8em;
    color: var(--placeholder-color);
    text-align: center;
}

/* Scrollbar */
.chat-window::-webkit-scrollbar,
.chat-history::-webkit-scrollbar {
    width: 8px;
}
.chat-window::-webkit-scrollbar-thumb,
.chat-history::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.2);
    border-radius: 4px;
}



/* ===== FORMATAÇÃO DE TEXTO DA IA (Markdown-like) ===== */

.message h1 {
  font-size: 1.4em;
  margin: 14px 0 10px;
}

.message h2 {
  font-size: 1.25em;
  margin: 12px 0 8px;
}

.message h3 {
  font-size: 1.1em;
  margin: 10px 0 6px;
}

.message strong {
  font-weight: 600;
}

.message ul {
  margin: 8px 0 12px 20px;
  padding-left: 10px;
}

.message li {
  margin-bottom: 6px;
}

.message p {
  margin: 0 0 10px;
}

