/* style.css - Folha de Estilos para o aplicativo EduAI */

/* Estilos Gerais e Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-color: #1a1a1a;
    --card-color: #2b2b2b;
    --text-color: #e0e0e0;
    --accent-color: #007bff; /* Azul vibrante para destaque */
    --input-bg: #3c3c3c;
    --border-color: #555;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

html, body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Containers de Tela */
.screen {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    border-radius: 1rem;
    background-color: var(--card-color);
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
    position: relative;
    z-index: 10;
}

.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.visible {
    display: block;
    opacity: 1;
    transform: scale(1);
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Títulos e Subtítulos */
.luxury-header {
    text-align: center;
    margin-bottom: 2rem;
}

.luxury-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.luxury-subtitle {
    font-size: 1rem;
    color: #999;
}

.accent {
    color: var(--accent-color);
}

/* Formulários de Autenticação */
.auth-switcher {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.auth-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease-in-out;
}

.auth-btn.active {
    color: var(--text-color);
}

.auth-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background-color: var(--accent-color);
    border-radius: 1px;
}

.auth-form {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.auth-form.active {
    display: block;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.luxury-input {
    width: 100%;
    padding: 1rem;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s ease-in-out;
}

.luxury-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px var(--accent-color);
}

.luxury-label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
}

.luxury-input:focus + .luxury-label,
.luxury-input:not(:placeholder-shown) + .luxury-label {
    top: 0;
    left: 0.5rem;
    font-size: 0.75rem;
    color: var(--accent-color);
    background-color: var(--input-bg);
    padding: 0 0.5rem;
    transform: translateY(-50%);
}

.luxury-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.luxury-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Partículas de fundo */
.luxury-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #1a1a1a;
}

.particles-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    background-color: var(--accent-color);
    border-radius: 50%;
    opacity: 0;
    animation: move-particle 20s infinite ease-in-out;
}

.particle:nth-child(1) {
    width: 10px;
    height: 10px;
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}
.particle:nth-child(2) {
    width: 8px;
    height: 8px;
    top: 50%;
    left: 70%;
    animation-delay: 4s;
}
.particle:nth-child(3) {
    width: 12px;
    height: 12px;
    top: 80%;
    left: 40%;
    animation-delay: 8s;
}
.particle:nth-child(4) {
    width: 6px;
    height: 6px;
    top: 30%;
    left: 90%;
    animation-delay: 12s;
}
.particle:nth-child(5) {
    width: 14px;
    height: 14px;
    top: 95%;
    left: 10%;
    animation-delay: 16s;
}

@keyframes move-particle {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translate(calc(var(--rand-x) * 100vw), calc(var(--rand-y) * 100vh));
        opacity: 0;
    }
}

/* Estilos do Chat */
.chat-container {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    height: 90vh;
    padding: 0;
    border-radius: 1rem;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.chat-title {
    font-size: 2rem;
    font-weight: 700;
}

.chat-subtitle {
    font-size: 0.9rem;
    color: #999;
}

.logout-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.logout-btn:hover {
    background-color: var(--input-bg);
    border-color: var(--accent-color);
}

.chat-tabs {
    display: flex;
    justify-content: space-around;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    background: none;
    border: none;
    color: #999;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease-in-out;
}

.tab.active {
    color: var(--accent-color);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background-color: var(--accent-color);
    border-radius: 1px;
}

.chat-content {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    padding: 1.5rem;
    border-right: 1px solid var(--border-color);
    background-color: #222;
    display: none; /* Oculta a barra lateral em telas menores */
}

.sidebar-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.topic-list {
    display: flex;
    flex-direction: column;
}

.topic-item {
    background-color: var(--input-bg);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.topic-item:hover {
    background-color: var(--accent-color);
}

.chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.message {
    display: flex;
    align-items: flex-end;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-in-out;
}

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

.message.ai {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    background-color: var(--input-bg);
    padding: 1rem 1.25rem;
    border-radius: 1.5rem;
    max-width: 80%;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.message.user .message-content {
    background-color: var(--accent-color);
}

.message-time {
    font-size: 0.7rem;
    color: #888;
    margin: 0 0.5rem;
}

.input-area {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.input-container {
    display: flex;
    align-items: center;
    background-color: var(--input-bg);
    border-radius: 1.5rem;
    padding: 0.5rem 1rem;
}

.luxury-textarea {
    flex-grow: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 1rem;
    padding: 0.5rem;
    resize: none;
    transition: height 0.3s ease;
    max-height: 150px;
}

.send-btn {
    background-color: var(--accent-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn svg {
    color: white;
    width: 20px;
    height: 20px;
}

/* Mensagens de Feedback */
.message-box {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    color: #fff;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.message-box.info {
    background-color: #28a745;
}

.message-box.error {
    background-color: #dc3545;
}

/* Responsividade para Telas Grandes */
@media (min-width: 768px) {
    .container.screen {
        max-width: 800px;
        height: 90vh;
        padding: 0;
        display: flex;
        flex-direction: column;
    }
    
    .chat-container {
        flex-direction: row;
        height: 90vh;
    }
    
    .chat-content {
        flex-grow: 1;
    }

    .sidebar {
        display: flex;
        flex-direction: column;
    }
}
