body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 40px;
    background-color: #1e1e1e;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* Esquerda, Centro, Direita */
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header-left h1 {
    margin: 0 20px 0 0;
    font-size: 24px;
}

.header-left a {
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
}

.header-center {
    display: flex;
    justify-content: center;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.header-right nav a {
    color: #e0e0e0;
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
}

main {
    width: 100%;
    max-width: 800px;
    margin-top: 40px;
    display: flex;
    flex-direction: column; /* Organiza hero e editor verticalmente */
    align-items: center;
    gap: 40px; /* Espaço entre hero e editor */
}

.editor-container {
    background-color: #1e1e1e;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    width: 100%;
    box-sizing: border-box;
}

.textarea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.textarea-header h2 {
    margin: 0;
}

textarea {
    width: 100%;
    height: 300px;
    background-color: #252526;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

#gerar-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

#gerar-btn:hover {
    transform: scale(1.02);
}

#gerar-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

.cta-button {
    background-color: #ffffff;
    color: #121212;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    min-width: 320px;
    height: 50px;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}
.cta-button:hover {
    transform: scale(1.05);
}

.cta-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.4s ease-in-out;
    opacity: 0;
    white-space: nowrap;
}

.cta-text.visible {
    opacity: 1;
}

.pro-button {
    background-color: #f5a623;
    color: #121212 !important;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
}

.pro-button:hover {
    transform: scale(1.05);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: #1e1e1e;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 8px;
    position: relative;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: #fff;
}

.modal-content h2 {
    text-align: center;
    margin-top: 0;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background-color: #252526;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    box-sizing: border-box;
}

.modal-content button {
    margin-top: 10px;
    width: 100%;
}

.terms-agreement {
    margin-bottom: 15px;
    font-size: 12px;
    display: flex;
    align-items: center;
}

.terms-agreement input {
    width: auto;
    margin: 0 10px 0 0;
}

.terms-agreement a {
    color: #4a90e2;
    text-decoration: none;
}
.terms-agreement a:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

.hero-section {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background-color: #000;
}

.hero-section video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.loading-content p {
    color: #e0e0e0;
    font-size: 22px;
    font-style: italic;
    margin-top: 20px;
}

.loading-content .gaia-signature {
    font-size: 18px;
    color: #2575fc;
    margin-top: 5px;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #2575fc;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

footer {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    margin-top: 60px;
    border-top: 1px solid #252526;
    font-size: 12px;
    color: #888;
}

footer a {
    color: #aaa;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* --- Estilos para o Seletor de Tema --- */
.theme-picker {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}
.theme-picker label {
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
}
.theme-options {
    display: flex;
    gap: 15px;
}
.theme-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.2s ease;
    padding: 3px;
}
.theme-swatch.selected {
    border-color: #4a90e2; /* Destaque para o tema selecionado */
}
.theme-swatch span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
/* --- REGRAS DE DESIGN RESPONSIVO PARA SMARTPHONES --- */
/* Estas regras só serão aplicadas se a largura da tela for de 768px ou menos */
@media (max-width: 768px) {
    
    /* O cabeçalho agora terá uma única coluna, empilhando os itens */
    header {
        grid-template-columns: 1fr;
        gap: 20px; /* Adiciona espaço entre as seções (logo, botão, login) */
        padding: 20px;
        text-align: center;
    }

    /* Centraliza o conteúdo de cada seção do cabeçalho */
    .header-left, .header-center, .header-right {
        justify-content: center;
    }

    /* Ajusta o espaçamento dos links da direita */
    .header-right nav a {
        margin: 0 10px;
    }
    
    /* Ajusta o espaçamento do conteúdo principal */
    main {
        margin-top: 20px;
        padding: 0 15px; /* Adiciona um respiro nas laterais */
        box-sizing: border-box;
    }
    
    /* Ajusta o vídeo para não ficar tão grande */
    .hero-section {
        height: auto; /* A altura se ajusta à nova largura */
    }

    .editor-container {
        padding: 15px;
    }

    /* Ajusta o modal para não ficar tão longe do topo */
    .modal-content {
        width: 90%;
        margin: 25% auto;
    }
}

/* --- Estilos para o Vídeo da Tela de Carregamento --- */
#loading-overlay .loading-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Faz o vídeo cobrir toda a tela, mesmo que corte as bordas */
    z-index: -1; /* Coloca o vídeo atrás de todo o conteúdo */
    filter: brightness(0.5) blur(4px); /* Escurece e desfoca o vídeo para dar destaque ao texto */
}