        .header-nav-button {
            padding: 0.5em 1em;
            margin-left: 1em;
            background-color: #8A2BE2; /* Purple from Galatron rules */
            color: white;
            border: none;
            border-radius: 15px; /* Prominently rounded corners */
            cursor: pointer;
            transition: background-color 0.3s ease;
            flex: 0 1 auto;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .header-nav-button:hover:not(:disabled) {
            background-color: #7B24CB; /* Darker purple on hover */
        }
        .header-nav-button:disabled {
            background-color: #5a5a5a; /* Grey out when disabled */
            color: #999999;
            cursor: not-allowed;
        }
        .header-nav-button.active {
            background-color: #9370DB; /* MediumPurple - clearly active */
            box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
        }

        /* Specific styles for the File Tree button state */
        #fileTreeButton:not(:disabled):not(.active) {
            background-color: #5a5a5a; /* Gray, similar to disabled state */
            color: #e0e0e0; /* Light gray text for readability on dark gray */
        }

        #fileTreeButton:not(:disabled):not(.active):hover {
            background-color: #6b6b6b; /* Slightly lighter gray on hover */
        }

        #fileTreeButton.active {
            background-color: #8A2BE2; /* Main purple for active state */
            color: white;
            /* box-shadow is already applied by .header-nav-button.active, or can be added here if that rule is removed */
        }

        /* Specific styles for the FILE button */
        #fileButton:not(.menu-active) {
            background-color: #5a5a5a; /* Default gray */
            color: #e0e0e0;
        }

        #fileButton:not(.menu-active):hover {
            background-color: #6b6b6b; /* Lighter gray on hover */
        }

        #fileButton.menu-active {
            background-color: #777777; /* Light gray when menu is open (pressed state) */
            color: #ffffff;
        }

        /* Context Menu Styles */
        .file-context-menu {
            display: none; /* Hidden by default */
            position: absolute;
            top: 60px; /* Adjust as needed, below the header */
            left: 150px; /* Adjust as needed, near the FILE button */
            background-color: #3c3c3c; /* Darker than page background, but not black */
            border: 1px solid #505050;
            border-radius: 10px; /* Rounded corners */
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            z-index: 1000;
            min-width: 180px;
            padding: 5px 0;
        }
        .file-context-menu button {
            display: block;
            width: calc(100% - 10px); /* Full width minus padding */
            padding: 10px 15px;
            margin: 5px;
            background-color: transparent;
            color: #E0E0E0;
            border: none;
            text-align: left;
            cursor: pointer;
            border-radius: 8px; /* Rounded corners for items */
            font-size: 0.95em;
        }
        .file-context-menu button:hover {
            background-color: #8A2BE2; /* Purple accent on hover */
            color: white;
        }
        .context-menu-divider {
            height: 1px;
            background-color: #505050;
            margin: 5px 0;
        }

        /* Ensure the main page container takes full height and manages its children vertically */
        .create-page-container {
            display: flex;
            flex-direction: column;
            height: 100vh; /* Assumes this container is the primary viewport filler */
            box-sizing: border-box; /* ADDED */
            transition: padding-right 0.3s ease-in-out, padding-bottom 0.3s ease-in-out; /* MODIFIED */
            position: relative; /* ADDED to make it a positioning context */
            /* overflow: hidden; /* Optional: consider if child elements manage their own scroll */
        }

        /* ADD new rule for when file tree is visible */
        .create-page-container.file-tree-visible {
            padding-right: 300px;
        }

        /* ADD new rule for when console is visible */
        .create-page-container.console-visible {
            padding-bottom: 250px; /* Adjust as needed for console height */
        }

        /* File Tree Panel Styles */
        .file-tree-panel {
            position: fixed;
            top: 60px; /* Position below site-header (30px) and secondary-menu-ribbon (30px) */
            right: -300px; /* Start off-screen */
            width: 300px;
            /* height: calc(100vh - 60px); */ /* MODIFIED - height will be affected by console */
            bottom: 0; /* Anchor to bottom */
            background-color: #383838; /* Slightly lighter than background for differentiation */
            border-left: 1px solid #505050;
            box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
            z-index: 900; /* Below context menu, above most content */
            transition: right 0.3s ease-in-out;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            padding-top: 0; /* Panel content starts from its top */
            border-radius: 15px 0 0 15px; /* Rounded corners on the left */
            flex-shrink: 0; /* Prevent header from shrinking if content is too long */
        }

        .file-tree-panel.visible {
            right: 0; /* Slide in */
        }

        .file-tree-header {
            padding: 10px 15px;
            font-size: 1.1em;
            color: #E0E0E0;
            background-color: #444444;
            border-bottom: 1px solid #505050;
            border-radius: 15px 0 0 0; /* Match top-left rounding */
            margin-top: 0; /* Panel header is part of normal flow now */
            height: 50px; /* Reduced height for the panel's own header */
            display: flex;
            align-items: center;
            box-sizing: border-box;
            flex-shrink: 0; /* Prevent header from shrinking if content is too long */
        }

        .file-tree-content {
            padding: 10px;
            color: #D0D0D0;
            flex-grow: 1; /* Allow content to fill available space */
            overflow-y: auto; /* Scroll content if it overflows */
        }

        .file-tree-content ul {
            list-style-type: none;
            padding-left: 15px;
        }

        .file-tree-content li {
            padding: 5px 0;
            cursor: pointer;
        }
        /* 
        .file-tree-content li:hover {
            color: #8A2BE2; /* Purple on hover */
        /* } */
        */

        /* New hover styles for file tree items */
        .file-tree-content li > span, /* Applied to direct span children */
        .file-tree-content li > .file-item-display-container > .item-name-span /* Applied to the new name span */ {
          /* Default color for text, ensuring it matches the tree's base text color */
          color: #D0D0D0; 
          transition: color 0.1s ease-in-out; /* Smooth color transition */
        }

        .file-tree-content li.tree-item-hover-active > .file-item-display-container > .item-name-span,
        .file-tree-content li.tree-item-hover-descendant > .file-item-display-container > .item-name-span {
          color: #8A2BE2; /* Purple highlight for active hover and descendants */
        }

        /* Style for focused (selected via click/keyboard) file tree item */
        .file-tree-content li.tree-item-focused > .file-item-display-container > .item-name-span {
            background-color: #555555; /* Dark gray background */
            color: #E0E0E0; /* Light gray text for readability */
            padding: 2px 4px;
            border-radius: 5px;
            display: inline-block; /* Ensure background covers only the span */
        }

        /* Style for file tree item open in editor (takes precedence over focused) */
        .file-tree-content li.tree-item-open-in-editor > .file-item-display-container > .item-name-span {
            background-color: #8A2BE2; /* Purple background */
            color: white; /* White text */
            padding: 2px 4px; /* Add some padding */
            border-radius: 5px; /* Rounded corners for the selection highlight */
            display: inline-block; /* Ensure background covers only the span */
        }

        /* Style for item selected for a "move" operation */
        .file-tree-content li.tree-item-move-selected {
            /* opacity: 0.4; */ /* Removed opacity */
            background: #4a4a4a; /* Distinct background for selection, text remains clear */
            /* color: #999999; */ /* Removed color change */
        }

        /* Styles for the "+" button next to folders */
        .file-tree-content li.folder > .folder-item-container {
            display: flex;
            align-items: center;
            justify-content: space-between; /* Pushes button to the right */
            width: 100%; /* Ensure it takes full width of the li's content area */
        }

        .file-tree-content li.folder > .folder-item-container > span {
            flex-grow: 1; /* Allows the name span to take available space */
        }

        .add-item-button {
            background-color: transparent;
            color: #b0b0b0;
            border: 1px solid #606060;
            border-radius: 50%; /* Circular button */
            cursor: pointer;
            font-size: 0.8em; /* Smaller font for "+" */
            line-height: 1; /* Ensure "+" is centered */
            width: 18px;
            height: 18px;
            display: flex; /* Keep for layout when visible */
            align-items: center;
            justify-content: center;
            margin-left: 8px; /* Space from the folder name */
            padding: 0;
            flex-shrink: 0; /* Prevent button from shrinking */

            /* --- Styles for visibility control --- */
            opacity: 0;
            visibility: hidden;
            transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.15s ease-in-out;
            /* --- End styles for visibility control --- */
        }

        .add-item-button:hover {
            background-color: #8A2BE2; /* Purple accent on hover */
            color: white;
            border-color: #8A2BE2;
        }

        /* Delete Item Button Styles */
        .delete-item-button {
            background-color: transparent;
            color: #b0b0b0;
            border: 1px solid #606060;
            border-radius: 50%;
            cursor: pointer;
            font-size: 0.8em; /* Adjusted for emoji */
            line-height: 1;
            width: 18px;
            height: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 5px; /* Spacing from add button or name */
            padding: 0;
            flex-shrink: 0;
            opacity: 0;
            visibility: hidden;
            transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.15s ease-in-out;
        }

        .delete-item-button:hover {
            background-color: #E53935; /* Red accent on hover for delete */
            color: white;
            border-color: #E53935;
        }

        /* Rename Item Button Styles */
        .rename-item-button {
            background-color: transparent;
            color: #b0b0b0;
            border: 1px solid #606060;
            border-radius: 50%;
            cursor: pointer;
            font-size: 0.8em; /* Adjusted for emoji */
            line-height: 1;
            width: 18px;
            height: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 5px; /* Spacing from other buttons or name */
            padding: 0;
            flex-shrink: 0;
            opacity: 0;
            visibility: hidden;
            transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.15s ease-in-out;
        }

        .rename-item-button:hover {
            background-color: #4CAF50; /* Green accent on hover for rename */
            color: white;
            border-color: #4CAF50;
        }

        /* General File Item Display and Controls Styling */
        .file-item-display-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
        }

        .item-name-span {
            flex-grow: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .item-controls {
            display: flex;
            align-items: center;
            flex-shrink: 0; /* Prevent controls from shrinking */
        }

        /* Visibility for Controls (Add and Delete buttons) */
        /* Show add-item-button on specific folder hover, or when the folder item is focused or selected */
        .file-tree-content li.folder.folder-directly-targeted-by-hover-for-add-btn > .file-item-display-container > .item-controls > .add-item-button,
        .file-tree-content li.folder.tree-item-focused > .file-item-display-container > .item-controls > .add-item-button,
        .file-tree-content li.folder.tree-item-selected > .file-item-display-container > .item-controls > .add-item-button {
            opacity: 1;
            visibility: visible;
        }

        /* Show delete-item-button on any item hover (file or folder), or when focused/selected */
        .file-tree-content li.tree-item-hover-active > .file-item-display-container > .item-controls > .delete-item-button,
        .file-tree-content li.tree-item-focused > .file-item-display-container > .item-controls > .delete-item-button,
        .file-tree-content li.tree-item-selected > .file-item-display-container > .item-controls > .delete-item-button,
        .file-tree-content li.tree-item-hover-active > .file-item-display-container > .item-controls > .rename-item-button,
        .file-tree-content li.tree-item-focused > .file-item-display-container > .item-controls > .rename-item-button,
        .file-tree-content li.tree-item-selected > .file-item-display-container > .item-controls > .rename-item-button {
            opacity: 1;
            visibility: visible;
        }

        /* Create Item Context Menu Styles */
        .create-item-context-menu {
            display: none; /* Hidden by default */
            position: absolute;
            background-color: #3c3c3c;
            border: 1px solid #505050;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            z-index: 1050; /* Above other elements */
            min-width: 220px;
            padding: 10px;
        }

        .create-item-context-menu h4 {
            margin-top: 0;
            margin-bottom: 10px;
            color: #E0E0E0;
            font-size: 1em;
        }

        .create-item-context-menu label {
            display: block;
            color: #D0D0D0;
            margin-bottom: 3px;
            font-size: 0.9em;
        }

        .create-item-context-menu input[type="text"],
        .create-item-context-menu select {
            width: calc(100% - 12px);
            padding: 6px;
            margin-bottom: 10px;
            background-color: #2C2C2C;
            border: 1px solid #505050;
            color: #E0E0E0;
            border-radius: 5px;
            font-size: 0.9em;
        }

        .create-item-context-menu .file-type-list {
            list-style: none;
            padding: 0;
            margin: 0 0 10px 0;
            max-height: 150px; /* Scrollable list */
            overflow-y: auto;
            border: 1px solid #505050;
            border-radius: 5px;
            background-color: #2C2C2C;
        }

        .create-item-context-menu .file-type-list li {
            padding: 8px 10px;
            color: #D0D0D0;
            cursor: pointer;
            border-bottom: 1px solid #444444; /* Separator */
        }
         .create-item-context-menu .file-type-list li:last-child {
            border-bottom: none;
        }

        .create-item-context-menu .file-type-list li:hover,
        .create-item-context-menu .file-type-list li.selected {
            background-color: #8A2BE2;
            color: white;
        }

        /* Show add-item-button on hover, or when the folder item is focused or selected */
        /* This rule is now more specific and uses the new structure */
        .file-tree-content li.folder.folder-directly-targeted-by-hover > .folder-item-container > .add-item-button,
        .file-tree-content li.folder.tree-item-focused > .folder-item-container > .add-item-button,
        .file-tree-content li.folder.tree-item-selected > .folder-item-container > .add-item-button {
            opacity: 1;
            visibility: visible;
        }

        /* Adjust main content when file tree is visible */
        .create-main-content,
        .preview-main-content,
        .editor-tab-content-container { /* Added .editor-tab-content-container here */
            flex-grow: 1; /* Ensure these containers can grow */
            min-height: 0; /* Critical for flex children that might contain scrolling content or have fixed-size children */
            width: 100%; /* ENSURED/ADDED */
            box-sizing: border-box; /* ENSURED/ADDED */
            display: flex; /* ADDED for preview-main-content to allow iframe to fill space */
            flex-direction: column; /* ADDED for preview-main-content */
            /* display: flex/none is handled by JS; editor-tab-content-container also needs flex-direction: column */
        }

        /* Adjust main content and editor container height when console is visible */
        .create-page-container.console-visible .create-main-content,
        .create-page-container.console-visible .preview-main-content,
        .create-page-container.console-visible .editor-tab-content-container {
            /* Their height will be reduced by the console panel's height + padding */
            /* No specific rule needed here if they are flex-grow:1 and create-page-container has padding-bottom */
        }

        /* Adjust file tree panel height when console is visible */
        .create-page-container.console-visible .file-tree-panel {
            height: calc(100vh - 60px - 250px); /* site-header + secondary-menu-ribbon + console height */
        }

        /* Drag and Drop Styles for File Tree */
        .file-tree-content li.dragging {
            opacity: 0.4;
            background: #555;
            color: #999999; /* Gray text color for dragging item */
        }
        .file-tree-content li.folder.drag-over {
            background-color: #7B24CB; /* Darker purple to indicate active drop target */
            outline: 1px dashed #E0E0E0;
        }
        .file-tree-content li[draggable="true"] {
            cursor: grab;
        }
        .file-tree-content li.dragging {
            cursor: grabbing;
        }
        /* Ensure non-draggable items don't show grab cursor */
        .file-tree-content li[draggable="false"] {
            cursor: default;
        }

        /* Editor Tab Content Container */
        .editor-tab-content-container {
            display: none; /* Hidden by default, shown when an editor tab is active */
            flex-direction: column; /* Ensures children can use percentage heights properly */
            /* width: 100%; */ /* This is now handled by the common rule above */
            /* background-color: #1e1e1e; /* Monaco default dark theme background */
            /* margin-right needs to adjust if file tree is open, similar to .create-main-content */
            /* transition: margin-right 0.3s ease-in-out; /* Moved to grouped selector */
        }

        /* .create-page-container.file-tree-visible .editor-tab-content-container { */
            /* margin-right: 300px; /* Moved to grouped selector */
        /* } */

        /* Individual Monaco Editor Instance Container */
        .monaco-editor-instance {
            width: 100%;
            height: 100%; /* Fill the .editor-tab-content-container */
            display: none; /* Only the active editor is shown */
        }

        .monaco-editor-instance.active-editor {
            display: block;
        }

        /* Styles for dynamically added file tabs in the secondary menu ribbon */
        .secondary-menu-ribbon .file-tab-button {
            padding: 0.5em 0.75em;
            margin-left: 0.3em;
            background-color: #5a5a5a; /* Default inactive tab color (gray) */
            color: #e0e0e0;
            border: none;
            border-radius: 10px 10px 0 0; /* Rounded top corners */
            cursor: pointer;
            font-size: 0.9em;
            transition: background-color 0.2s ease, color 0.2s ease;
            position: relative; /* For close button positioning */
            white-space: nowrap; /* Prevent tab text from wrapping */
            overflow: hidden; /* Hide overflowed text */
            text-overflow: ellipsis; /* Show ellipsis for overflowed text */
            flex-shrink: 0; /* Prevent tabs from shrinking initially */
        }

        .secondary-menu-ribbon {
            display: flex;
            align-items: center;
            overflow: hidden; /* Hide overflowing tabs */
            position: relative; /* For positioning the more-tabs-button */
        }

        .secondary-menu-ribbon .menu-ribbon-button:not(.more-tabs-button) {
            flex-shrink: 0; /* Prevent main buttons from shrinking */
        }

        .secondary-menu-ribbon .file-tab-button {
            /* Styles from above are mostly fine, ensure flex-shrink allows them to be hidden if needed */
            /* No flex-grow, they should take their content size */
        }

        .more-tabs-button {
            margin-left: auto; /* Pushes it to the far right */
            padding: 0.5em 0.75em;
            border-radius: 10px; /* Fully rounded */
            /* Ensure it's visually distinct or part of the group */
        }

        /* Context Menu for More Tabs */
        .more-tabs-context-menu {
            display: none; /* Hidden by default */
            position: absolute;
            /* Position it near the moreTabsButton. JS will help fine-tune. */
            background-color: #3c3c3c;
            border: 1px solid #505050;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            z-index: 1100; /* Above other menus */
            min-width: 200px;
            max-height: 300px; /* Scrollable */
            overflow-y: auto;
            padding: 5px 0;
        }

        .more-tabs-context-menu button {
            display: block;
            width: calc(100% - 10px); /* Full width minus padding */
            padding: 10px 15px;
            margin: 5px;
            background-color: transparent;
            color: #E0E0E0;
            border: none;
            text-align: left;
            cursor: pointer;
            border-radius: 8px;
            font-size: 0.9em;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .more-tabs-context-menu button:hover {
            background-color: #8A2BE2; /* Purple accent on hover */
            color: white;
        }
        .more-tabs-context-menu button.active {
            background-color: #7B24CB; /* Darker purple for active tab in dropdown */
            color: white;
        }

        .secondary-menu-ribbon .file-tab-button:hover {
            background-color: #6b6b6b;
        }

        .secondary-menu-ribbon .file-tab-button.active {
            background-color: #8A2BE2; /* Purple for active tab */
            color: white;
            /* Bring active tab slightly forward if needed, or use border-bottom to connect to content */
            /* border-bottom: 2px solid #1e1e1e; /* Example: if editor bg is #1e1e1e */
        }

        .secondary-menu-ribbon .file-tab-button .close-tab-button {
            margin-left: 8px;
            padding: 0 4px;
            background: transparent;
            border: none;
            color: #cccccc;
            cursor: pointer;
            font-size: 0.9em;
            border-radius: 50%;
        }
        .secondary-menu-ribbon .file-tab-button.active .close-tab-button {
            color: white;
        }

        .secondary-menu-ribbon .file-tab-button .close-tab-button:hover {
            background-color: rgba(255, 255, 255, 0.2);
            color: white;
        }

        .preview-sandbox-iframe {
            flex-grow: 1; /* ADDED: allow iframe to grow and fill space */
            width: 100%; /* ADDED: ensure iframe takes full width */
            height: 100%; /* ADDED: ensure iframe takes full height */
            border: none; /* REMOVED: border for the iframe */
        }

        /* Markdown Preview Display Styles */
        .markdown-preview-display {
            width: 100%;
            height: 100%;
            padding: 20px;
            box-sizing: border-box;
            background-color: #2C2C2C; /* Same as other content areas */
            color: #E0E0E0; /* Light text for readability */
            overflow-y: auto;
            border-radius: 0 0 15px 15px; /* Rounded bottom corners if it's the last visible element */
        }

        /* Styles for code blocks within markdown preview */
        .markdown-preview-display pre {
            background-color: #1e1e1e; /* Darker background for code blocks */
            border: 1px solid #444444;
            border-radius: 8px; /* Rounded corners for code blocks */
            padding: 15px;
            overflow-x: auto; /* Allow horizontal scrolling for long code lines */
        }

        .markdown-preview-display pre code {
            font-family: 'Courier New', Courier, monospace; /* Monospaced font for code */
            color: #d4d4d4; /* Light color for code text, common in dark themes */
        }

        /* Adjustments for headings, blockquotes, etc. can be added here for consistency */
        .markdown-preview-display h1,
        .markdown-preview-display h2,
        .markdown-preview-display h3,
        .markdown-preview-display h4,
        .markdown-preview-display h5,
        .markdown-preview-display h6 {
            color: #9370DB; /* Purple for headings */
            margin-top: 1.5em;
            margin-bottom: 0.5em;
        }

        .markdown-preview-display p {
            line-height: 1.6;
            margin-bottom: 1em;
        }

        .markdown-preview-display a {
            color: #8A2BE2; /* Purple for links */
            text-decoration: none;
        }
        .markdown-preview-display a:hover {
            text-decoration: underline;
        }

        .markdown-preview-display blockquote {
            border-left: 4px solid #9370DB; /* Purple left border */
            padding-left: 15px;
            margin-left: 0;
            color: #b0b0b0; /* Slightly dimmer text for quotes */
            font-style: italic;
        }

        .markdown-preview-display ul,
        .markdown-preview-display ol {
            margin-left: 20px;
            margin-bottom: 1em;
        }

        .markdown-preview-display code:not(pre code) {
            background-color: #444444;
            padding: 0.2em 0.4em;
            margin: 0;
            font-size: 85%;
            border-radius: 3px;
        }

        /* Style for the Markdown View Toggle Button */
        #markdownViewToggleBtn {
            /* Similar to other ribbon buttons but can have unique aspects */
            /* For example, if it's more of a toggle, its active state might be different */
        }
        #markdownViewToggleBtn.active {
            background-color: #9370DB; /* MediumPurple for active state */
            color: white;
        }

        #markdownViewToggleBtn {
            width: 150px; /* Or a width that comfortably fits both '✏️ Edit Markdown' and '👁️ View Markdown' */
            text-align: center;
            justify-content: center;
        }

        /* Added for loading animation enhancements */
        .loading-status-line {
            display: flex;
            align-items: center;
            transition: transform 0.5s ease-in-out, opacity 0.3s ease-in-out;
            opacity: 0; /* Initially transparent */
            transform: translateY(50px); /* Start 50px lower, adjust as needed */
        }

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

        .loading-logo {
            /* Ensure no conflicting direct animation property is set here */
        }

        .loading-logo.spinning-slow {
            animation: spin 2s linear infinite; /* Slow spinning */
        }

        .loading-logo.spinning-fast {
            animation: spin 0.5s linear infinite; /* 2x faster */
        }

        .loading-logo.stopped {
            animation: none;
            transform: rotate(0deg); /* Ensure it resets to a non-rotated state */
        }
        /* End of added styles for loading animation */

        /* Sandbox Fullscreen Mode Styles */
        .create-page-container.sandbox-fullscreen-active .site-header,
        .create-page-container.sandbox-fullscreen-active .secondary-menu-ribbon,
        .create-page-container.sandbox-fullscreen-active #fileTreePanel {
            display: none !important; /* Force hide */
        }

        .create-page-container.sandbox-fullscreen-active .preview-main-content {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw; /* Full viewport width */
            height: 100vh; /* Full viewport height */
            z-index: 2000; /* Ensure it's above other page elements if any remain */
            padding: 0; /* Remove any padding */
            margin: 0; /* Remove any margin */
        }

        .create-page-container.sandbox-fullscreen-active #previewSandbox {
            width: 100%;
            height: 100%;
        }

        /* Ensure the main preview content area is visible and takes up space when fullscreen is active */
        .create-page-container.sandbox-fullscreen-active #aiMainContent,
        .create-page-container.sandbox-fullscreen-active #editorTabContentContainer {
            display: none !important; /* Hide AI and Editor views */
        }

        .create-page-container.sandbox-fullscreen-active #previewMainContent {
            display: flex !important; /* Ensure preview is visible */
            padding-right: 0 !important; /* Override padding-right from .file-tree-visible */
        }

        .create-page-container.sandbox-fullscreen-active {
            padding-right: 0 !important; /* Override padding-right from .file-tree-visible */
        }

        /* Styles for the flashing thinking emoji */
        .thinking-emoji {
            display: inline-block; /* Allows for better control if needed */
            animation: flash 1s infinite;
            font-size: 1.5em; /* Make it a bit larger, adjust as needed */
            margin-left: 8px; /* Space from any preceding text */
        }

        @keyframes flash {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.2; }
        }

#streamingResponse {
    background: transparent;
    border: none;
}

/* MODIFIED: Style for paragraphs within the streaming response area */
#streamingResponse p {
    margin-top: 0;
    margin-bottom: 4px; /* Further reduced fixed pixel value */
    line-height: 1.3;  /* Tighter line height */
}

/* ADDED: Collapse empty paragraphs (Ensure this rule is effective) */
#streamingResponse p:empty {
    margin: 0 !important; /* Add !important to ensure override */
    padding: 0 !important;
    height: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important; /* Ensure line-height is also zeroed out */
    display: block; /* Ensure it's treated as a block to apply height:0 */
}
/* END MODIFIED / ADDED */

/* Styles for code blocks and inline code within the streaming response area */
#streamingResponse pre {
    background-color: #1e1e1e; /* Atom One Dark editor background color, or similar dark shade */
    border: 1px solid #444444; /* Subtle border, consistent with header */
    border-radius: 8px;       /* Rounded corners for the entire pre block */
    padding: 0; /* ADDED - Header will be flush, code element gets padding */
    overflow-x: auto;         /* Allow horizontal scrolling for long code lines */
    margin-top: 1em;          /* Space above the code block */
    margin-bottom: 1em;       /* Space below the code block */
    line-height: 1.45;        /* Adjust line height for readability */
    font-size: 0.9em;         /* Slightly smaller font size for code blocks */
    position: relative;
}

#streamingResponse pre code.hljs { /* Target specifically highlight.js processed code */
    padding: 15px; /* ADDED - Code content padding */
    display: block; /* ADDED - To ensure padding and layout are respected */
    background: none; /* Ensure no overriding background */
    color: #abb2bf; /* Default text color for atom-one-dark, can be overridden by hljs spans */
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; /* Common monospaced font stack */
    border-radius: 0 0 8px 8px; /* ADDED - Bottom rounded corners for the code content area */
}

/* Styles for inline code within the streaming response area */
#streamingResponse code:not(pre code) {
    background-color: #3a3a3a; /* Slightly lighter dark gray background for inline code */
    color: #E0E0E0;            /* Light text color */
    padding: 0.2em 0.4em;
    margin: 0 0.1em;
    font-size: 85%;
    border-radius: 5px;       /* Rounded corners */
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; /* Consistent monospaced font */
}

/* Ensure pre tags are positioned relatively for absolute positioning of copy button */
#streamingResponse pre {
    position: relative;
}

/* New Code Block Header Styles */
.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333333; /* Darker than pre, but lighter than main bg */
    color: #E0E0E0;
    padding: 6px 10px;
    border-bottom: 1px solid #444444;
    border-radius: 8px 8px 0 0; /* Rounded top corners, matching pre */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Consistent UI font */
    font-size: 0.85em;
}

.code-block-header .file-info {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px; /* Space before buttons */
}

.code-block-header .code-block-buttons {
    display: flex;
    align-items: center;
}
/* End New Code Block Header Styles */

/* Copy Code Button Styles */
.copy-code-button {
    position: relative; /* CHANGED */
    background-color: #4F4F4F; /* Darker gray, less prominent than purple */
    color: #E0E0E0;
    border: 1px solid #666666;
    border-radius: 8px; /* Rounded corners */
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.85em;
    opacity: 1; /* Slightly transparent by default, more visible on hover */
    transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    font-family: inherit; /* Inherit font from body */
    /* Added to better accommodate the icon and temporary text */
    min-width: 30px; /* Ensure button has a minimum width */
    min-height: 30px; /* Ensure button has a minimum height */
    display: inline-flex; /* Helps center content if needed */
    align-items: center;
    justify-content: center;
    margin-left: 5px; /* ADDED for spacing between buttons in the header */
    padding: 0;
    flex-shrink: 0; /* Prevent button from shrinking */

    /* --- Styles for visibility control --- */
    opacity: 0;
    visibility: hidden;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.15s ease-in-out;
    /* --- End styles for visibility control --- */
}

.copy-code-button:hover {
    background-color: #8A2BE2; /* Galatron Purple on hover */
    color: white;
    opacity: 1;
    border-color: #8A2BE2;
}

.copy-code-button.copied {
    background-color: #4CAF50; /* Green for success */
    color: white;
    border-color: #4CAF50;
    opacity: 1;
}

/* Apply Code Button Styles (new) */
.apply-code-button {
    position: relative; /* CHANGED */
    background-color: #4F4F4F; /* Match copy button's default */
    color: #E0E0E0;
    border: 1px solid #666666;
    border-radius: 8px; /* Rounded corners */
    padding: 5px 10px; /* Match copy button's padding */
    cursor: pointer;
    font-size: 0.85em; /* Match copy button's font size */
    opacity: 1;
    transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    font-family: inherit;
    min-width: 30px; /* Ensure similar minimum size */
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* For better icon centering */
    margin-left: 5px; /* ADDED for spacing between buttons in the header */
}

.apply-code-button:hover {
    background-color: #8A2BE2; /* Galatron Purple on hover */
    color: white;
    border-color: #8A2BE2;
    opacity: 1;
}

/* States for the apply button */
/* Default/Pending state (when it's about to be auto-applied or if manual click was an option) */
.apply-code-button.pending-application {
    background-color: #6c757d; /* A neutral pending color, e.g., secondary gray */
    color: white;
    border-color: #606060; /* Slightly darker border than default button */
}
.apply-code-button.pending-application:hover {
    background-color: #5a6268; /* Darker gray on hover */
    border-color: #545b62;
}

.apply-code-button.applied-success {
    background-color: #4CAF50; /* Green for success */
    color: white;
    border-color: #4CAF50;
}
.apply-code-button.applied-success:hover {
    background-color: #45a049; /* Darker green on hover */
    border-color: #3e8e41;
}

.apply-code-button.applied-failure {
    background-color: #E53935; /* Red for failure */
    color: white;
    border-color: #E53935;
}
.apply-code-button.applied-failure:hover {
    background-color: #d32f2f; /* Darker red on hover */
    border-color: #c62828;
}

/* Focus style for the AI prompt input textarea */
.prompt-textarea:focus {
    outline: 2px solid #8A2BE2; /* Galatron Purple (BlueViolet) */
}

/* New styles for random prompt button */
.random-prompt-button {
    background-color: transparent;
    border: none;
    color: #E0E0E0;
    cursor: pointer;
    font-size: 1.5rem; /* Larger emoji */
    padding: 0 15px;
    transition: transform 0.2s ease-in-out;
    align-self: stretch; /* Make button same height as textarea */
}

.random-prompt-button:hover {
    transform: scale(1.1);
}

/* New styles for send/stop button */
.send-prompt-button {
    background-color: transparent;
    border: none;
    color: #E0E0E0;
    cursor: pointer;
    font-size: 1.5rem; /* Larger emoji */
    padding: 0 15px;
    transition: transform 0.2s ease-in-out;
    align-self: stretch; /* Make button same height as textarea */
}

.send-prompt-button:hover {
    transform: scale(1.1);
}

.send-prompt-button.stop-mode {
    /* Styles for when it's a stop button */
    /* Transparent background is default, can add specific styles if needed */
}

.send-prompt-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.random-prompt-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Console Panel Styles */
.console-panel {
    position: fixed;
    bottom: -250px; /* Start off-screen, assuming 250px height */
    left: 0;
    width: 100%;
    height: 250px; /* Adjust as needed */
    background-color: #252526; /* Darker than file tree, similar to VS Code terminal */
    border-top: 1px solid #505050;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 950; /* Above content, below file tree if they could overlap (though they wont much) */
    transition: bottom 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    border-radius: 15px 15px 0 0; /* Match panel rounding */
}

.console-panel.visible {
    bottom: 0; /* Slide in */
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background-color: #333333; /* Slightly different header color */
    border-bottom: 1px solid #505050;
    border-radius: 15px 15px 0 0; /* Match panel rounding */
    height: 40px; /* Fixed height for header */
    box-sizing: border-box;
    flex-shrink: 0;
}

.auto-fix-indicator {
    background-color: rgba(255, 107, 107, 0.2);
    color: #FF6B6B;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    border: 1px solid rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

.auto-fix-indicator:hover {
    background-color: rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.5);
}

.console-title {
    font-size: 1em;
    color: #E0E0E0;
}

.console-controls button {
    background-color: transparent;
    color: #b0b0b0;
    border: 1px solid #606060;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    padding: 3px 6px;
    margin-left: 8px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.console-controls button:hover {
    background-color: #8A2BE2;
    color: white;
    border-color: #8A2BE2;
}

/* Fix All Errors Button Styles */
.fix-all-button {
    /* Default state - gray like other console buttons */
    background-color: transparent;
    color: #b0b0b0;
    border-color: #606060;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Red glow state when there are errors */
.fix-all-button.has-errors {
    background-color: #FF6B6B !important;
    color: white !important;
    border-color: #FF6B6B !important;
    animation: pulse 2s infinite;
}

.fix-all-button:hover {
    background-color: #8A2BE2;
    color: white;
    border-color: #8A2BE2;
}

.fix-all-button.has-errors:hover {
    background-color: #FF5252 !important;
    color: white !important;
    border-color: #FF5252 !important;
    animation: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* Responsive design for console controls */
@media (max-width: 768px) {
    .console-controls {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .console-controls button {
        font-size: 0.8em;
        padding: 2px 4px;
        margin-left: 4px;
    }
    
    .fix-all-button {
        order: -1; /* Show fix all button first on mobile */
    }
}

.console-content {
    flex-grow: 1;
    padding: 10px;
    color: #D0D0D0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    overflow-y: auto;
    line-height: 1.5;
}

.console-content .console-message {
    padding: 2px 0;
    white-space: pre-wrap; /* Preserve whitespace and wrap lines */
    border-bottom: 1px dotted #444; /* Subtle separator */
}
.console-content .console-message:last-child {
    border-bottom: none;
}

.console-content .console-message.error {
    color: #FF6B6B; /* Red for errors */
}

.console-content .console-message.warning {
    color: #FFD166; /* Yellow/Orange for warnings */
}

.console-content .console-message.log {
    color: #D0D0D0; /* Default log color */
}

.console-content .console-message.info {
    color: #72A1E5; /* Blue for info */
}

.console-content .console-message.debug {
    color: #9E9E9E; /* A muted gray, or choose another color */
    /* Example: font-style: italic; */
}

/* Style for the CONSOLE button state */
#consoleButton:not(.active) {
    background-color: #5a5a5a; /* Default gray for inactive state */
    color: #e0e0e0; /* Light gray text for readability on dark gray */
}

#consoleButton:not(.active):hover {
    background-color: #6b6b6b; /* Slightly lighter gray on hover */
}

#consoleButton.active {
    background-color: #8A2BE2; /* Main purple for active state */
    color: white;
}

#consoleButton.active:hover {
    background-color: #7B24CB; /* Darker purple on hover for active state */
}

/* New styles for console tabs */
.console-tabs {
    display: flex;
    align-items: center;
}

.console-icon {
    margin-right: 10px;
}

.console-tab-button {
    background-color: transparent;
    border: none;
    color: #b0b0b0;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 1em;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    margin-right: 10px;
}

.console-tab-button:hover {
    color: #E0E0E0;
}

.console-tab-button.active {
    color: #E0E0E0;
    border-bottom: 2px solid #8A2BE2;
}

.console-content {
    /* Existing styles are fine, but it needs to be hidden/shown */
    display: none; /* Hide by default */
    flex-grow: 1;
    padding: 10px;
    color: #D0D0D0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    overflow-y: auto;
    line-height: 1.5;
}

.console-content.active {
    display: block; /* Show active tab content */
}
/* END New styles for console tabs */

/* New CSS for Problems Tab */
.problem-file-container {
    margin-bottom: 10px;
}

.problem-file-header {
    font-weight: bold;
    color: #E0E0E0;
    background-color: #333333;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: default;
}

.problem-list {
    list-style-type: none;
    padding-left: 10px;
    margin-top: 5px;
}

.problem-item {
    display: flex;
    align-items: center;
    padding: 4px 5px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.problem-item:hover {
    background-color: #4a4a4a;
}

.problem-item .problem-icon {
    margin-right: 8px;
    flex-shrink: 0;
}

.problem-text-container {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
    display: inline; /* Keep message and location on the same line */
}

.problem-item .problem-message {
    margin-right: 8px;
}

.problem-item.error .problem-message {
    color: #FF6B6B;
}

.problem-item.warning .problem-message {
    color: #FFD166;
}

.problem-item .problem-location {
    color: #82caff;
    font-family: 'Courier New', Courier, monospace;
    margin-left: 4px; /* ADDED for spacing */
}

.problem-fix-button {
    background: transparent;
    border: 1px solid #606060;
    color: #b0b0b0;
    border-radius: 5px;
    cursor: pointer;
    margin-left: auto; /* Pushes the button to the far right */
    padding: 2px 5px;
    font-size: 0.9em;
    line-height: 1;
    flex-shrink: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.problem-fix-button:hover {
    background-color: #8A2BE2;
    color: white;
}

/* New styles for console message count badge */
.message-count-badge {
    background-color: #6a6a6a;
    color: #e0e0e0;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* Styles for AI Thinking Blocks */
.thinking-block {
    background-color: #3a3a3a;
    border: 1px solid #505050;
    border-radius: 8px;
    margin-top: 10px;
    margin-bottom: 15px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.thinking-block-title {
    font-weight: bold;
    color: #FFFFFF; /* White text for title */
    margin-bottom: 8px;
    font-size: 1.1em;
}

.thinking-block-summary {
    color: #E0E0E0; /* Light gray for summary text */
    padding: 8px 0px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
    margin-bottom: 5px; /* Space before content if expanded */
}

.thinking-block-summary:hover {
    background-color: #4a4a4a; /* Subtle hover effect */
}

.thinking-block-summary.expanded {
    /* Optional: add an indicator like a down arrow or change text */
    /* For example, add a small triangle or modify padding */
}

.thinking-block-content {
    color: #CCCCCC; /* Lighter gray for content text */
    padding: 10px;
    background-color: #2C2C2C; /* Match main background or a very dark gray */
    border-radius: 6px; /* Rounded corners for the content area itself */
    line-height: 1.6;
}

/* Ensure content within the thinking block respects the theme */
.thinking-block-content p,
.thinking-block-content div,
.thinking-block-content pre {
    color: #CCCCCC; /* Default text color */
}

.thinking-block-content pre {
    background-color: #1e1e1e; /* Darker background for code blocks */
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    white-space: pre-wrap; /* Wrap long lines */
    word-wrap: break-word; /* Break words if necessary */
}

.thinking-block-content code {
    color: #d4d4d4; /* Standard code color */
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}

.site-header {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 60px; /* Fixed height for the header */
    background-color: #333333; /* Dark gray background */
    color: white;
    position: relative; /* For animated-header-pop if it uses absolute positioning */
    z-index: 1000; /* Ensure header is above other content */
    border-bottom: 1px solid #505050; /* Subtle separator */
    flex-shrink: 0; /* Prevent header from shrinking if content is too long */
}

.header-navigation {
    display: flex; /* Keeps nav buttons in a row */
    align-items: center;
    flex-grow: 1; /* Allows navigation to take available space and push right controls */
    justify-content: flex-start; /* Align nav buttons to the start of their container */
    margin-left: 20px; /* Add some space between logo and nav buttons */
    min-width: 0;
}

.header-controls-right {
    display: flex;
    align-items: center;
    margin-left: auto; /* Pushes this div to the far right of the header */
}

.fullscreen-button {
    background-color: transparent !important; /* Override default button styles if necessary */
    border: none !important;
    padding: 0.5em !important; /* Adjust padding as needed */
    margin-left: 1em !important;
    cursor: pointer;
}

.fullscreen-button img {
    width: 24px; /* Adjust size as needed */
    height: 24px; /* Adjust size as needed */
    filter: brightness(0) invert(1); /* Simpler filter for white */
    display: block; /* Remove extra space below img */
}

.fullscreen-button:hover img {
    filter: brightness(0) saturate(100%) invert(48%) sepia(59%) saturate(2475%) hue-rotate(242deg) brightness(89%) contrast(93%);
}

.console-source-link {
    color: #82caff; /* A light blue, easily readable */
    text-decoration: underline;
    cursor: pointer;
    margin-left: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.console-source-link:hover {
    color: #a2daff;
}

/* Editor Line Highlighting */
.line-highlight-from-console {
    background-color: rgba(138, 43, 226, 0.3); /* Semi-transparent purple */
    transition: background-color 1s ease-out;
}

.line-highlight-glyph-from-console {
    background: #9370DB; /* A solid purple for the glyph margin */
}

/* New: Editor Squiggle Styles for Linting */
.editor-squiggle-error {
    background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23FF6B6B'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.5%2C3%201.5%2C2'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") repeat-x bottom left;
}
.editor-squiggle-warning {
    background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23FFD166'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.5%2C3%201.5%2C2'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") repeat-x bottom left;
}

/* New: Glyph Margin Icons for Linting */
.editor-glyph-error {
    background: #FF6B6B;
}
.editor-glyph-warning {
    background: #FFD166;
}

/* Loading Overlay Controls */
.overlay-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    z-index: 10;
}

.overlay-control-button {
    background-color: #4F4F4F;
    color: #E0E0E0;
    border: 1px solid #666666;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em; /* Larger for better visibility */
    line-height: 1;
    width: 32px;
    height: 32px;
    margin-left: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.overlay-control-button:hover {
    background-color: #8A2BE2;
    color: white;
    border-color: #8A2BE2;
}

.overlay-control-button.stop-button:hover {
    background-color: #c62828; /* Darker red on hover */
    border-color: #7a7a7a;
}

.overlay-control-button.undo-button:hover:not(:disabled) {
    background-color: #f5a623; /* An orange for undo hover */
    border-color: #f5a623;
}

.overlay-control-button:disabled {
    background-color: #4f4f4f;
    color: #888888;
    cursor: not-allowed;
    border-color: #666666;
}

.overlay-control-button.disabled {
    background-color: #4f4f4f;
    color: #888888;
    cursor: not-allowed;
    border-color: #666666;
    opacity: 0.5;
}

.file-info {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    color: #cccccc;
    padding: 2px 8px;
}

.file-info.clickable-file-link {
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.file-info.clickable-file-link:hover {
    color: #8A2BE2; /* Main platform purple for hover */
}

.code-block-buttons {
    display: flex;
    gap: 4px;
}

/* NEW: Styles for displaying the user's prompt */
.user-prompt-message {
    background-color: #3c3c3c; /* A slightly darker gray to differentiate from thinking blocks */
    color: #E0E0E0;
    padding: 15px;
    border-radius: 15px; /* Prominently rounded corners */
    margin-bottom: 20px; /* Space before AI response */
    line-height: 1.6;
    display: flex;
    align-items: flex-start; /* Align icon with the start of the text block */
}

.user-prompt-message .prompt-icon {
    margin-right: 12px;
    font-size: 1.2em; /* Make the icon slightly larger */
    padding-top: 2px; /* Small adjustment for vertical alignment */
}

.user-prompt-message .prompt-text {
    white-space: pre-wrap; /* Preserve user's line breaks in the prompt */
}

/* Settings Panel Styles */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.settings-panel.visible {
    opacity: 1;
}

.settings-content-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #2C2C2C;
    border: 1px solid #505050;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    max-width: 90vw;
    max-height: 90vh;
    width: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: settingsSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes settingsSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #333333;
    border-bottom: 1px solid #505050;
    border-radius: 15px 15px 0 0;
}

.settings-header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-header h3 {
    margin: 0;
    color: #E0E0E0;
    font-size: 1.2em;
}

.settings-close-button {
    background-color: transparent;
    border: none;
    color: #E0E0E0;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.settings-close-button:hover {
    background-color: #8A2BE2;
    color: white;
}

.settings-content {
    flex-grow: 1;
    padding: 20px 25px 25px;
    overflow-y: auto;
}

.setting-group {
    margin-bottom: 25px;
}

.setting-group h4 {
    color: #9370DB;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    border-bottom: 1px solid #505050;
    padding-bottom: 8px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #444444;
}

.setting-item:last-child {
    border-bottom: none;
    align-items: center;
    justify-content: flex-end;
    min-width: 120px;
}

.setting-info {
    flex-grow: 1;
    margin-right: 20px;
}

.setting-label {
    display: block;
    color: #E0E0E0;
    font-weight: 500;
    margin-bottom: 5px;
    cursor: pointer;
}

.setting-description {
    color: #B0B0B0;
    font-size: 0.9em;
    margin: 0;
    line-height: 1.4;
}

.setting-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 120px;
}

.api-key-input {
    width: calc(100% - 20px);
    max-width: 100%;
    padding: 12px 16px;
    background-color: #333333;
    border: 1px solid #505050;
    border-radius: 8px;
    color: #E0E0E0;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin: 10px auto 0 auto;
    box-sizing: border-box;
    display: block;
}

.api-key-input:focus {
    outline: none;
    border-color: #8A2BE2;
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

.api-key-input::placeholder {
    color: #9E9E9E;
}

.setting-description a {
    color: #8A2BE2;
    text-decoration: none;
    transition: color 0.2s ease;
}

.setting-description a:hover {
    color: #9370DB;
    text-decoration: underline;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #5a5a5a;
    transition: 0.3s;
    border-radius: 24px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #8A2BE2;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.settings-reset-button {
    background-color: #5a5a5a;
    color: #E0E0E0;
    border: 1px solid #666666;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.settings-reset-button:hover {
    background-color: #8A2BE2;
    color: white;
    border-color: #8A2BE2;
}

/* Enhanced Settings Panel Styles */
.setting-group h4 {
    color: #9370DB;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    border-bottom: 1px solid #505050;
    padding-bottom: 8px;
    position: relative;
}

.setting-group h4::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #8A2BE2, #9370DB);
    border-radius: 1px;
}

/* Error Management specific styling */
.setting-group:has(#autoFixConsoleErrorsSetting) h4 {
    color: #FF6B6B;
}

.setting-group:has(#autoFixConsoleErrorsSetting) h4::before {
    background: linear-gradient(90deg, #FF6B6B, #FF5252);
}

/* Enhanced toggle switch for error management */
.setting-group:has(#autoFixConsoleErrorsSetting) .toggle-switch input:checked + .toggle-slider {
    background-color: #FF6B6B;
}

.setting-group:has(#autoFixConsoleErrorsSetting) .toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Mobile Responsive Styles for Settings Panel */
@media (max-width: 768px) {
    .settings-content-wrapper {
        width: 90vw;
        max-width: 90vw;
    }
    
    .settings-header {
        padding: 15px;
    }
    
    .settings-header h3 {
        font-size: 1.1em;
    }
    
    .settings-content {
        padding: 15px 20px 20px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .setting-info {
        margin-right: 0;
        width: 100%;
    }
    
    .setting-control {
        align-self: flex-end;
        min-width: auto;
    }
    
    .settings-header-controls {
        gap: 8px;
    }
    
    .settings-reset-button {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .settings-content-wrapper {
        width: 95vw;
        max-width: 95vw;
        border-radius: 15px;
    }
    
    .settings-header {
        padding: 12px;
        border-radius: 15px 15px 0 0;
    }
    
    .settings-content {
        padding: 10px 15px 15px;
    }
    
    .setting-group h4 {
        font-size: 1em;
    }
    
    .setting-label {
        font-size: 0.95em;
    }
    
    .setting-description {
        font-size: 0.85em;
    }
    
    /* Enhanced mobile styling for error management */
    .setting-group:has(#autoFixConsoleErrorsSetting) .setting-item {
        background-color: rgba(255, 107, 107, 0.05);
        border-radius: 8px;
        padding: 12px;
        margin: 8px 0;
        border-bottom: none;
    }
    
    .setting-group:has(#autoFixConsoleErrorsSetting) .setting-description {
        color: #FFB3B3;
    }
    
    .settings-reset-button {
        width: auto;
        padding: 8px 16px;
    }
    
    .settings-header-controls {
        gap: 5px;
    }
    
    .settings-reset-button {
        padding: 5px 10px;
        font-size: 0.8em;
    }
}

/* Enhanced hover effects for settings */
.setting-item:hover {
    background-color: rgba(138, 43, 226, 0.05);
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.setting-group:has(#autoFixConsoleErrorsSetting) .setting-item:hover {
    background-color: rgba(255, 107, 107, 0.1);
}

/* Smooth transitions for all interactive elements */
.setting-item,
.toggle-switch,
.settings-reset-button {
    transition: all 0.2s ease-in-out;
}

/* Focus styles for accessibility */
.setting-item:focus-within {
    outline: 2px solid #8A2BE2;
    outline-offset: 2px;
    border-radius: 8px;
}

.setting-group:has(#autoFixConsoleErrorsSetting) .setting-item:focus-within {
    outline-color: #FF6B6B;
}

/* Task Completion Workflow Styles */
.task-completion-status {
    position: fixed;
    top: 50px; /* MODIFIED - Lowered to not block header buttons */
    right: 20px;
    background-color: rgba(44, 44, 44, 0.95);
    border: 1px solid #8A2BE2;
    border-radius: 15px;
    padding: 15px 20px;
    color: white;
    font-size: 14px;
    z-index: 2000;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.task-completion-status .status-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.task-completion-status .status-icon {
    margin-right: 8px;
    font-size: 16px;
}

.task-completion-status .status-phase {
    color: #8A2BE2;
    font-size: 12px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-completion-status .status-details {
    font-size: 12px;
    color: #ccc;
    margin-top: 8px;
}

.task-completion-status .progress-bar {
    width: 100%;
    height: 4px;
    background-color: #333;
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.task-completion-status .progress-fill {
    height: 100%;
    background-color: #8A2BE2;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Task completion status animations */
@keyframes taskStatusSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes taskStatusSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.task-completion-status.slide-in {
    animation: taskStatusSlideIn 0.3s ease-out;
}

.task-completion-status.slide-out {
    animation: taskStatusSlideOut 0.3s ease-in;
}

/* Mobile responsive styles for task completion */
@media (max-width: 768px) {
    .task-completion-status {
        top: 50px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 13px;
    }
}

/* Search Panel Styles */
.search-panel {
    position: fixed;
    top: 70px; /* Position below header */
    left: 50%;
    width: 90%;
    max-width: 600px; /* Max width for larger screens */
    background-color: rgba(44, 44, 44, 0.95); /* Semi-transparent background */
    backdrop-filter: blur(10px); /* Frosted glass effect */
    border: 1px solid #505050;
    border-radius: 20px; /* Prominently rounded corners */
    z-index: 1100; /* High z-index to be on top */
    transform: translate(-50%, -150%); /* Start off-screen */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); /* Deeper shadow */
    max-height: 70vh;
}

.search-panel.visible {
    transform: translate(-50%, 0); /* Slide in to place */
    color: white;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: transparent; /* Header is part of the blur */
    border-bottom: 1px solid #505050;
    border-radius: 20px 20px 0 0; /* Match panel rounding */
    min-height: 50px;
}

.search-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-icon {
    font-size: 1.2em;
    color: #E0E0E0;
}

.search-tab-button {
    background: none;
    border: none;
    color: #9E9E9E;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.search-tab-button:hover {
    background-color: #505050;
    color: #E0E0E0;
}

.search-tab-button.active {
    background-color: #8A2BE2;
    color: white;
}

.search-controls {
    display: flex;
    gap: 5px;
}

.search-controls button {
    background: none;
    border: none;
    color: #9E9E9E;
    padding: 5px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-controls button:hover {
    background-color: #505050;
    color: #E0E0E0;
}

.search-content {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 15px;
}

.search-content.active {
    display: flex;
}

.search-input-container {
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 12px;
    background-color: rgba(60, 60, 60, 0.8);
    border: 1px solid #505050;
    border-radius: 12px;
    color: #E0E0E0;
    font-size: 1em;
    margin-bottom: 10px;
    box-sizing: border-box; /* Added for correct padding calculation */
}

.search-input:focus {
    outline: none;
    border-color: #8A2BE2;
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

.search-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-option {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #9E9E9E;
    font-size: 0.8em;
    cursor: pointer;
}

.search-option input[type="checkbox"] {
    margin: 0;
    accent-color: #8A2BE2;
    filter: grayscale(1) brightness(0.8);
    opacity: 0.7;
}

.search-option input[type="checkbox"]:checked {
    filter: none;
    opacity: 1;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    background-color: transparent; /* Let the panel's blurred background show */
    border-radius: 12px;
    border: none; /* No separate border needed */
}

.search-results-list {
    padding: 10px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 5px;
}

.search-result-item:hover {
    background-color: rgba(60, 60, 60, 0.8);
}

.search-result-icon {
    font-size: 1.1em;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    color: #E0E0E0;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-path {
    color: #9E9E9E;
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-file {
    margin-bottom: 15px;
    border: 1px solid transparent; /* Remove visible border */
    border-radius: 12px;
    overflow: hidden;
    background-color: rgba(50, 50, 50, 0.5); /* Background for each file result group */
}

.search-result-file-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: rgba(60, 60, 60, 0.7);
    border-bottom: 1px solid #505050;
}

.search-result-file-name {
    color: #E0E0E0;
    font-weight: 500;
}

.search-result-file-path {
    color: #9E9E9E;
    font-size: 0.8em;
}

.search-result-matches {
    padding: 10px;
}

.search-result-match {
    display: flex;
    gap: 10px;
    padding: 5px 0;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.search-result-match:hover {
    background-color: rgba(60, 60, 60, 0.8);
}

.search-result-line-info {
    color: #8A2BE2;
    font-size: 0.8em;
    font-weight: 500;
    min-width: 60px;
    flex-shrink: 0;
}

.search-result-line-content {
    color: #E0E0E0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
}

.search-highlight {
    background-color: #8A2BE2;
    color: white;
    padding: 1px 2px;
    border-radius: 6px;
}

/* Search button styles */
#searchButton:not(.active) {
    background-color: #5a5a5a;
    color: #e0e0e0;
}

#searchButton:not(.active):hover {
    background-color: #6b6b6b;
}

#searchButton.active {
    background-color: #8A2BE2;
    color: white;
}

/* Responsive adjustments for search panel */
@media (max-width: 768px) {
    .search-panel {
        width: 95vw;
        height: auto;
        max-height: 70vh; /* Set max height for mobile */
        top: 65px;
    }

    .search-header {
        padding: 10px 15px;
    }

    .search-tabs {
        gap: 8px;
    }

    .search-tab-button {
        padding: 4px 8px;
        font-size: 0.8em;
    }

    .search-content {
        padding: 12px;
    }

    .search-input {
        padding: 8px;
        font-size: 0.85em;
    }

    .search-options {
        gap: 8px;
    }

    .search-option {
        font-size: 0.75em;
    }

    .search-results-list {
        padding: 8px;
    }

    .search-result-item {
        padding: 6px 8px;
    }

    .search-result-file-header {
        padding: 8px;
    }

    .search-result-matches {
        padding: 8px;
    }

    .search-result-match {
        padding: 4px 0;
    }

    .search-result-line-content {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .search-panel {
        height: auto;
        max-height: 80vh; /* Allow more height on small screens */
        top: 60px;
        border-radius: 15px;
    }

    .search-header {
        padding: 8px 12px;
        border-radius: 15px 15px 0 0;
    }

    .search-tab-button {
        padding: 3px 6px;
        font-size: 0.75em;
    }

    .search-content {
        padding: 10px;
    }

    .search-input {
        padding: 6px;
        font-size: 0.8em;
    }

    .search-options {
        flex-direction: column;
        gap: 6px;
    }

    .search-option {
        font-size: 0.7em;
    }

    .search-results-list {
        padding: 6px;
    }

    .search-result-item {
        padding: 5px 6px;
    }

    .search-result-file-header {
        padding: 6px;
        flex-wrap: wrap;
    }

    .search-result-matches {
        padding: 6px;
    }

    .search-result-match {
        padding: 3px 0;
        flex-direction: column;
        gap: 5px;
    }

    .search-result-line-info {
        min-width: auto;
    }

    .search-result-line-content {
        font-size: 0.75em;
    }
}

/* Adjust file tree height when search is visible - REMOVED */

/* Mode switch styles */

.mode-switch-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
}

.mode-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
}

.mode-label {
    color: #E0E0E0;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
    min-width: 60px;
    text-align: center;
    flex-shrink: 0;
}

.mode-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin: 0;
}

.mode-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #505050 0%, #666666 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mode-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, #E0E0E0 0%, #CCCCCC 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mode-toggle input:checked + .mode-slider {
    background: linear-gradient(135deg, #8A2BE2 0%, #9370DB 50%, #8A2BE2 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(138, 43, 226, 0.4);
}

.mode-toggle input:checked + .mode-slider:before {
    transform: translateX(30px);
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F0F0 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mode-toggle:hover .mode-slider {
    background: linear-gradient(135deg, #666666 0%, #777777 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 8px rgba(255, 255, 255, 0.1);
}

.mode-toggle:hover input:checked + .mode-slider {
    background: linear-gradient(135deg, #9370DB 0%, #8A2BE2 50%, #9370DB 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 15px rgba(138, 43, 226, 0.6);
    transform: scale(1.05);
}

.mode-toggle:hover input:checked + .mode-slider:before {
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.8);
}

/* Animation for label color change */
.mode-label.agent-mode {
    color: #8A2BE2;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
}

.mode-label.manual-mode {
    color: #9E9E9E;
}

@media (max-width: 768px) {
    .mode-switch-container {
        margin-bottom: 15px;
        padding-left: 15px;
    }
    
    .mode-switch-wrapper {
        gap: 12px;
    }
    
    .mode-label {
        font-size: 15px;
        min-width: 55px;
    }
    
    .mode-toggle {
        width: 55px;
        height: 28px;
    }
    
    .mode-slider:before {
        height: 20px;
        width: 20px;
    }
    
    .mode-toggle input:checked + .mode-slider:before {
        transform: translateX(27px);
    }
    
    .api-key-input {
        font-size: 13px;
        padding: 10px 14px;
    }
}

@media (max-width: 480px) {
    .mode-switch-container {
        padding-left: 10px;
    }
    
    .mode-switch-wrapper {
        gap: 10px;
    }
    
    .mode-label {
        font-size: 14px;
        min-width: 50px;
    }
    
    .mode-toggle {
        width: 50px;
        height: 26px;
    }
    
    .mode-slider:before {
        height: 18px;
        width: 18px;
    }
    
    .mode-toggle input:checked + .mode-slider:before {
        transform: translateX(24px);
    }
    
    .api-key-input {
        font-size: 12px;
        padding: 8px 12px;
    }
}

.mode-toggle:hover .mode-slider {
    background: linear-gradient(135deg, #666666 0%, #777777 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 8px rgba(255, 255, 255, 0.1);
}

.mode-toggle:hover input:checked + .mode-slider {
    background: linear-gradient(135deg, #9370DB 0%, #8A2BE2 50%, #9370DB 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 15px rgba(138, 43, 226, 0.6);
    transform: scale(1.05);
}

.mode-toggle:hover input:checked + .mode-slider:before {
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.8);
}

/* Manual mode hover animation - simple purple glow to encourage Agent mode */
.mode-toggle:hover input:not(:checked) + .mode-slider {
    background: #666666;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(138, 43, 226, 0.4);
    animation: manualShimmer 2s ease-in-out infinite;
    transform: scale(1.02);
}

.mode-toggle:hover input:not(:checked) + .mode-slider:before {
    box-shadow: 0 4px 16px rgba(138, 43, 226, 0.8);
    animation: manualGlow 1s ease-in-out infinite;
    transform: scale(1.05);
}

@keyframes manualShimmer {
    0% {
        background: #666666;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(138, 43, 226, 0.4);
        transform: scale(1.02);
    }
    50% {
        background: #8A2BE2;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(138, 43, 226, 0.8);
        transform: scale(1.03);
    }
    100% {
        background: #666666;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(138, 43, 226, 0.4);
        transform: scale(1.02);
    }
}

/* Try Again Button Styles - Modern and Beautiful */
.try-again-button {
    background: linear-gradient(135deg, #8A2BE2 0%, #9370DB 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.try-again-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.try-again-button:hover {
    background: linear-gradient(135deg, #7B24CB 0%, #8A2BE2 100%);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
    transform: translateY(-2px);
}

.try-again-button:hover::before {
    left: 100%;
}

.try-again-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(138, 43, 226, 0.3);
}

.try-again-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.3), 0 4px 12px rgba(138, 43, 226, 0.3);
}

/* Error Button Container Styles */
.error-button-container {
    margin-top: 16px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
}

/* Error Message Container Enhancement */
.error-message-container {
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.1) 0%, rgba(229, 57, 53, 0.05) 100%);
    border: 1px solid rgba(229, 57, 53, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
}

.error-message-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #E53935 0%, #d32f2f 100%);
    border-radius: 2px;
}

.error-message-container .prompt-icon {
    color: #E53935;
    font-size: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.error-message-container .prompt-text {
    color: #E0E0E0;
    line-height: 1.6;
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
}

/* --- NEW: Agent Tool Call & Result Styles --- */

.agent-tool-result-message {
    background-color: transparent;
    color: #E0E0E0;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 15px;
    line-height: 1.6;
    display: flex;
    align-items: center; /* Center icon and text vertically */
    gap: 12px;
    /* border: 1px solid #505050; */
}

.agent-tool-result-message .tool-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.agent-tool-result-message .tool-result-text {
    flex-grow: 1;
    word-break: break-word;
}

.agent-tool-result-message.error {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
}

.agent-tool-result-message.error .tool-icon {
    color: #dc3545;
}

.agent-tool-result-message .tool-result-text.clickable-file-link {
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.agent-tool-result-message .tool-result-text.clickable-file-link:hover {
    color: var(--accent-color-purple);
}

/* Specific styles for different tool results can be added here */
.agent-tool-result-message.error .tool-result-text {
	color: var(--status-color-error);
}

/* Agent tool code block styles */
.agent-tool-code-block {
    background-color: var(--background-color-dark-gray-plus-2);
    border-radius: var(--border-radius-medium);
    margin-bottom: 1em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color-light);
    overflow: hidden;
}

.agent-tool-code-block .code-block-header {
    background-color: var(--background-color-dark-gray-plus-3);
    padding: 0.5em 0.8em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color-light);
}

.agent-tool-code-block .file-info {
    font-family: var(--font-family-monospace);
    color: var(--text-color-secondary);
    font-size: 2em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.agent-tool-code-block .file-info.clickable-file-link {
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.agent-tool-code-block .file-info.clickable-file-link:hover {
    color: var(--accent-color-purple);
}

.agent-tool-code-block pre {
    margin: 0;
    background-color: var(--background-color-dark-gray);
    border-radius: 0 0 8px 8px;
    padding: 15px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

.agent-tool-code-block pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

/* Ensure diff containers work properly within agent tool code blocks */
.agent-tool-code-block .diff-container {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.agent-tool-code-block .diff-line {
    display: flex;
    white-space: pre-wrap;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

.agent-tool-code-block .diff-line-num-old,
.agent-tool-code-block .diff-line-num-new {
    flex-shrink: 0;
    width: 40px;
    text-align: right;
    opacity: 0.5;
    padding-right: 10px;
    user-select: none;
}

.agent-tool-code-block .diff-line-content-prefix {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    user-select: none;
}

.agent-tool-code-block .diff-line-content {
    flex-grow: 1;
}

.agent-tool-code-block .diff-ins {
    background-color: rgba(40, 167, 69, 0.15);
}

.agent-tool-code-block .diff-ins .diff-line-num-new,
.agent-tool-code-block .diff-ins .diff-line-content-prefix {
    color: #28a745;
}

.agent-tool-code-block .diff-del {
    background-color: rgba(220, 53, 69, 0.15);
}

.agent-tool-code-block .diff-del .diff-line-num-old,
.agent-tool-code-block .diff-del .diff-line-content-prefix {
    color: #dc3545;
}

.agent-tool-code-block .diff-eq {
    color: #abb2bf;
}

.agent-tool-code-block .diff-eq .diff-line-content-prefix {
    opacity: 0.5;
}

/* Diff view styles */
#streamingResponse .diff-container {
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

#streamingResponse .diff-line {
    display: flex;
    white-space: pre-wrap;
    line-height: 1.5;
}

#streamingResponse .diff-line-num-old,
#streamingResponse .diff-line-num-new {
    flex-shrink: 0;
    width: 40px;
    text-align: right;
    opacity: 0.5;
    padding-right: 10px;
    user-select: none;
}

#streamingResponse .diff-line-content-prefix {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    user-select: none;
}

#streamingResponse .diff-line-content {
    flex-grow: 1;
}

#streamingResponse .diff-ins {
    background-color: rgba(40, 167, 69, 0.15); /* Faint green */
}
#streamingResponse .diff-ins .diff-line-num-new,
#streamingResponse .diff-ins .diff-line-content-prefix {
    color: #28a745; /* Green */
}


#streamingResponse .diff-del {
    background-color: rgba(220, 53, 69, 0.15); /* Faint red */
}
#streamingResponse .diff-del .diff-line-num-old,
#streamingResponse .diff-del .diff-line-content-prefix {
    color: #dc3545; /* Red */
}

#streamingResponse .diff-eq {
    color: #abb2bf;
}
#streamingResponse .diff-eq .diff-line-content-prefix {
    opacity: 0.5;
}

/* Diff fallback styles */
#streamingResponse .diff-fallback {
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #abb2bf;
    white-space: pre-wrap;
}

/* --- End Agent Tool Styles --- */


/* Responsive design for mobile devices */
@media (max-width: 768px) {
    .try-again-button {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 100px;
    }
    
    .error-button-container {
        margin-top: 12px;
        gap: 8px;
    }
    
    .error-message-container {
        padding: 16px;
        margin: 12px 0;
    }
}

@media (max-width: 480px) {
    .try-again-button {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 90px;
        letter-spacing: 0.3px;
    }
    
    .error-message-container {
        padding: 12px;
        margin: 8px 0;
    }
}

/* Linter Errors Section in Agent Tool Results */
.linter-errors-section {
    margin-top: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #f39c12;
    border-radius: 8px;
    color: #856404;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.15);
    position: relative;
    overflow: hidden;
}

.linter-errors-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #f39c12 0%, #e67e22 100%);
}

.linter-errors-section strong {
    color: #856404;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.linter-errors-section br {
    margin-bottom: 6px;
}

.linter-errors-section .linter-error-item {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    border-left: 3px solid #e67e22;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.linter-errors-section .linter-error-severity {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.linter-errors-section .linter-error-severity.error {
    color: #d63031;
}

.linter-errors-section .linter-error-severity.warning {
    color: #fdcb6e;
}

.linter-errors-section .linter-error-message {
    color: #856404;
    font-weight: 500;
    line-height: 1.4;
}

.linter-errors-section .linter-error-location {
    color: #856404;
    font-size: 11px;
    opacity: 0.8;
    font-style: italic;
}

/* Responsive design for linter errors */
@media (max-width: 768px) {
    .linter-errors-section {
        font-size: 13px;
        padding: 12px;
        margin-top: 10px;
    }
    
    .linter-errors-section strong {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .linter-errors-section .linter-error-item {
        padding: 6px 10px;
        font-size: 12px;
        margin-bottom: 6px;
        gap: 3px;
    }
    
    .linter-errors-section .linter-error-message {
        font-size: 12px;
    }
    
    .linter-errors-section .linter-error-location {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .linter-errors-section {
        font-size: 12px;
        padding: 10px;
        margin-top: 8px;
        border-radius: 6px;
    }
    
    .linter-errors-section strong {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .linter-errors-section .linter-error-item {
        padding: 5px 8px;
        font-size: 11px;
        margin-bottom: 5px;
        border-radius: 4px;
        gap: 2px;
    }
    
    .linter-errors-section .linter-error-severity {
        font-size: 10px;
    }
    
    .linter-errors-section .linter-error-message {
        font-size: 11px;
    }
    
    .linter-errors-section .linter-error-location {
        font-size: 9px;
    }
}

.setting-item:last-child {
    border-bottom: none;
    align-items: center;
    justify-content: flex-end;
    min-width: 120px;
}

.setting-info {
    flex-grow: 1;
    margin-right: 20px;
}

.settings-select {
    background-color: #333333;
    color: #E0E0E0;
    border: 1px solid #505050;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-select:hover {
    border-color: #8A2BE2;
}

.settings-select:focus {
    outline: none;
    border-color: #8A2BE2;
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

/* --- Response Language Input --- */
.response-language-input {
    position: relative;
    width: 100%;
    max-width: 350px;
    padding-left: 2.2em;
    background-color: #333333;
    border: 1px solid #505050;
    border-radius: 8px;
    color: #E0E0E0;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin: 10px auto 0 auto;
    box-sizing: border-box;
    display: block;
    min-height: 48px;
    line-height: 1.4;
}
.response-language-input:focus {
    outline: none;
    border-color: #8A2BE2;
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.15);
}
.response-language-input::placeholder {
    color: #9E9E9E;
    opacity: 1;
}
/* Add a language emoji icon to the left of the input */
.response-language-input {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><text x="0" y="16" font-size="16">🌐</text></svg>');
    background-repeat: no-repeat;
    background-position: 8px center;
    background-size: 1.3em 1.3em;
}
@media (max-width: 768px) {
    .response-language-input {
        font-size: 14px;
        max-width: 100%;
        padding-left: 2.2em;
    }
}
@media (max-width: 480px) {
    .response-language-input {
        font-size: 13px;
        padding-left: 2.2em;
    }
}
