:root {
    --primary-color: #6a5af9;
    --primary-hover-color: #5848d8;
    --background-color: #f4f7f9;
    --container-bg-color: #ffffff;
    --text-color: #2c3e50;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --font-family: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

#root {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    min-height: 100vh;
}

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

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    color: #5a6a7a;
    max-width: 600px;
}

.container {
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    flex-grow: 1;
}

.panel {
    background-color: var(--container-bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    padding: 2rem;
    width: 50%;
    display: flex;
    flex-direction: column;
}

.input-panel {
    gap: 1rem;
}

.output-panel {
    position: relative;
}

h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

textarea {
    width: 100%;
    flex-grow: 1;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1rem;
    font-family: 'Menlo', 'Courier New', monospace;
    font-size: 0.9rem;
    resize: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 90, 249, 0.2);
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.option label {
    font-size: 0.95rem;
    user-select: none;
    color: #333;
    cursor: pointer;
}

.option input[type="checkbox"] {
    cursor: pointer;
    width: 1.25em;
    height: 1.25em;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--container-bg-color);
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
    top: -1px;
}

.option input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.option input[type="checkbox"]:checked::before {
    content: '✔';
    font-size: 0.9em;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.option input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 90, 249, 0.2);
}

.option select {
    flex-grow: 1;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--container-bg-color);
    font-family: var(--font-family);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.option select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 90, 249, 0.2);
}

.button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.button:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
}

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

.output-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 1rem; /* For scrollbar */
}

.output-content {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
}

.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
}

.loader-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    color: #e74c3c;
    background-color: #fbecec;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    padding: 1rem;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.copy-button {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.copy-button:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}


@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }

    .panel {
        width: 100%;
        min-height: 50vh;
    }
}