/* Reseta alguns estilos padrão */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Corpo do documento - Mobile First */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    padding: 12px;
}

/* Container principal - Mobile First */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 12px;
    max-width: 100%;
}

/* Título principal - Mobile First */
h1 {
    text-align: center;
    margin-bottom: 16px;
    font-size: 22px;
    margin-top: 0;
}

h2 {
    font-size: 16px;
    margin-bottom: 10px;
    margin-top: 0;
}

/* Layout de duas colunas usando Flexbox - Mobile First (coluna única) */
#content-markdown,
#resultado {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Estilo das duas colunas - Mobile First (empilhadas) */
.row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Estilo da coluna para o Markdown - Mobile First */
#content-markdown {
    background-color: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    width: 100%;
}

/* Estilo da coluna para o Resultado - Mobile First */
#resultado {
    background-color: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    width: 100%;
}

/* Textarea - Mobile First */
textarea {
    width: 100%;
    height: 280px;
    padding: 10px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    resize: vertical;
}

/* Botões - Mobile First */
button {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

button:active {
    opacity: 0.8;
}

button:hover {
    background-color: #0056b3;
}

button.btn-yellow {
    background-color: #ffc107;
    color: #333;
}

button.btn-yellow:hover {
    background-color: #e0a800;
}

button.btn-red {
    background-color: #dc3545;
}

button.btn-red:hover {
    background-color: #c82333;
}

/* Estilo do resultado (HTML gerado) - Mobile First */
#html-output {
    white-space: pre-wrap;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    overflow-x: auto;
}

/* Exibição de mensagem de erro */
#error-message {
    font-size: 13px;
    margin-top: 10px;
    padding: 12px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

/* Estilo do botão de voltar ao topo - Mobile First */
#back-to-top {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

#back-to-top:active {
    background-color: #0056b3;
    transform: scale(0.95);
}

/* Exibição do botão apenas quando a página é rolada */
#back-to-top.show {
    display: flex;
}

/* Responsividade para Tablet (769px e acima) */
@media (min-width: 768px) {
    body {
        padding: 16px;
    }

    .container {
        padding: 16px;
        max-width: 1200px;
    }

    h1 {
        font-size: 28px;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .row {
        flex-direction: row;
        gap: 16px;
    }

    #content-markdown,
    #resultado {
        flex: 1;
        width: auto;
        gap: 12px;
        padding: 16px;
    }

    textarea {
        height: 280px;
        padding: 12px;
        font-size: 14px;
    }

    button {
        padding: 11px 18px;
        font-size: 14px;
        margin-top: 8px;
    }

    #html-output {
        padding: 12px;
        font-size: 13px;
    }

    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* Responsividade para telas grandes (1024px e acima) */
@media (min-width: 1024px) {
    .container {
        max-width: 1400px;
        padding: 24px;
    }

    h1 {
        font-size: 32px;
        margin-bottom: 28px;
    }

    h2 {
        font-size: 20px;
        margin-bottom: 14px;
    }

    #content-markdown,
    #resultado {
        gap: 16px;
        padding: 20px;
    }

    .row {
        gap: 24px;
    }

    textarea {
        height: 320px;
        padding: 14px;
        font-size: 15px;
    }

    button {
        padding: 12px 20px;
        font-size: 15px;
    }

    #html-output {
        padding: 15px;
        font-size: 14px;
    }
}
