/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --accent: #4a9eff;
    --accent-hover: #3d8bdb;
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Página de Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 10px 30px var(--shadow);
    text-align: center;
}

.login-box h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--accent), #66b3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon {
    font-size: 2.5rem;
    display: inline-block;
    margin-right: 10px;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

.logo-text {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent);
    background: none !important;
    -webkit-text-fill-color: var(--accent) !important;
    border: 2px solid var(--accent);
    padding: 2px 8px;
    border-radius: 6px;
    margin-right: 10px;
    display: inline-block;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.btn-login:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.error-message {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.demo-users {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.demo-users h3 {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 1rem;
}

.user-demo {
    margin-bottom: 8px;
    color: var(--text-muted);
}

.user-demo strong {
    color: var(--text-primary);
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
}

.chat-header {
    background: var(--bg-secondary);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-left h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.header-left .logo-icon {
    font-size: 1.8rem;
    margin-right: 8px;
}

.user-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.user-level {
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 8px;
}

.btn-logout {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.btn-logout:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

/* Chat Main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    scroll-behavior: smooth;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    background: var(--bg-secondary);
    padding: 40px 30px;
    border-radius: 12px;
    margin: 50px 0;
}

.welcome-message h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--accent);
}

.welcome-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Messages */
.message-group {
    margin-bottom: 30px;
}

.message {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    max-width: 85%;
    position: relative;
}

.user-message {
    margin-left: auto;
    background: var(--accent);
    color: white;
}

.ai-message {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.message-author {
    font-weight: 600;
}

.message-time {
    opacity: 0.7;
}

.user-message .message-time {
    opacity: 0.8;
}

.message-content {
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-secondary);
    margin: 20px 30px;
    border-radius: 12px;
    gap: 15px;
}

.loading-dots {
    display: flex;
    gap: 5px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: loading-bounce 1.4s infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Chat Form */
.chat-form {
    background: var(--bg-secondary);
    padding: 25px 30px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-form textarea {
    flex: 1;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    resize: none;
    min-height: 60px;
    max-height: 150px;
    transition: all 0.3s ease;
}

.chat-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.chat-form textarea::placeholder {
    color: var(--text-muted);
}

.chat-form button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
    justify-content: center;
}

.chat-form button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.chat-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.send-icon {
    font-size: 16px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .chat-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .chat-messages {
        padding: 20px 15px;
    }
    
    .message {
        max-width: 95%;
        padding: 15px;
    }
    
    .chat-form {
        padding: 20px 15px;
        flex-direction: column;
        gap: 12px;
    }
    
    .chat-form button {
        align-self: stretch;
    }
    
    .welcome-message {
        margin: 20px 0;
        padding: 30px 20px;
    }
    
    .welcome-message h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 15px;
    }
    
    .chat-header h1 {
        font-size: 1.5rem;
    }
    
    .user-info {
        font-size: 0.9rem;
    }
    
    .message-content {
        font-size: 0.95rem;
    }
}

/* Animações suaves */
.message {
    animation: fadeInUp 0.3s ease-out;
}

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