:root {
    font-size: 16px;
    /* Base font size */
}

/* --- FUTURISTIC THEME (Default) --- */
body {
    --bg-color: #0a0a1a;
    --header-bg: #1a1a2e;
    --editor-bg: #1e1e2f;
    --text-color: #e0e0e0;
    --text-muted: #888;
    --border-color: #444;
    --accent-color: #00ff88;
    --btn-bg: #2a2a40;
    --glow-color: rgba(0, 255, 136, 0.3);

    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-bg);
    padding: 1em 1.5em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid var(--accent-color);
}

header h1 {
    font-size: 1.75rem;
    margin: 0;
    letter-spacing: 2px;
    font-weight: 500;
    text-shadow: 0 0 5px var(--glow-color);
}

header .controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

header .controls button {
    background: var(--btn-bg);
    border: 1px solid var(--accent-color);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5em 0.8em;
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
    position: relative; /* For Tooltip Position */
}

header .controls button:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 10px var(--glow-color);
}

header .controls button .tooltiptext {
    visibility: hidden;
    width: auto;
    min-width: 80px; /* Ensure tooltips are readable */
    background-color: var(--btn-bg); /* Use variable for consistency */
    color: var(--text-color);
    text-align: center;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
}

header .controls button:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

header .controls #toggle-buttons { /* Specific ID styling if needed */
    /* Icon size is controlled by font-size on the <i> element if needed, or button's font-size */
}
header .controls #toggle-buttons i { /* Target icon directly if different size needed */
    font-size: 1.4rem; /* Example: Make toggle-buttons icon slightly larger */
}


main {
    display: flex;
    flex: 1;
    padding: 1.25em;
    gap: 1.25em;
    flex-direction: column; /* Default to column for mobile */
}

.editor-container {
    width: 100%; /* Take up full width by default */
    display: flex;
    flex: 1; /* Allow editor container to grow */
    flex-direction: column;
    gap: 1.25em;
    min-height: 300px; /* Ensure editors have some minimum height */
}

.editor-container textarea {
    flex: 1;
    background-color: var(--editor-bg);
    border: 1px solid var(--accent-color);
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    padding: 1em;
    border-radius: 8px;
    resize: none; /* Keep resize none, as it's flex based */
    box-shadow: 0 0 10px var(--glow-color);
    transition: background-color 0.3s, border-color 0.3s;
    min-height: 100px; /* Minimum height for individual textareas */
}

.editor-container textarea::placeholder {
    color: var(--text-muted);
}

.preview-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--editor-bg);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 10px var(--glow-color);
    transition: width 0.3s ease-in-out, transform 0.3s ease-in-out, background-color 0.3s, border-color 0.3s;
    margin-top: 1.25em;
    min-height: 300px;
}

/* This class was defined but not used in HTML. Kept for potential future use or can be removed. */
.preview-header-buttons {
    display: flex;
    justify-content: space-between;
    padding: 0.5em;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}


.preview-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    border: none;
    transform: none;
    margin-top: 0;
    border-radius: 0; /* Fullscreen should not have rounded corners usually */
}

.preview-container iframe {
    width: 100%;
    height: 100%;
    flex-grow: 1;
    border: none;
    /* margin-top is only needed if buttons are not part of a separate header inside preview */
    /* With current absolute positioning of buttons, iframe can take full space */
}

.preview-container .preview-control-btn {
    background: var(--btn-bg);
    border: 1px solid var(--accent-color);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3em 0.6em;
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
    z-index: 100; /* Ensure they are above iframe content */
    position: absolute; /* Position within preview-container */
}
.preview-container .preview-control-btn:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 10px var(--glow-color);
}
.preview-container .fullScreen-btn {
    top: 0.9em;
    left: 0.9em;
}
.preview-container .close-btn {
    top: 0.9em;
    right: 0.9em;
}


footer {
    background-color: var(--header-bg);
    text-align: center;
    padding: 1em;
    font-size: 0.9rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.6);
    border-top: 1px solid var(--accent-color);
}

footer span {
    font-size: 0.9rem;
    color: var(--text-muted); /* Use variable */
}

.notification {
    background: var(--border-color);
    padding: 0.75em 1.25em;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    color: var(--text-color);
    border-radius: 8px;
    transition: transform 0.5s ease-in-out, background-color 0.3s, opacity 0.3s; /* Added opacity transition */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    opacity: 0;
    text-align: center; /* Ensure text is centered */
    min-width: 200px; /* Give it some min width */
}
.notification.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.notification.success {
    background: var(--accent-color);
    color: var(--bg-color); /* Ensure contrast */
}
.notification.copy {
     background: var(--text-muted); /* Using text-muted as example */
     color: var(--bg-color); /* Ensure contrast */
}
.notification.error {
    background-color: #d32f2f;
    color: white;
}

.segregation-toggle.active {
    color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color); /* Use var for glow */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- LIGHT THEME --- */
body.light-theme {
    --bg-color: #f0f2f5;
    --header-bg: #e9ecef;
    --editor-bg: #f8f9fa;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #ced4da;
    --accent-color: #007bff;
    --btn-bg: #dee2e6;
    --glow-color: rgba(0, 123, 255, 0.2);
}

body.light-theme header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--border-color);
}
body.light-theme header .controls button:hover {
     color: #fff; /* White text on blue accent bg for light theme */
}
body.light-theme .notification.success {
    color: white; /* Ensure contrast for success notification in light theme */
}
body.light-theme .segregation-toggle.active {
    color: var(--accent-color); /* Use accent color for active state in light theme */
    box-shadow: 0 0 10px var(--glow-color); /* Use light theme glow */
}


/* Media Queries for Responsiveness */
@media (min-width: 768px) {
    :root {
        font-size: 17px;
    }
    main {
        flex-direction: row;
    }
    .editor-container {
        width: 60%;
        margin-top: 0;
    }
    .preview-container {
        width: 40%;
        margin-top: 0;
        border-left: 2px solid var(--border-color);
    }
}
@media (min-width: 1024px) {
    :root {
        font-size: 18px;
    }
    .editor-container {
        width: 65%;
    }
    .preview-container {
        width: 35%;
    }
}
@media (min-width: 1200px) {
    :root {
        font-size: 19px;
    }
}
/* REMOVED THE ERRONEOUS ${cssEditor.value} LINE FROM HERE */