/* ========================================
   AI Site Builder - Estilos Principais
   ======================================== */

:root {
    /* Cores Roxas - Tema Principal */
    --ai-purple-900: #4c1d95;
    --ai-purple-800: #5b21b6;
    --ai-purple-700: #6d28d9;
    --ai-purple-600: #7c3aed;
    --ai-purple-500: #8b5cf6;
    --ai-purple-400: #a78bfa;
    --ai-purple-300: #c4b5fd;
    --ai-purple-200: #ddd6fe;
    --ai-purple-100: #ede9fe;
    
    /* Cores Complementares */
    --ai-pink-500: #ec4899;
    --ai-blue-500: #3b82f6;
    --ai-cyan-500: #06b6d4;
    
    /* Cores Neutras */
    --ai-gray-900: #111827;
    --ai-gray-800: #1f2937;
    --ai-gray-700: #374151;
    --ai-gray-600: #4b5563;
    --ai-gray-500: #6b7280;
    --ai-gray-400: #9ca3af;
    --ai-gray-300: #d1d5db;
    --ai-gray-200: #e5e7eb;
    --ai-gray-100: #f3f4f6;
    --ai-gray-50: #f9fafb;
    
    /* Sombras e Efeitos */
    --ai-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ai-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --ai-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --ai-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --ai-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Gradientes */
    --ai-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --ai-gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --ai-gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --ai-gradient-cyber: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
}

/* Container Principal */
.ai-site-builder-container {
    display: flex;
    width: 100%;
    height: 90vh;
    min-height: 600px;
    background: var(--ai-gray-900);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--ai-shadow-xl);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ========================================
   SEÇÃO DO CHAT (30%)
   ======================================== */

.ai-chat-section {
    width: 30%;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: hidden;
}

/* Efeito de brilho no fundo */
.ai-chat-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Header do Chat */
.ai-chat-header {
    padding: 24px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.ai-header-icon {
    width: 48px;
    height: 48px;
    background: var(--ai-gradient-purple);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.4);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.ai-header-text h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    background: var(--ai-gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #10b981;
    font-weight: 500;
}

.ai-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Mensagens do Chat */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: var(--ai-purple-600);
    border-radius: 3px;
}

.ai-message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message-bot .ai-message-avatar {
    background: var(--ai-gradient-purple);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.ai-message-user .ai-message-avatar {
    background: var(--ai-gradient-cyber);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.ai-message-content {
    flex: 1;
    background: rgba(55, 65, 81, 0.6);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.ai-message-bot .ai-message-content {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.ai-message-user .ai-message-content {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.3);
}

.ai-message-content p {
    margin: 0;
    color: var(--ai-gray-100);
    font-size: 14px;
    line-height: 1.6;
}

.ai-message-user {
    flex-direction: row-reverse;
}

/* Input do Chat */
.ai-chat-input-wrapper {
    padding: 20px;
    background: rgba(17, 24, 39, 0.8);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    position: relative;
    z-index: 1;
}

.ai-chat-input-container {
    display: flex;
    gap: 12px;
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 12px;
    transition: all 0.3s ease;
}

.ai-chat-input-container:focus-within {
    border-color: var(--ai-purple-500);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.ai-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--ai-gray-100);
    font-size: 14px;
    resize: none;
    max-height: 120px;
    font-family: inherit;
}

.ai-chat-input::placeholder {
    color: var(--ai-gray-500);
}

.ai-send-button {
    width: 40px;
    height: 40px;
    background: var(--ai-gradient-purple);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.ai-send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.6);
}

.ai-send-button:active {
    transform: translateY(0);
}

.ai-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-input-hint {
    margin-top: 8px;
    font-size: 11px;
    color: var(--ai-gray-500);
    text-align: center;
}

/* ========================================
   SEÇÃO DO PREVIEW (70%)
   ======================================== */

.ai-preview-section {
    width: 70%;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Efeito de grade no fundo */
.ai-preview-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

/* Header do Preview */
.ai-preview-header {
    padding: 20px 24px;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.ai-preview-tabs {
    display: flex;
    gap: 8px;
    background: rgba(31, 41, 55, 0.6);
    padding: 4px;
    border-radius: 12px;
}

.ai-preview-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--ai-gray-400);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-preview-tab:hover {
    color: var(--ai-gray-200);
    background: rgba(139, 92, 246, 0.1);
}

.ai-preview-tab.active {
    background: var(--ai-gradient-purple);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.ai-action-button {
    width: 36px;
    height: 36px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    color: var(--ai-purple-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ai-action-button:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--ai-purple-500);
    color: var(--ai-purple-300);
    transform: rotate(180deg);
}

/* Conteúdo do Preview */
.ai-preview-content {
    flex: 1;
    overflow: auto;
    position: relative;
    z-index: 1;
    background: rgba(15, 23, 42, 0.6);
}

.ai-preview-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ai-preview-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.ai-preview-content::-webkit-scrollbar-thumb {
    background: var(--ai-purple-600);
    border-radius: 4px;
}

/* Placeholder do Preview */
.ai-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.ai-placeholder-icon {
    width: 120px;
    height: 120px;
    background: rgba(139, 92, 246, 0.1);
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ai-purple-400);
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}

.ai-preview-placeholder h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
    background: var(--ai-gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-preview-placeholder p {
    margin: 0;
    color: var(--ai-gray-400);
    font-size: 14px;
    line-height: 1.6;
    max-width: 400px;
}

.ai-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    border-radius: 0;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 1024px) {
    .ai-site-builder-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .ai-chat-section,
    .ai-preview-section {
        width: 100%;
    }
    
    .ai-chat-section {
        height: 500px;
        border-right: none;
        border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    }
    
    .ai-preview-section {
        min-height: 500px;
    }
}

@media (max-width: 640px) {
    .ai-chat-header {
        padding: 16px;
    }
    
    .ai-header-icon {
        width: 40px;
        height: 40px;
    }
    
    .ai-header-text h2 {
        font-size: 18px;
    }
    
    .ai-chat-messages {
        padding: 16px;
    }
    
    .ai-preview-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .ai-preview-tabs {
        justify-content: center;
    }
}

/* ========================================
   ANIMAÇÕES E EFEITOS ESPECIAIS
   ======================================== */

/* Efeito de digitação */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* Efeito de piscar cursor */
@keyframes blink-cursor {
    from, to { border-color: transparent; }
    50% { border-color: var(--ai-purple-500); }
}

/* Efeito de carregamento */
.ai-loading {
    display: inline-flex;
    gap: 4px;
}

.ai-loading span {
    width: 8px;
    height: 8px;
    background: var(--ai-purple-500);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.ai-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}
