/* Lingoloop AI Site Generator - Estilos CSS Premium */

/* Importar fonte Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset e configurações globais */
* {
    box-sizing: border-box;
}

#lingoloop-container {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #EEEEEE;
    background-color: #121212;
    overflow: hidden;
}

/* Container principal - Layout Flexbox */
#lingoloop-container {
    display: flex;
    width: 100%;
    height: 100vh;
    background-color: #121212;
}

/* ===== COLUNA ESQUERDA - PREVIEW DO SITE (70%) ===== */
#lingoloop-preview-area {
    flex: 0 0 70%;
    display: flex;
    flex-direction: column;
    background-color: #1E1E1E;
    border-right: 1px solid #333333;
}

/* Área de abas */
#lingoloop-tabs {
    display: flex;
    background-color: #2A2A2A;
    border-bottom: 1px solid #333333;
    padding: 0 20px;
    height: 50px;
    align-items: center;
}

.lingoloop-tab {
    padding: 12px 20px;
    margin-right: 8px;
    background-color: transparent;
    color: #AAAAAA;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.lingoloop-tab:hover {
    background-color: #3A3A3A;
    color: #EEEEEE;
}

.lingoloop-tab.active {
    background-color: #1E1E1E;
    color: #EEEEEE;
    border-bottom: 2px solid #4A9EFF;
}

/* Frame de preview */
#lingoloop-preview-frame {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: #1E1E1E;
    overflow: auto;
}

.lingoloop-placeholder {
    text-align: center;
    color: #888888;
    font-size: 18px;
    font-weight: 400;
    max-width: 400px;
    line-height: 1.6;
}

/* Placeholders para seções */
.lingoloop-section-placeholder {
    background-color: #2A2A2A;
    border: 1px solid #444444;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 600px;
}

.lingoloop-section-placeholder:hover {
    background-color: #3A3A3A;
    border-color: #555555;
}

.lingoloop-placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #EEEEEE;
    margin-bottom: 8px;
}

.lingoloop-placeholder-status {
    font-size: 13px;
    color: #AAAAAA;
    font-style: italic;
}

/* Containers de páginas */
.lingoloop-page-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Seções geradas */
.lingoloop-section {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Estilos para o HTML gerado pelas seções */
.lingoloop-section * {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.lingoloop-section img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.lingoloop-section h1,
.lingoloop-section h2,
.lingoloop-section h3,
.lingoloop-section h4,
.lingoloop-section h5,
.lingoloop-section h6 {
    color: #EEEEEE;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.lingoloop-section p {
    color: #CCCCCC;
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.lingoloop-section a {
    color: #4A9EFF;
    text-decoration: none;
    transition: color 0.2s ease;
}

.lingoloop-section a:hover {
    color: #3A8EEF;
}

.lingoloop-section button,
.lingoloop-section .btn {
    background-color: #4A9EFF;
    color: #FFFFFF;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.lingoloop-section button:hover,
.lingoloop-section .btn:hover {
    background-color: #3A8EEF;
    transform: translateY(-1px);
}

/* ===== COLUNA DIREITA - ÁREA DO CHAT (30%) ===== */
#lingoloop-chat-area {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    background-color: #1A1A1A;
}

/* Header do chat com botões */
.lingoloop-chat-header {
    padding: 20px;
    border-bottom: 1px solid #333333;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Estilos dos botões */
.lingoloop-btn {
    padding: 8px 16px;
    background-color: #2A2A2A;
    color: #EEEEEE;
    border: 1px solid #444444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.lingoloop-btn:hover {
    background-color: #3A3A3A;
    border-color: #555555;
}

.lingoloop-btn:active {
    transform: translateY(1px);
}

.lingoloop-btn-primary {
    background-color: #4A9EFF;
    border-color: #4A9EFF;
    color: #FFFFFF;
}

.lingoloop-btn-primary:hover {
    background-color: #3A8EEF;
    border-color: #3A8EEF;
}

/* Botão de parar geração */
#lingoloop-stop-btn {
    background-color: #ff6b35;
    border-color: #ff6b35;
    color: #FFFFFF;
    display: none; /* Inicialmente oculto */
}

#lingoloop-stop-btn:hover {
    background-color: #e55a2b;
    border-color: #e55a2b;
}

#lingoloop-stop-btn:disabled {
    background-color: #666666;
    border-color: #666666;
    cursor: not-allowed;
}

/* Área de log do chat */
#lingoloop-chat-log {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Mensagens do chat */
.lingoloop-message {
    display: flex;
    margin-bottom: 12px;
}

.lingoloop-message-user {
    justify-content: flex-end;
}

.lingoloop-message-system,
.lingoloop-message-ai {
    justify-content: flex-start;
}

.lingoloop-message-content {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.lingoloop-message-user .lingoloop-message-content {
    background-color: #4A9EFF;
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

.lingoloop-message-system .lingoloop-message-content {
    background-color: #333333;
    color: #CCCCCC;
    border-bottom-left-radius: 4px;
}

.lingoloop-message-ai .lingoloop-message-content {
    background-color: #2A2A2A;
    color: #EEEEEE;
    border-bottom-left-radius: 4px;
}

/* Área de input do chat */
.lingoloop-chat-input-area {
    padding: 20px;
    border-top: 1px solid #333333;
    display: flex;
    gap: 12px;
    align-items: center;
}

#lingoloop-user-input {
    flex: 1;
    padding: 12px 16px;
    background-color: #2A2A2A;
    border: 1px solid #444444;
    border-radius: 8px;
    color: #EEEEEE;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

#lingoloop-user-input:focus {
    outline: none;
    border-color: #4A9EFF;
    background-color: #2F2F2F;
}

#lingoloop-user-input::placeholder {
    color: #888888;
}

/* Scrollbar personalizada */
#lingoloop-chat-log::-webkit-scrollbar {
    width: 6px;
}

#lingoloop-chat-log::-webkit-scrollbar-track {
    background: #1A1A1A;
}

#lingoloop-chat-log::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 3px;
}

#lingoloop-chat-log::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

/* Scrollbar para Firefox */
#lingoloop-chat-log {
    scrollbar-width: thin;
    scrollbar-color: #444444 #1A1A1A;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
    #lingoloop-container {
        flex-direction: column;
    }
    
    #lingoloop-preview-area {
        flex: 0 0 60%;
        border-right: none;
        border-bottom: 1px solid #333333;
    }
    
    #lingoloop-chat-area {
        flex: 0 0 40%;
    }
    
    .lingoloop-chat-header {
        padding: 15px;
    }
    
    .lingoloop-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    #lingoloop-preview-frame {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    #lingoloop-preview-area {
        flex: 0 0 50%;
    }
    
    #lingoloop-chat-area {
        flex: 0 0 50%;
    }
    
    #lingoloop-preview-frame {
        padding: 15px;
    }
    
    .lingoloop-placeholder {
        font-size: 16px;
    }
    
    .lingoloop-chat-header {
        flex-direction: column;
        gap: 6px;
    }
    
    .lingoloop-btn {
        width: 100%;
        justify-content: center;
    }
    
    .lingoloop-chat-input-area {
        flex-direction: column;
        gap: 8px;
    }
    
    #lingoloop-user-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #lingoloop-tabs {
        padding: 0 10px;
        height: 45px;
    }
    
    .lingoloop-tab {
        padding: 8px 12px;
        font-size: 12px;
        margin-right: 4px;
    }
    
    #lingoloop-preview-frame {
        padding: 10px;
    }
    
    .lingoloop-placeholder {
        font-size: 14px;
    }
    
    #lingoloop-chat-log {
        padding: 15px;
    }
    
    .lingoloop-chat-input-area {
        padding: 15px;
    }
}

/* ===== ANIMAÇÕES E TRANSIÇÕES ===== */
.lingoloop-tab,
.lingoloop-btn,
#lingoloop-user-input {
    transition: all 0.2s ease;
}

.lingoloop-message {
    animation: fadeInUp 0.3s ease;
}

.lingoloop-section {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ESTADOS DE CARREGAMENTO ===== */
.lingoloop-loading {
    opacity: 0.7;
    pointer-events: none;
}

.lingoloop-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #4A9EFF;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 

/* === ETAPA 6.3: Edição por Seção com Chat Lateral === */
.lingoloop-section-editor {
  position: fixed;
  top: 0; right: 0;
  width: 400px; max-width: 100vw;
  height: 100vh;
  background: #181a1b;
  color: #fff;
  box-shadow: -2px 0 16px #000a;
  z-index: 9999;
  display: flex; flex-direction: column;
  border-left: 1px solid #222;
  animation: lingoloop-slidein .2s;
}
@keyframes lingoloop-slidein {
  from { right: -420px; opacity: 0; }
  to { right: 0; opacity: 1; }
}
.lingoloop-section-editor-header {
  padding: 16px; font-weight: bold; border-bottom: 1px solid #222;
  display: flex; align-items: center; justify-content: space-between;
  background: #202124;
}
.lingoloop-section-editor-close {
  background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; margin-left: 8px;
  transition: color .2s;
}
.lingoloop-section-editor-close:hover { color: #ff6b35; }
.lingoloop-section-editor-chat {
  flex: 1; overflow-y: auto; padding: 16px; background: #181a1b;
}
.lingoloop-section-editor-input {
  display: flex; border-top: 1px solid #222; padding: 12px; background: #202124;
}
.lingoloop-section-editor-input input {
  flex: 1; background: #222; color: #fff; border: none; padding: 8px; border-radius: 4px;
}
.lingoloop-section-editor-input button {
  margin-left: 8px; background: #0073aa; color: #fff; border: none; padding: 8px 16px; border-radius: 4px; font-weight: bold;
  transition: background .2s;
}
.lingoloop-section-editor-input button:hover { background: #005177; }
.lingoloop-section-editor-msg { margin-bottom: 18px; }
.lingoloop-section-editor-msg-label { font-size: 12px; color: #aaa; margin-bottom: 2px; }
.lingoloop-section-editor-html {
  background: #23272a; color: #e0e0e0; padding: 8px; border-radius: 4px; font-size: 12px; overflow-x: auto;
}
.lingoloop-section-editor-user {
  background: #222; color: #fff; padding: 8px; border-radius: 4px; font-size: 14px;
}
.lingoloop-section-editor-error {
  background: #3a1a1a; color: #ff6b35; padding: 8px; border-radius: 4px; font-size: 13px;
}
.lingoloop-section-editor-msg-loading {
  color: #aaa; font-style: italic;
}
.lingoloop-section-editing {
  outline: 2px solid #0073aa !important;
  outline-offset: 2px;
  transition: outline .2s;
  z-index: 10;
}
@media (max-width: 600px) {
  .lingoloop-section-editor { width: 100vw; min-width: 0; }
}
/* Fim ETAPA 6.3 */ 

/* ===== MODAL DE PUBLICAÇÃO ===== */
#lingoloop-publish-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

#lingoloop-publish-modal.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lingoloop-modal-content {
    background: #1E1E1E;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lingoloop-modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #333333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lingoloop-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;
}

.lingoloop-modal-close {
    background: none;
    border: none;
    color: #999999;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.lingoloop-modal-close:hover {
    background: #333333;
    color: #FFFFFF;
}

.lingoloop-modal-body {
    padding: 24px;
}

.lingoloop-publish-options {
    display: grid;
    gap: 16px;
}

.lingoloop-publish-option {
    border: 2px solid #333333;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #2A2A2A;
}

.lingoloop-publish-option:hover {
    border-color: #4A9EFF;
    background: #2D3748;
}

.lingoloop-publish-option.selected {
    border-color: #4A9EFF;
    background: #1A365D;
}

.lingoloop-option-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.lingoloop-option-icon {
    font-size: 24px;
    margin-right: 12px;
}

.lingoloop-option-title {
    font-size: 18px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;
}

.lingoloop-option-description {
    color: #CCCCCC;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.lingoloop-option-content {
    margin-top: 16px;
    display: none;
}

.lingoloop-publish-option.selected .lingoloop-option-content {
    display: block;
}

.lingoloop-form-group {
    margin-bottom: 16px;
}

.lingoloop-form-label {
    display: block;
    font-weight: 500;
    color: #FFFFFF;
    margin-bottom: 6px;
    font-size: 14px;
}

.lingoloop-form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #444444;
    border-radius: 8px;
    background: #121212;
    color: #FFFFFF;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.lingoloop-form-input select,
.lingoloop-form-input[type="select"] {
    background: #121212;
    color: #FFFFFF;
    cursor: pointer;
}

.lingoloop-form-input option {
    background: #121212;
    color: #FFFFFF;
    padding: 8px;
}

.lingoloop-form-input:focus {
    outline: none;
    border-color: #4A9EFF;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.lingoloop-domain-preview {
    margin-top: 8px;
    padding: 12px;
    background: #2A2A2A;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    color: #4A9EFF;
    border-left: 3px solid #4A9EFF;
}

.lingoloop-instructions {
    background: #2A2A2A;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.lingoloop-instructions h4 {
    margin: 0 0 12px 0;
    color: #FFFFFF;
    font-size: 16px;
}

.lingoloop-instructions ol {
    margin: 0;
    padding-left: 20px;
    color: #CCCCCC;
}

.lingoloop-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.lingoloop-verification-section {
    margin-top: 16px;
    padding: 16px;
    background: #1A365D;
    border-radius: 8px;
    border-left: 3px solid #4A9EFF;
}

.lingoloop-verification-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.lingoloop-status-icon {
    font-size: 20px;
}

.lingoloop-status-text {
    font-weight: 500;
    color: #FFFFFF;
}

.lingoloop-modal-footer {
    padding: 16px 24px 24px 24px;
    border-top: 1px solid #333333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lingoloop-modal-footer .lingoloop-btn {
    min-width: 120px;
}

.lingoloop-btn-outline {
    background: transparent;
    border: 1px solid #4A9EFF;
    color: #4A9EFF;
}

.lingoloop-btn-outline:hover {
    background: #4A9EFF;
    color: #FFFFFF;
}

.lingoloop-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #333333;
    border-radius: 50%;
    border-top-color: #4A9EFF;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsividade para o modal */
@media (max-width: 768px) {
    .lingoloop-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .lingoloop-modal-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .lingoloop-modal-footer .lingoloop-btn {
        width: 100%;
    }
}