* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    --secondary-color: #333;
    --light-color: #f4f4f4;
    --dark-color: #333;
    --font-size: 18px;
    --font-size-small: 16px;
    --padding: 30px;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #121212;
    color: white;
    padding: var(--padding);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

#toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin-bottom: 20px;
    gap: 10px;
}

#toolbar button {
    padding: 10px 15px;
    font-size: var(--font-size-small);
    background-color: var(--primary-color);
    color: white;
    height: 49px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#toolbar button:hover {
    background-color: #45a049;
}

#toolbar button:active {
    background-color: #388e3c;
    transform: scale(0.98);
}

textarea {
    width: 100%;
    max-width: 900px;
    height: 250px;
    padding: 15px;
    font-size: var(--font-size);
    line-height: 1.6;
    color: white;
    border: 1px solid #444;
    border-radius: 8px;
    background-color: #222;
    resize: none;
    transition: border 0.3s ease;
}

textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

#preview {
    width: 100%;
    max-width: 900px;
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #444;
    border-radius: 8px;
    background-color: #222;
    box-shadow: 0 4px 10px var(--dark-color);
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: var(--font-size);
    line-height: 1.6;
    color: white;
}
#preview h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: white;
}

button {
    width: 100%;
    max-width: 200px;
    padding: 15px;
    font-size: var(--font-size);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin-top: 20px;
}

button:hover {
    background-color: #45a049;
}

button:active {
    background-color: #388e3c;
    transform: scale(0.98);
}

@media screen and (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    textarea, #preview, button {
        max-width: 100%;
    }

    textarea {
        font-size: var(--font-size-small);
    }

    #toolbar button {
        max-width: 70px;
        padding: 8px;
    }
}

footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #333;
    text-align: center;
    padding: 20px 0;
    color: #fff;
    font-size: var(--font-size-small);
    border-top: solid 1px #444;
}
