/* 
    OrionX Premium Design System
    Estilo Moderno / Glassmorphism / Mobile-First
*/

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --accent: #818cf8;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --msg-sent: #0ea5e9;
    --msg-received: #334155;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden; /* Mantém a rolagem apenas nos containers internos */
    height: 100dvh;
    width: 100vw;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

/* Utilitários de Animação */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.hidden {
    display: none !important;
}

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

/* Layout SPA */
#app {
    height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Telas (Ocultas por padrão) */
.screen {
    display: none;
    height: 100%;
    width: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Estilo de Inputs */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

input[type="text"], input[type="tel"], input[type="password"], textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    outline: none;
    transition: var(--transition);
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Botões */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Login/Signup Visual */
.auth-container {
    padding: 2rem;
    max-width: 400px;
    margin: auto;
    width: 100%;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Chat List */
.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
}

.chat-item:hover {
    background: var(--glass);
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-border);
    margin-right: 12px;
    object-fit: cover;
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-last-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chat Header */
.app-header {
    padding: 16px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
}

/* FloatingActionButton */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 90;
}

#file-preview {
    border: 2px solid var(--primary) !important;
    box-shadow: 0 0 15px var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Imagens no Chat */
.chat-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    margin-bottom: 8px;
    display: block;
    cursor: pointer;
    transition: var(--transition);
}

.chat-image:hover {
    filter: brightness(0.9);
}

/* Estilo Mobile */
@media (max-width: 600px) {
    .auth-container {
        padding: 1rem;
    }
}
