/* ============================================
   🎨 SALVEER IA STUDIO - ESTILO COMPLETO
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --secondary: #a855f7;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== 📍 HEADER - ALINHADO ==========*/
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

header > div {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ========== 📋 MAIN - CENTRALIZADO ==========*/
main {
    flex: 1;
    width: 100%;
    padding-top: 120px;
    padding-bottom: 2rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    margin: 0 auto;
}

/* ========== 🎯 GRID LAYOUT - RESPONSIVO ==========*/
.max-w-7xl {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.grid {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    margin: 0 auto;
}

/* Desktop: 3 colunas */
@media (min-width: 1024px) {
    .grid-cols-1 {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .lg\:col-span-1 {
        grid-column: span 1;
    }
}

/* Tablet: 1 coluna */
@media (max-width: 1023px) {
    .grid-cols-1 {
        grid-template-columns: 1fr;
    }
    
    main {
        padding-top: 100px;
    }
}

/* Mobile: Ajustado */
@media (max-width: 768px) {
    main {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 90px;
    }
    
    header > div {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ========== 🎛️ PAINÉIS - ALINHAMENTO ==========*/
.bg-gradient-to-br,
.bg-gradient-to-r {
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin: 0;
}

/* ========== 📝 INPUTS - ALINHADOS ==========*/
input, 
textarea, 
select {
    font-family: inherit;
    transition: all 0.3s ease;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 2px solid rgba(99, 102, 241, 0.2);
    background: rgba(30, 41, 59, 0.8);
    color: white;
    font-size: 0.875rem;
}

input:focus, 
textarea:focus, 
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ========== 🔘 BOTÕES - ALINHADOS ==========*/
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: all 0.3s ease;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-align: center;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
}

/* ========== 📊 SCROLLBAR ==========*/
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a855f7;
}

/* ========== 💬 CHAT ==========*/
#chatMessages {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
}

.chat-message {
    animation: slideIn 0.3s ease;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    max-width: 100%;
    word-wrap: break-word;
    width: fit-content;
    max-width: 90%;
}

.chat-message.user {
    background: linear-gradient(to right, #6366f1, #a855f7);
    color: white;
    margin-left: auto;
    align-self: flex-end;
}

.chat-message.ai {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #6366f1;
    margin-right: auto;
    align-self: flex-start;
}

/* ========== 💻 CODE BLOCKS ==========*/
pre {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 1rem;
    overflow-x: auto;
    color: #10b981;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    width: 100%;
    max-height: 200px;
}

/* ========== ✨ ANIMAÇÕES ==========*/
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-slide {
    animation: slideIn 0.3s ease;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ========== 🌙 DARK MODE ==========*/
.dark body {
    background: #0f172a;
}

/* ========== 📱 MOBILE FIRST ==========*/
@media (max-width: 640px) {
    .grid-cols-1 {
        grid-template-columns: 1fr !important;
    }
    
    .chat-message {
        max-width: 100%;
        width: auto;
    }
    
    button, input, textarea, select {
        font-size: 16px;
    }
}
