body {
    margin: 0;
    font-family: sans-serif;
    transition: background-color 0.3s, color 0.3s;
    background-color: #1a202c; /* Dark mode background */
    color: #cbd5e0; /* Dark mode text */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.hidden {
    display: none;
}

/* Welcome Screen Styling */
#welcome-screen {
    background-color: #2d3748;
    color: #e2e8f0;
    padding: 3rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

#welcome-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

#welcome-screen p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

#start-button {
    background-color: #3182ce;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

#start-button:hover {
    background-color: #2c5282;
}

/* Main App Layout */
#main-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

header {
    background-color: #2d3748;
    color: #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
}

#theme-toggle {
    background-color: #4a5568;
    color: #e2e8f0;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

#theme-toggle:hover {
    background-color: #2d3748;
}

main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.editor-panels {
    display: flex;
    flex-direction: column;
    flex: 1;
    border-right: 1px solid #4a5568;
}

.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #4a5568;
}

.editor-title {
    background-color: #2d3748;
    padding: 0.75rem 1rem;
    font-weight: bold;
    border-bottom: 1px solid #4a5568;
}

textarea {
    flex: 1;
    background-color: #1a202c;
    color: #e2e8f0;
    border: none;
    outline: none;
    padding: 1rem;
    font-family: monospace;
    font-size: 1rem;
    resize: none;
}

.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-title {
    background-color: #2d3748;
    padding: 0.75rem 1rem;
    font-weight: bold;
    border-bottom: 1px solid #4a5568;
}

#preview-iframe {
    flex: 1;
    width: 100%;
    background-color: white;
}

footer {
    background-color: #2d3748;
    color: #a0aec0;
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

/* Light Mode Styles */
body.light-mode {
    background-color: #f7fafc;
    color: #2d3748;
}

.light-mode #main-app header,
.light-mode .editor-title,
.light-mode .preview-title,
.light-mode #main-app footer,
.light-mode .editor-container,
.light-mode .preview-panel {
    background-color: #e2e8f0;
    color: #2d3748;
}

.light-mode #theme-toggle {
    background-color: #a0aec0;
    color: #2d3748;
}

.light-mode #theme-toggle:hover {
    background-color: #cbd5e0;
}

.light-mode .editor-panels {
    border-right: 1px solid #cbd5e0;
}

.light-mode .editor-container {
    border-bottom: 1px solid #cbd5e0;
}

.light-mode textarea {
    background-color: #edf2f7;
    color: #2d3748;
}
