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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --background-color: #ecf0f1;
    --text-color: #2c3e50;
    --border-color: #bdc3c7;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
}

main {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
    flex: 1;
}

.controls {
    margin-bottom: 2rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.filter-dropdown {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-dropdown:hover {
    border-color: var(--secondary-color);
}

.filter-dropdown:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.text-areas {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-section,
.output-section {
    display: flex;
    flex-direction: column;
}

textarea {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.text-output {
    background-color: #f8f9fa;
}

.button-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

button {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.transform-button {
    background-color: var(--secondary-color);
    color: white;
}

.transform-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.transform-button:active {
    transform: translateY(0);
}

.transform-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.clear-button {
    background-color: #95a5a6;
    color: white;
}

.clear-button:hover {
    background-color: #7f8c8d;
}

.error-message {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #fadbd8;
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
    border-radius: 4px;
    font-weight: 500;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem;
    color: #7f8c8d;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

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

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .text-areas {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .button-container {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}
