@font-face {
font-family: 'MyCustomFont';
src: url(/assets/atkinson.ttf) format('truetype');
font-weight: normal;
font-style: normal;
}

html, body {
  height: 100%;
  background: white;
}

.page-editor-container {
margin: 0 auto;
padding: 20px;
}

.page-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 24px;
}

.page-title h1 {
font-size: 28px;
margin: 0 0 8px 0;
}

.page-meta {
display: flex;
gap: 16px;
color: #666;
}

.page-style {
font-size: 14px;
background: #f0f7ff;
color: #4a6cf7;
padding: 4px 8px;
border-radius: 4px;
}

.page-project {
font-size: 14px;
}

.editor-layout {
display: flex;
flex-direction: row;
gap: 0;
height: 700px;
position: relative;
}

.chat-sidebar {
display: flex;
flex-direction: column;
background: #fff;
border-radius: 8px 0 0 8px;
overflow: hidden;
height: 100%;
width: 33%;
min-width: 250px;
}

.view-container {
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
overflow: hidden;
position: relative;
}

.chat-container {
display: flex;
flex-direction: column;
height: 100%;
flex: 1;
}

.chat-messages {
flex-grow: 1;
overflow-y: auto;
padding: 16px;
display: flex;
flex-direction: column;
}

.system-message {
background-color: #f0f7ff;
padding: 12px;
border-radius: 8px;
margin-bottom: 12px;
font-size: 14px;
animation: fadeIn 0.3s ease-in-out;
}

.system-message p {
margin: 0;
color: #4a6cf7;
}

.user-message {
background-color: #e9f5ff;
padding: 12px;
border-radius: 8px 8px 0 8px;
margin-bottom: 12px;
align-self: flex-end;
max-width: 80%;
animation: slideInRight 0.3s ease-in-out;
}

.assistant-message {
background-color: #f5f5f5;
padding: 12px;
border-radius: 8px 8px 8px 0;
margin-bottom: 12px;
align-self: flex-start;
max-width: 80%;
animation: slideInLeft 0.3s ease-in-out;
}

@keyframes slideInRight {
from { transform: translateX(20px); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
from { transform: translateX(-20px); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

.chat-input-container {
padding: 12px;
border-top: 1px solid #eee;
flex-shrink: 0;
}

.chat-input-wrapper {
display: flex;
position: relative;
}

.chat-input {
flex-grow: 1;
padding: 12px;
padding-right: 40px;
border: 1px dashed #ddd;
border-radius: 8px;
resize: none;
font-family: inherit;
font-size: 14px;
transition: border-color 0.2s;
}


.chat-submit-btn:hover {
background: #007bff;
}

.view-panel {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
background: #fff;
border-radius: 0 8px 8px 0;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.resize-handle {
height: 100%;
background-color: transparent;
cursor: col-resize;
position: relative;
z-index: 10;
}

.resize-handle-line {
position: absolute;
top: 0;
bottom: 0;
transform: translateX(-50%);
transition: background-color 0.2s;
}

.code-display-container {
height: 100%;
display: flex;
flex-direction: column;
}

.code-header {
padding: 12px 16px;
border-bottom: 1px solid #eee;
display: flex;
justify-content: space-between;
align-items: center;
}

.code-header h3 {
margin: 0;
font-size: 16px;
}

.code-display {
height: 100%;
overflow-y: auto;
background: #f5f5f5;
padding: 16px;
font-family: monospace;
font-size: 14px;
line-height: 1.5;
white-space: pre-wrap;
overflow-x: auto;
}

.preview-panel {
background: #fff;
border-radius: 0 8px 8px 0;
overflow: hidden;
height: 100%;
transition: all 0.3s ease;
}

.preview-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 20px;
border-bottom: 1px solid #eee;
}

.preview-header h3 {
margin: 0;
}

.preview-controls {
display: flex;
align-items: center;
gap: 12px;
}

.preview-indicator {
font-size: 13px;
padding: 4px 8px;
background: #4a6cf7;
color: white;
border-radius: 4px;
}

.browser-chrome {
background: #f1f3f4;
border-bottom: 1px solid #ddd;
padding: 8px 12px;
display: flex;
flex-direction: column;
gap: 8px;
}

.browser-controls {
display: flex;
gap: 6px;
align-items: center;
}

.browser-button {
width: 12px;
height: 12px;
border-radius: 50%;
display: inline-block;
}

.browser-button:nth-child(1) {
background-color: #ff5f57;
}

.browser-button:nth-child(2) {
background-color: #ffbd2e;
}

.browser-button:nth-child(3) {
background-color: #28c940;
}

.browser-address-bar {
height: 24px;
background: white;
border-radius: 4px;
border: 1px solid #ddd;
}

.preview-frame-container {
flex: 1;
height: 100%;
overflow: auto;
position: relative;
}

.preview-frame {
width: 1440px;
height: 100%;
border: none;
transform-origin: 0 0;
position: relative;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease, margin-left 0.3s ease;
}

.typing-indicator {
display: flex;
align-items: center;
padding: 12px;
background-color: #f5f5f5;
border-radius: 8px 8px 8px 0;
margin-bottom: 12px;
align-self: flex-start;
max-width: 80px;
}

.typing-dot {
width: 8px;
height: 8px;
background-color: #999;
border-radius: 50%;
margin: 0 2px;
animation: typing-animation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
animation-delay: 0s;
}

.typing-dot:nth-child(2) {
animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
animation-delay: 0.4s;
}

@keyframes typing-animation {
0%, 60%, 100% {
transform: translateY(0);
}
30% {
transform: translateY(-5px);
}
}

.btn {
padding: 8px 16px;
border-radius: 4px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
text-decoration: none;
text-align: center;
transition: all 0.2s;
}

.btn-secondary {
background-color: #f0f7ff;
color: #4a6cf7;
border: none;
}

.btn-secondary:hover {
background-color: #e0e7ff;
}

.btn-outline {
background-color: transparent;
color: #4a6cf7;
border: 1px solid #4a6cf7;
}

.btn-outline:hover {
background-color: #f0f7ff;
}

.example-prompts {
margin-top: 12px;
padding: 8px;
border-top: 1px solid #eee;
display: block;
}

.example-prompts h4 {
font-size: 14px;
margin: 0 0 8px 0;
color: #666;
}

.example-prompt-btn {
display: inline-block;
margin: 4px;
padding: 6px 10px;
background: #f0f7ff;
color: #4a6cf7;
border: none;
border-radius: 4px;
font-size: 12px;
cursor: pointer;
transition: background 0.2s;
}

.example-prompt-btn:hover {
background: #e0e7ff;
}

.view-toggle-container {
margin-left: 8px;
}

.view-toggle {
display: flex;
align-items: center;
gap: 8px;
position: relative;
cursor: pointer;
}

.view-label {
font-size: 14px;
font-weight: 500;
color: #666;
transition: color 0.3s;
}

.view-label.active {
color: #4a6cf7;
}

.code-label {
color: #666;
}

#view-toggle-input {
height: 0;
width: 0;
visibility: hidden;
position: absolute;
}

.toggle-slider {
position: relative;
display: inline-block;
width: 52px;
height: 26px;
background: #e0e0e0;
border-radius: 13px;
transition: 0.3s;
}

.toggle-slider:after {
content: '';
position: absolute;
top: 3px;
left: 3px;
width: 20px;
height: 20px;
background: #fff;
border-radius: 50%;
transition: 0.3s;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#view-toggle-input:checked + .toggle-slider {
background: #4a6cf7;
}

#view-toggle-input:checked + .toggle-slider:after {
left: calc(100% - 23px);
}

.preview-label {
color: #4a6cf7;
}

.preview-control-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 16px;
background: #f5f5f5;
border-bottom: 1px solid #ddd;
z-index: 10;
flex-shrink: 0;
}

.preview-controls {
display: flex;
align-items: center;
gap: 8px;
}


.refresh-btn {
display: flex;
align-items: center;
justify-content: center;
background: #e0e0e0;
border: none;
border-radius: 4px;
padding: 6px;
cursor: pointer;
transition: all 0.2s;
color: #666;
margin-left: 8px;
}

#code-view{
border-radius: 0px;
}

.refresh-btn:hover {
background: #d0d0d0;
color: #4a6cf7;
}

.iframe-scroll-container {
min-height: 100%;
display: flex;
justify-content: flex-start;
align-items: flex-start;
overflow-x: auto;
}

/* VS Code-like Editor Styles */
.vscode-editor {
display: flex;
width: 100%;
height: 100%;
background-color: #1e1e1e;
color: #d4d4d4;
font-family: 'Consolas', 'Courier New', monospace;
overflow: hidden;
}

/* Editor Sidebar */
.editor-sidebar {
width: 220px;
height: 100%;
background-color: #252526;
border-right: 1px solid #333;
display: flex;
flex-direction: column;
overflow-y: auto;
}

.sidebar-header {
padding: 10px;
font-size: 11px;
font-weight: bold;
color: #bbbbbb;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.file-explorer {
flex: 1;
}

.file-item {
display: flex;
align-items: center;
padding: 4px 10px;
cursor: pointer;
font-size: 13px;
}

.file-item:hover {
background-color: #2a2d2e;
}

.file-item.active {
background-color: #37373d;
}

.file-icon {
margin-right: 6px;
color: #c5c5c5;
}

.file-name {
color: #cccccc;
}

/* Editor Content */
.editor-content {
flex: 1;
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}

/* Editor Tabs */
.editor-tabs {
display: flex;
background-color: #2d2d2d;
border-bottom: 1px solid #333;
height: 35px;
}

.editor-tab {
display: flex;
align-items: center;
padding: 0 10px;
height: 100%;
background-color: #2d2d2d;
border-right: 1px solid #333;
font-size: 13px;
cursor: pointer;
}

.editor-tab.active {
background-color: #1e1e1e;
border-top: 1px solid #0078d7;
}

.tab-name {
margin-right: 8px;
}

.tab-close {
font-size: 16px;
opacity: 0.7;
}

.tab-close:hover {
opacity: 1;
}

/* Monaco Editor Container */
.monaco-editor-container {
flex: 1;
width: 100%;
height: 100%;
overflow: auto; /* Changed from hidden to auto to allow scrolling */
position: relative;
z-index: 1;
}

/* Override existing code display styles */
.code-display-container {
background-color: #1e1e1e;
padding: 0;
border-radius: 0;
box-shadow: none;
}

/* Ensure the view container takes full height */
.view-container {
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
overflow: hidden;
position: relative;
}

/* Make the view panels take remaining height */
.view-panel {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
}

/* Ensure the preview control bar doesn't take too much space */
.preview-control-bar {
flex-shrink: 0;
}

/* Ensure the iframe container scrolls properly */
.preview-frame-container {
height: 100%;
overflow: auto;
}

/* Ensure the chat sidebar has proper height */
.chat-sidebar {
height: 100%;
}

/* Ensure the resize handle has proper height */
.resize-handle {
height: 100%;
}

/* Ensure the chat messages container scrolls properly */
.chat-messages {
max-height: calc(100% - 150px);
}

/* Ensure the chat input container has proper height */
.chat-input-container {
height: auto;
}

/* Ensure the example prompts don't overflow */
.example-prompts {
overflow: hidden;
}

/* Ensure the view toggle is properly positioned */
.view-toggle-container {
margin-left: auto;
}

/* Ensure the breakpoint buttons are properly aligned */
.breakpoint-buttons {
display: flex;
align-items: center;
}

/* Ensure the refresh button is properly aligned */
.refresh-btn {
margin-left: 10px;
}

/* Ensure the browser chrome is properly styled */
.browser-chrome {
border-radius: 8px 8px 0 0;
}

/* Ensure the iframe has proper dimensions */
.preview-frame {
border: none;
width: 100%;
height: 100%;
}

/* Ensure the iframe scroll container has proper dimensions */
.iframe-scroll-container {
overflow: auto;
height: calc(100% - 40px);
}

/* Ensure the browser address bar has proper dimensions */
.browser-address-bar {
flex: 1;
}

/* Ensure the browser controls are properly aligned */
.browser-controls {
display: flex;
align-items: center;
}

/* Ensure the browser buttons are properly styled */
.browser-button {
margin-right: 6px;
}

/* Ensure the page header has proper spacing */
.page-header {
margin-bottom: 16px;
}

/* Ensure the page title has proper spacing */
.page-title {
margin-bottom: 8px;
}

/* Ensure the page actions are properly aligned */
.page-actions {
display: flex;
align-items: center;
gap: 8px;
}

/* Ensure the page meta has proper spacing */
.page-meta {
margin-top: 4px;
}

/* Ensure the page project has proper styling */
.page-project {
color: #666;
}

/* Ensure the chat sidebar has proper dimensions */
.chat-sidebar {
display: flex;
flex-direction: column;
background: #fff;
border-radius: 8px;
overflow: hidden;
height: 100%;
width: 33%;
min-width: 250px;
border: 1px solid #e8e8e8;
}

/* Ensure the view container has proper dimensions */
.view-container {
flex: 1;
height: 100%;
position: relative;
display: flex;
flex-direction: column;
overflow: hidden;
}

/* Ensure the chat container has proper dimensions */
.chat-container {
display: flex;
flex-direction: column;
height: 100%;
flex: 1;
}

/* Ensure the chat messages container has proper dimensions */
.chat-messages {
flex-grow: 1;
overflow-y: auto;
padding: 16px;
display: flex;
flex-direction: column;
}

/* Ensure the system message has proper styling */
.system-message {
background-color: #f0f7ff;
border-radius: 8px;
padding: 12px;
margin-bottom: 16px;
max-width: 85%;
align-self: center;
animation: fadeIn 0.3s ease-out;
}

/* Ensure the system message paragraph has proper styling */
.system-message p {
margin: 0;
color: #4a6cf7;
font-size: 14px;
}

/* Ensure the user message has proper styling */
.user-message {
background-color: #e9f5ff;
border-radius: 18px 18px 0 18px;
padding: 12px 16px;
margin-bottom: 16px;
max-width: 85%;
align-self: flex-end;
color: #333;
animation: slideInRight 0.3s ease-out;
}

/* Ensure the assistant message has proper styling */
.assistant-message {
background-color: #f5f5f5;
border-radius: 18px 18px 18px 0;
padding: 12px 16px;
margin-bottom: 16px;
max-width: 85%;
align-self: flex-start;
color: #333;
animation: slideInLeft 0.3s ease-out;
}

/* Ensure the animations are properly defined */
@keyframes slideInRight {
from { transform: translateX(20px); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
from { transform: translateX(-20px); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

/* Ensure the chat input container has proper styling */
.chat-input-container {
padding: 16px;
border-top: 1px solid #eee;
}

/* Ensure the chat input wrapper has proper styling */
.chat-input-wrapper {
position: relative;
}

/* Ensure the chat input has proper styling */
.chat-input {  
  width: 100%;
  border-radius: 24px;
  padding: 12px 50px 12px 16px;
  font-size: 14px;
  resize: none;
  outline: none;
  font-family: inherit;
}

/* Ensure the chat input focus has proper styling */
.chat-input:focus {
  border: 2px solid #007bff;
  box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2);
}

/* Ensure the chat submit button has proper styling */
.chat-submit-btn {
position: absolute;
right: 8px;
bottom: 8px;
background: #007bff;
color: white;
border: none;
border-radius: 50%;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background-color 0.2s;
}

/* Ensure the chat submit button hover has proper styling */
.chat-submit-btn:hover {
background: #3a5ce5;
}

/* Ensure the view panel has proper styling */
.view-panel {
flex: 1;
display: flex;
flex-direction: column;
background: #fff;
border-radius: 0 8px 8px 0;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
overflow: hidden;
position: relative;
}

/* Ensure the resize handle has proper styling */
.resize-handle {
width: 8px;
background: transparent;
cursor: col-resize;
position: relative;
z-index: 10;
}

/* Ensure the resize handle line has proper styling */

/* Ensure the resize handle hover and active states have proper styling */
.resize-handle:hover .resize-handle-line,
.resize-handle.active .resize-handle-line {
background: #4a6cf7;
}

/* Ensure the code display container has proper styling */
.code-display-container {
background: #fff;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
overflow: hidden;
padding: 0;
}

/* Ensure the code header has proper styling */
.code-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: #f5f5f5;
border-bottom: 1px solid #ddd;
}

/* Ensure the code header heading has proper styling */
.code-header h3 {
margin: 0;
font-size: 16px;
font-weight: 500;
}

/* Ensure the code display has proper styling */
.code-display {
padding: 16px;
font-family: 'Consolas', 'Courier New', monospace;
font-size: 14px;
line-height: 1.5;
color: #333;
background: #fff;
white-space: pre-wrap;
overflow-x: auto;
height: 100%;
}

/* Ensure the preview panel has proper styling */
.preview-panel {
background: #f5f5f5;
border-radius: 8px;
overflow: hidden;
display: flex;
flex-direction: column;
height: 100%;
}

/* Ensure the preview header has proper styling */
.preview-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: #f5f5f5;
border-bottom: 1px solid #ddd;
}

/* Ensure the preview header heading has proper styling */
.preview-header h3 {
margin: 0;
font-size: 16px;
}

/* Ensure the preview controls have proper styling */
.preview-controls {
display: flex;
align-items: center;
gap: 12px;
}

/* Ensure the preview indicator has proper styling */
.preview-indicator {
display: flex;
align-items: center;
gap: 6px;
font-size: 14px;
color: #666;
}

/* Ensure the browser chrome has proper styling */
.browser-chrome {
background: #f5f5f5;
border-bottom: 1px solid #ddd;
padding: 8px 12px;
display: flex;
align-items: center;
gap: 12px;
}

/* Ensure the browser controls have proper styling */
.browser-controls {
display: flex;
gap: 6px;
}

/* Ensure the browser button has proper styling */
.browser-button {
width: 12px;
height: 12px;
border-radius: 50%;
background: #ccc;
}

/* Ensure the browser buttons have proper colors */
.browser-button:nth-child(1) {
background: #ff5f57;
}

.browser-button:nth-child(2) {
background: #ffbd2e;
}

.browser-button:nth-child(3) {
background: #28c940;
}

/* Ensure the browser address bar has proper styling */
.browser-address-bar {
height: 24px;
background: #fff;
border-radius: 12px;
flex: 1;
}

/* Ensure the preview frame container has proper styling */
.preview-frame-container {
flex: 1;
display: flex;
flex-direction: column;
background: #fff;
overflow: hidden;
position: relative;
height: 100%;
}

/* Ensure the preview frame has proper styling */
.preview-frame {
border: none;
width: 100%;
height: 100%;
transform-origin: 0 0;
transition: transform 0.2s ease-out;
}

/* Ensure the typing indicator has proper styling */
.typing-indicator {
display: flex;
align-items: center;
gap: 4px;
padding: 12px 16px;
margin-bottom: 16px;
max-width: 85%;
align-self: flex-start;
}

/* Ensure the typing dot has proper styling */
.typing-dot {
width: 8px;
height: 8px;
background: #4a6cf7;
border-radius: 50%;
opacity: 0.6;
animation: typing-animation 1.4s infinite ease-in-out both;
}

/* Ensure the typing dots have proper animation delays */
.typing-dot:nth-child(1) {
animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
animation-delay: -0.16s;
}

.typing-dot:nth-child(3) {
animation-delay: 0s;
}

/* Ensure the typing animation is properly defined */
@keyframes typing-animation {
0% { opacity: 0.2; }
20% { opacity: 1; }
100% { opacity: 0.2; }
}

/* Ensure the button has proper styling */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 8px 16px;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
text-decoration: none;
}

/* Ensure the secondary button has proper styling */
.btn-secondary {
background: #f5f5f5;
color: #333;
border: 1px solid #ddd;
}

/* Ensure the secondary button hover has proper styling */
.btn-secondary:hover {
background: #eee;
}

/* Ensure the outline button has proper styling */
.btn-outline {
background: transparent;
color: #4a6cf7;
border: 1px solid #4a6cf7;
}

/* Ensure the outline button hover has proper styling */
.btn-outline:hover {
background-color: rgba(74, 108, 247, 0.1);
}

/* Ensure the example prompts have proper styling */
.example-prompts {
margin-top: 16px;
padding-top: 16px;
border-top: 1px solid #eee;
}

/* Ensure the example prompts heading has proper styling */
.example-prompts h4 {
margin: 0 0 8px 0;
font-size: 14px;
color: #666;
}

/* Ensure the example prompt button has proper styling */
.example-prompt-btn {
display: inline-block;
margin: 0 8px 8px 0;
padding: 6px 12px;
background: #f5f5f5;
border: 1px solid #ddd;
border-radius: 16px;
font-size: 13px;
color: #333;
cursor: pointer;
transition: all 0.2s;
}

/* Ensure the example prompt button hover has proper styling */
.example-prompt-btn:hover {
background: #eee;
}

/* Ensure the view toggle container has proper styling */
.view-toggle-container {
margin-left: auto;
}

/* Ensure the view toggle has proper styling */
.view-toggle {
display: flex;
align-items: center;
gap: 8px;
position: relative;
cursor: pointer;
user-select: none;
}

/* Ensure the view label has proper styling */
.view-label {
font-size: 14px;
color: #666;
transition: color 0.2s;
}

/* Ensure the active view label has proper styling */
.view-label.active {
color: #4a6cf7;
}

/* Ensure the code label has proper styling */
.code-label {
margin-right: 4px;
}

/* Ensure the view toggle input has proper styling */
#view-toggle-input {
opacity: 0;
width: 0;
height: 0;
position: absolute;
pointer-events: none;
}

/* Ensure the toggle slider has proper styling */
.toggle-slider {
position: relative;
display: inline-block;
width: 40px;
height: 20px;
background-color: #ccc;
border-radius: 20px;
transition: all 0.2s;
}

/* Ensure the toggle slider after has proper styling */
.toggle-slider:after {
content: '';
position: absolute;
width: 16px;
height: 16px;
border-radius: 50%;
background: white;
top: 2px;
left: 2px;
transition: all 0.2s;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Ensure the toggle slider checked has proper styling */
#view-toggle-input:checked + .toggle-slider {
background-color: #4a6cf7;
}

/* Ensure the toggle slider checked after has proper styling */
#view-toggle-input:checked + .toggle-slider:after {
transform: translateX(20px);
}

/* Ensure the preview label has proper styling */
.preview-label {
margin-left: 4px;
}

/* Ensure the preview control bar has proper styling */
.preview-control-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 12px;
background-color: #1e1e1e;
border-bottom: 1px solid #333;
}

/* Ensure the preview controls have proper styling */
.preview-controls {
display: flex;
align-items: center;
gap: 12px;
}


/* Ensure the refresh button has proper styling */
.refresh-btn {
background-color: transparent;
border: 1px solid #555;
color: #ddd;
border-radius: 4px;
padding: 5px 8px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}

/* Ensure the refresh button hover has proper styling */
.refresh-btn:hover {
background-color: #2c3e50;
border-color: #3498db;
}

/* Chat actions styles */
.chat-actions {
padding: 4px 10px;
border-top: none;
border-bottom: none;
background-color: transparent;
}

.chat-actions .revision-btn {
width: 100%;
padding: 4px 6px;
justify-content: flex-start;
background-color: transparent;
border: none;
border-radius: 0;
color: #888;
font-size: 12px;
}

.chat-actions .revision-btn svg {
margin-right: 6px;
opacity: 0.6;
width: 12px;
height: 12px;
}

.chat-actions .revision-btn span {
font-size: 12px;
font-weight: normal;
}

.chat-actions .revision-btn:hover {
background-color: transparent;
color: #aaa;
}

.chat-actions .revision-btn:hover svg {
opacity: 0.8;
}

/* Page switcher styles */
.page-switcher-container {
position: relative;
}

.page-switcher-btn {
background-color: rgba(40, 44, 52, 0.8);
border: none;
color: #ddd;
border-radius: 6px;
padding: 6px 12px;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: all 0.2s;
min-width: 180px;
}

.page-switcher-btn svg:first-child {
margin-right: 2px;
}

.current-page-name {
flex: 1;
text-align: left;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 150px;
font-size: 13px;
}

.dropdown-arrow {
transition: transform 0.2s;
}

.page-switcher-btn:hover {
background-color: rgba(60, 64, 72, 0.8);
}

.page-switcher-btn.active .dropdown-arrow {
transform: rotate(180deg);
}

.page-switcher-dropdown {
position: absolute;
top: calc(100% + 5px);
left: 0;
background-color: #1e1e1e;
border: 1px solid #444;
border-radius: 6px;
width: 250px;
max-height: 0;
overflow: hidden;
opacity: 0;
transition: all 0.2s ease-in-out;
z-index: 1000;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.page-switcher-dropdown.active {
max-height: 400px;
opacity: 1;
}

.page-switcher-search {
padding: 10px;
border-bottom: 1px solid #333;
}

.page-switcher-search input {
width: 100%;
padding: 6px 10px;
border: 1px solid #444;
border-radius: 4px;
background-color: #2a2a2a;
color: #ddd;
font-size: 13px;
}

.page-switcher-search input:focus {
outline: none;
border-color: #3498db;
}

.page-list {
max-height: 250px;
overflow-y: auto;
}

.page-item {
padding: 8px 12px;
cursor: pointer;
transition: background-color 0.2s;
display: flex;
align-items: center;
gap: 8px;
}

.page-item:hover {
background-color: #2c3e50;
}

.page-item.active {
background-color: #34495e;
}

.page-item-icon {
color: #aaa;
font-size: 14px;
}

.page-item-name {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 13px;
color: #999;
}

.page-item.active .page-item-name {
color: #fff;
}

.loading-pages {
padding: 15px;
text-align: center;
color: #888;
font-style: italic;
font-size: 13px;
}

.loading-pages.error {
color: #e74c3c;
font-style: normal;
}

.loading-pages .page-link {
display: block;
margin-top: 8px;
color: #3498db;
text-decoration: none;
}

.loading-pages .page-link:hover {
text-decoration: underline;
}

.retry-btn, .clear-search-btn {
display: inline-block;
margin-top: 8px;
padding: 4px 10px;
background-color: #2c3e50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
}

.retry-btn:hover, .clear-search-btn:hover {
background-color: #34495e;
}

.page-switcher-actions {
padding: 10px;
border-top: 1px solid #333;
display: flex;
flex-direction: column;
gap: 5px;
}

.page-action-btn {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
border-radius: 4px;
color: #ddd;
text-decoration: none;
transition: background-color 0.2s;
font-size: 13px;
}

.page-action-btn:hover {
background-color: #2c3e50;
}

.page-action-btn svg {
color: #3498db;
}

.onboarding-container {
max-width: 1200px;
margin: 0 auto;
padding: 40px 20px;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Progress Bar */
.progress-bar {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 40px;
}

.progress-step {
width: 36px;
height: 36px;
border-radius: 50%;
background-color: #e5e7eb;
color: #6b7280;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
position: relative;
z-index: 1;
}

.progress-step.completed {
background-color: #4f46e5;
color: white;
}

.progress-step.active {
background-color: #6366f1;
color: white;
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.progress-line {
height: 3px;
width: 100px;
background-color: #e5e7eb;
margin: 0 8px;
}

.progress-line.completed {
background-color: #4f46e5;
}

.onboarding-header {
text-align: center;
margin-bottom: 40px;
}

.onboarding-header h1 {
font-size: 36px;
font-weight: 700;
margin-bottom: 16px;
color: #111827;
}

.onboarding-header p {
font-size: 18px;
color: #4b5563;
max-width: 600px;
margin: 0 auto;
}

.alert {
padding: 16px;
margin-bottom: 24px;
border-radius: 8px;
display: flex;
align-items: center;
}

.alert i {
margin-right: 12px;
font-size: 20px;
}

.alert-danger {
background-color: #fee2e2;
color: #b91c1c;
border: 1px solid #fecaca;
}

.onboarding-form {
background: #fff;
padding: 30px;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
max-width: 900px;
margin: 0 auto;
}

/* Style Options Grid */
.style-options {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
margin-bottom: 30px;
}

.style-option {
position: relative;
}

.style-option input[type="radio"] {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}

.style-card {
border: 2px solid #e5e7eb;
border-radius: 12px;
overflow: hidden;
transition: all 0.3s ease;
height: 100%;
cursor: pointer;
}

.style-option input[type="radio"]:checked + .style-card {
border-color: #4f46e5;
box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
transform: translateY(-4px);
}

.style-option input[type="radio"]:focus + .style-card {
box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.4);
}

.style-image {
height: 160px;
background-color: #f3f4f6;
position: relative;
overflow: hidden;
}

/* Style-specific backgrounds */
.style-image.minimalist {
background: linear-gradient(to right, #f9fafb, #f3f4f6);
}

.style-image.modern {
background: linear-gradient(135deg, #3b82f6, #6366f1);
}

.style-image.professional {
background: linear-gradient(to right, #1e3a8a, #1e40af);
}

.style-image.creative {
background: linear-gradient(45deg, #ec4899, #8b5cf6);
}

.style-image.playful {
background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.style-image.elegant {
background: linear-gradient(to right, #18181b, #27272a);
}

.check-icon {
position: absolute;
top: 12px;
right: 12px;
width: 28px;
height: 28px;
background: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transform: scale(0.8);
transition: all 0.2s ease;
}

.check-icon i {
color: #4f46e5;
font-size: 16px;
}

.style-option input[type="radio"]:checked + .style-card .check-icon {
opacity: 1;
transform: scale(1);
}

.style-info {
padding: 20px;
}

.style-info h3 {
font-size: 18px;
font-weight: 600;
margin-bottom: 8px;
color: #111827;
}

.style-info p {
font-size: 14px;
color: #6b7280;
line-height: 1.5;
}

/* Form Actions */
.form-actions {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20px;
}

.btn {
padding: 12px 24px;
border-radius: 8px;
font-weight: 500;
font-size: 16px;
transition: all 0.2s ease;
cursor: pointer;
}

.btn-secondary {
background-color: #f3f4f6;
color: #4b5563;
border: 1px solid #e5e7eb;
text-decoration: none;
}

.btn-secondary:hover {
background-color: #e5e7eb;
}

.btn-primary {
background-color: #4f46e5;
color: white;
border: none;
box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
background-color: #4338ca;
transform: translateY(-1px);
box-shadow: 0 4px 6px rgba(79, 70, 229, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
.style-options {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.page-editor-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0px;
}

.progress-line {
  width: 60px;
}

.onboarding-form {
  padding: 25px 15px;
}
}

@media (max-width: 480px) {
.style-options {
  grid-template-columns: 1fr;
}

.btn {
  padding: 10px 16px;
  font-size: 14px;
}

.progress-line {
  width: 40px;
}
}

/* Generation Status Styles */
.generation-status {
background-color: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 20px;
margin-bottom: 30px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.generation-status-content {
display: flex;
align-items: center;
margin-bottom: 15px;
}

.generation-icon {
margin-right: 20px;
}

.spinner {
width: 40px;
height: 40px;
border: 4px solid rgba(79, 70, 229, 0.2);
border-radius: 50%;
border-top-color: #4f46e5;
animation: spin 1s linear infinite;
}

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

.generation-message h3 {
font-size: 18px;
font-weight: 600;
margin-bottom: 8px;
color: #111827;
}

.generation-message p {
font-size: 14px;
color: #6b7280;
margin: 0;
}

.generation-progress .progress-container {
height: 8px;
background-color: #e5e7eb;
border-radius: 4px;
overflow: hidden;
}

.generation-progress .progress-bar {
height: 100%;
width: 100%;
display: block;
position: relative;
}

.generation-progress .progress-indicator {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 30%;
background-color: #4f46e5;
border-radius: 4px;
animation: progress-animation 2s infinite;
}

@keyframes progress-animation {
0% { width: 10%; left: 0; }
50% { width: 30%; }
100% { width: 10%; left: 90%; }
}

/* System messages for notifications */
.message.system-message {
display: flex;
flex-direction: column;
align-items: center;
margin: 10px 0;
padding: 8px 12px;
background-color: rgba(125, 125, 125, 0.1);
border-radius: 6px;
border-left: 3px solid #6b7280;
font-style: italic;
color: #6b7280;
}

/* Streaming indicator */
.streaming-indicator {
position: fixed;
bottom: 20px;
right: 20px;
background-color: rgba(16, 185, 129, 0.9);
color: white;
padding: 8px 16px;
border-radius: 4px;
font-size: 14px;
font-weight: bold;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
z-index: 1000;
display: none;
}

.streaming-indicator.active {
display: block;
animation: pulse 1.5s infinite;
}

/* Style for the preview control bar */
.preview-control-bar {
display: flex;
justify-content: space-between;
align-items: center;
}

/* Make the breakpoint buttons centered */
.breakpoint-buttons {
display: flex;
justify-content: center;
margin: 0 auto;
position: absolute;
left: 50%;
transform: translateX(-50%);
}

/* Adjust padding for the side elements to ensure they don't overlap with centered buttons */
.preview-controls, .view-toggle-container {
z-index: 1;
position: relative;
}

/* Ensure the view container takes full height */
.view-container {
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
overflow: hidden;
position: relative;
}

/* Make the view panels take remaining height */
.view-panel {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
}

/* Ensure the Monaco editor container has proper dimensions */
.monaco-editor-container {
flex: 1;
width: 100%;
height: 100%;
overflow: auto; /* Changed from hidden to auto to allow scrolling */
position: relative;
z-index: 1;
}

/* Ensure the code view container has proper styling */
#code-view {
background-color: #1e1e1e;
display: flex;
flex-direction: column;
z-index: 2;
min-height: 100%;
overflow: auto; /* Added to ensure code view itself can scroll */
}

/* Ensure the preview container has proper styling */
.preview-frame-container {
flex: 1;
height: 100%;
overflow: auto;
position: relative;
}

/* Revision History Button styles */
.revision-history-button-container {
padding: 8px 15px;
border-top: none;
background-color: transparent;
}

.revision-history-btn {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 6px;
width: 100%;
padding: 0;
border: none;
background-color: transparent;
color: #999;
font-size: 13px;
font-weight: normal;
cursor: pointer;
transition: color 0.2s;
text-align: left;
}

.revision-history-btn:hover {
color: #666;
background-color: transparent;
}

.revision-history-btn svg {
color: #999;
}

/* Chat sidebar layout adjustments */
.chat-sidebar {
display: flex;
flex-direction: column;
height: 100%;
}

.chat-container {
display: flex;
flex-direction: column;
height: 100%;
}

.chat-messages {
flex: 1;
overflow-y: auto;
min-height: 0; /* Important for proper flexbox scrolling */
}

/* Chat message styles */
.chat-message {
margin-bottom: 16px;
max-width: 90%;
word-wrap: break-word;
word-break: break-word;
overflow-wrap: anywhere;
}

.user-message {
margin-left: auto;
}

.assistant-message {
margin-right: auto;
}

.chat-input-container {
border-top: 1px solid #e0e0e0;
}

/* Loading animation for assistant messages */
.loading .dot-1, .loading .dot-2, .loading .dot-3 {
animation: loading 1.4s infinite;
animation-fill-mode: both;
}

.loading .dot-2 {
animation-delay: 0.2s;
}

.loading .dot-3 {
animation-delay: 0.4s;
}

@keyframes loading {
0% { opacity: 0.2; }
20% { opacity: 1; }
100% { opacity: 0.2; }
}

/* Revision History Section Styles */
.revision-history-section {
background-color: #fff;
border-bottom: 1px solid #e0e0e0;
flex-direction: column;
overflow: hidden;
height: 60%;
transition: height 0.3s ease;
}

.revision-history-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
border-bottom: 1px solid #e0e0e0;
background-color: #f5f5f5;
}

.revision-history-header h3 {
margin: 0;
font-size: 16px;
color: #333;
}

.close-revision-history {
font-size: 24px;
font-weight: bold;
color: #777;
cursor: pointer;
background: none;
border: none;
padding: 0 8px;
line-height: 1;
transition: color 0.2s;
}

.close-revision-history:hover {
color: #333;
}

.revision-list-container {
overflow-y: auto;
border-bottom: 1px solid #e0e0e0;
}

.revision-list {
padding: 12px;
}

.revision-item {
padding: 10px;
border-radius: 4px;
margin-bottom: 8px;
cursor: pointer;
transition: background-color 0.2s;
border: 1px solid #f0f0f0;
}

.revision-item:hover {
background-color: #f5f5f5;
}

.revision-item.active {
background-color: #e9f0fd;
border-left: 3px solid #3b82f6;
}

.revision-date {
font-weight: 500;
margin-bottom: 4px;
color: #333;
font-size: 12px;
}

.revision-info {
font-size: 12px;
color: #666;
}

.revision-preview-container {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}

.revision-preview-header {
padding: 10px 15px;
border-bottom: 1px solid #e0e0e0;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #f5f5f5;
}

.revision-preview-header h3 {
margin: 0;
font-size: 14px;
color: #333;
}

.restore-btn {
padding: 6px 12px;
background-color: #3b82f6;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.2s;
font-size: 12px;
}

.restore-btn:hover:not([disabled]) {
background-color: #2563eb;
}

.restore-btn:disabled {
background-color: #9ca3af;
cursor: not-allowed;
}

.revision-preview {
flex: 1;
padding: 0;
overflow: auto;
background-color: #f9f9f9;
height: calc(100% - 50px); /* Header height */
}

.revision-preview-frame {
width: 100%;
height: 100%;
border: none;
}

.no-revision-selected {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
color: #666;
font-style: italic;
font-size: 12px;
padding: 15px;
}

.loading-revisions, .no-revisions, .error-message {
padding: 12px;
text-align: center;
color: #666;
font-size: 12px;
}

.error-message {
color: #ef4444;
}

.breakpoint-buttons {
display: flex;
align-items: center;
gap: 8px;
}

/* Modal styles */
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
display: none;
}

.modal-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
}

.modal-container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 80%;
max-width: 900px;
height: 80%;
max-height: 600px;
z-index: 1001;
}

.modal-content {
width: 100%;
height: 100%;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
overflow: hidden;
}

/* Revision History Section Styles - modified for modal */
.revision-history-section {
display: flex;
flex-direction: column;
height: 100%;
background-color: #fff;
overflow: hidden;
}

.revision-modal-body {
display: flex;
flex: 1;
height: calc(100% - 50px); /* Header height */
overflow: hidden;
}

.revision-list-container {
width: 30%;
overflow-y: auto;
border-right: 1px solid #e0e0e0;
padding: 0;
height: 100%;
}

.revision-list-title {
margin: 0;
padding: 12px;
font-size: 14px;
background-color: #f5f5f5;
border-bottom: 1px solid #e0e0e0;
}

.revision-preview-container {
width: 70%;
display: flex;
flex-direction: column;
overflow: hidden;
}

/* iMessage-style chat styling */
.chat-messages {
  padding: 15px;
}

.chat-message {
  margin-bottom: 10px;
  max-width: 80%;
}

.user-message {
  margin-left: auto;
  justify-content: flex-end;
}

.assistant-message {
  margin-right: auto;
  justify-content: flex-start;
}

.system-message {
  margin: 10px auto;
  text-align: center;
  max-width: 90%;
  font-style: italic;
  color: #888;
  font-size: 0.85em;
}

.chat-message-content {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.user-message .chat-message-content {
  border-bottom-right-radius: 4px;
}

.assistant-message .chat-message-content {
  border-bottom-left-radius: 4px;
}

.system-message .chat-message-content {
  background-color: transparent;
  padding: 5px;
}

/* Add a subtle animation for new messages */
@keyframes message-appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message {
  animation: message-appear 0.3s ease-out;
}

/* Revision History Button styles */
.revision-history-button-container {
  padding: 8px 15px;
  border-top: none;
  background-color: transparent;
}

.revision-history-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.revision-history-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0;
  border: none;
  background-color: transparent;
  color: #999;
  font-size: 13px;
  font-weight: normal;
  cursor: pointer;
  transition: color 0.2s;
  text-align: left;
}

.revision-history-btn:hover {
  color: #666;
  background-color: transparent;
}

.revision-history-btn svg {
  color: #999;
}

/* Chat sidebar layout adjustments */
.chat-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-input-container {
  border-top: 1px solid #e0e0e0;
}

/* Revision History Section Styles */
.revision-history-section {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  flex-direction: column;
  overflow: hidden;
  height: 60%;
  transition: height 0.3s ease;
}

.revision-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f5f5f5;
}

.revision-history-header h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.close-revision-history {
  font-size: 24px;
  font-weight: bold;
  color: #777;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0 8px;
  line-height: 1;
  transition: color 0.2s;
}

.close-revision-history:hover {
  color: #333;
}

.revision-list-container {
  overflow-y: auto;
  border-bottom: 1px solid #e0e0e0;
}

.revision-list {
  padding: 12px;
}

.revision-item {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  border: 1px solid #f0f0f0;
}

.revision-item:hover {
  background-color: #f5f5f5;
}

.revision-item.active {
  background-color: #e9f0fd;
  border-left: 3px solid #3b82f6;
}

.revision-date {
  font-weight: 500;
  margin-bottom: 4px;
  color: #333;
  font-size: 12px;
}

.revision-info {
  font-size: 12px;
  color: #666;
}

.revision-preview-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.revision-preview-header {
  padding: 10px 15px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f5f5f5;
}

.revision-preview-header h3 {
  margin: 0;
  font-size: 14px;
  color: #333;
}

.restore-btn {
  padding: 6px 12px;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 12px;
}

.restore-btn:hover:not([disabled]) {
  background-color: #2563eb;
}

.restore-btn:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.revision-preview {
  flex: 1;
  padding: 0;
  overflow: auto;
  background-color: #f9f9f9;
  height: calc(100% - 50px); /* Header height */
}

.revision-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.no-revision-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
  font-style: italic;
  font-size: 12px;
  padding: 15px;
}

.loading-revisions, .no-revisions, .error-message {
  padding: 12px;
  text-align: center;
  color: #666;
  font-size: 12px;
}

.error-message {
  color: #ef4444;
}

.breakpoint-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 900px;
  height: 80%;
  max-height: 600px;
  z-index: 1001;
}

.modal-content {
  width: 100%;
  height: 100%;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

/* Revision History Section Styles - modified for modal */
.revision-history-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #fff;
  overflow: hidden;
}

.revision-modal-body {
  display: flex;
  flex: 1;
  height: calc(100% - 50px); /* Header height */
  overflow: hidden;
}

.revision-list-container {
  width: 30%;
  overflow-y: auto;
  border-right: 1px solid #e0e0e0;
  padding: 0;
  height: 100%;
}

.revision-list-title {
  margin: 0;
  padding: 12px;
  font-size: 14px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

.revision-preview-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 70%;
}

.publish-btn {
  padding: 6px 12px;
  background-color: #16a34a;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 12px;
  margin-right: 6px;
}

.publish-btn:hover:not([disabled]) {
  background-color: #15803d;
}

.publish-btn:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.published-status {
  display: inline-block;
  padding: 2px 6px;
  background-color: #10b981;
  color: white;
  font-size: 10px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* iOS Toggle Styles - Modernized */
.ios-toggle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.ios-toggle {
  position: relative;
  display: inline-flex;
  user-select: none;
  min-width: min-content;
  width: auto;
}

.ios-toggle-track {
  position: relative;
  display: flex;
  width: 100%;
  height: 36px;
  background: #1d1d1d;
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ios-toggle-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50%;
  height: 100%;
  padding: 0 16px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.ios-toggle-option.active {
  color: rgba(255, 255, 255, 1);
}

.ios-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 50%;
  height: calc(100% - 4px);
  background: #303030;
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  z-index: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.ios-toggle.preview-active .ios-toggle-thumb {
  transform: translateX(100%);
}

.ios-toggle-option svg {
  margin-right: 5px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.ios-toggle-option.active svg {
  opacity: 1;
}

.ios-toggle-btn {
  display: none;
}

/* Breakpoint Toggle Styles - Modernized */
.breakpoint-toggle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.breakpoint-toggle {
  position: relative;
  display: inline-block;
  user-select: none;
  min-width: min-content;
  width: auto;
}

.breakpoint-toggle-track {
  position: relative;
  display: flex;
  width: 100%;
  height: 36px;
  background: #1d1d1d;
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.breakpoint-toggle-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 33.333%;
  height: 100%;
  padding: 0 16px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.breakpoint-toggle-option.active {
  color: rgba(255, 255, 255, 1);
}

.breakpoint-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 33.333%;
  height: calc(100% - 4px);
  background: #303030;
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  z-index: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.breakpoint-toggle.tablet-active .breakpoint-toggle-thumb {
  transform: translateX(100%);
}

.breakpoint-toggle.desktop-active .breakpoint-toggle-thumb {
  transform: translateX(200%);
}

.breakpoint-toggle-option svg {
  margin-right: 5px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.breakpoint-toggle-option.active svg {
  opacity: 1;
}

/* Animation for toggle transition */
@keyframes pulse-highlight {
  0% { box-shadow: 0 0 0 0 rgba(100, 100, 255, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(100, 100, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(100, 100, 255, 0); }
}

.ios-toggle-thumb:active, .breakpoint-toggle-thumb:active {
  animation: pulse-highlight 0.8s;
}

/* Media queries for responsive toggle sizes */
@media (max-width: 768px) {
  .ios-toggle-option,
  .breakpoint-toggle-option {
    padding: 0 12px;
    font-size: 11px;
  }
  
  .ios-toggle-option.active {
    padding: 0 16px;
  }
}

@media (max-width: 576px) {
  .ios-toggle-option,
  .breakpoint-toggle-option {
    padding: 0 8px;
  }
  
  .ios-toggle-option.active {
    padding: 0 10px;
  }
  
  .ios-toggle-option span,
  .breakpoint-toggle-option span {
    display: none;
  }
  
  .ios-toggle-option svg,
  .breakpoint-toggle-option svg {
    margin-right: 0;
  }
}

/* Mobile-specific styles */
@media (max-width: 640px) {
  /* Hide breakpoint switcher on mobile */
  #breakpoint-buttons-container, 
  .breakpoint-toggle-container {
    display: none !important;
  }
  
  /* Hide code view and code/preview switcher on mobile */
  #code-view {
    display: none !important;
  }
  
  .ios-toggle-container {
    display: none !important;
  }
  
  /* Always show preview view on mobile */
  #preview-view {
    display: flex !important;
  }
  
  /* Center page switcher, save and publish buttons on mobile */
  .view-container > div:first-of-type > div {
    width: 100% !important;
    justify-content: center !important;
    margin-right: 0 !important;
    margin-bottom: 8px;
  }
  
  /* Make the control bar flex column on mobile */
  .view-container > div:first-of-type {
    flex-direction: column !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
  
  /* Add some spacing between buttons */
  #save-btn, #publish-current-btn {
    margin: 4px !important;
  }
  
  /* Hide chat sidebar by default on mobile */
  .chat-sidebar {
    display: none !important;
    width: 100% !important;
    min-width: 100% !important;
    position: absolute !important;
    z-index: 50 !important;
    height: calc(100%) !important;
    top: 0 !important;
  }
  
  /* Make preview full width */
  .view-container {
    width: 100% !important;
  }
  
  /* Show chat sidebar when toggled */
  .chat-sidebar.mobile-visible {
    display: flex !important;
  }
  
  /* Add chat/preview toggle button */
  .mobile-toggle-container {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background-color: #1e1e1e !important;
    z-index: 60 !important;
    padding: 8px !important;
    justify-content: center !important;
    border-bottom: 1px solid #333 !important;
  }
  
  .mobile-toggle-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #333 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    cursor: pointer !important;
  }
  
  .mobile-toggle-btn svg {
    margin-right: 6px !important;
    width: 16px !important;
    height: 16px !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile polish
   -------------------------------------------------------------------------- */

/*
 * On very small screens we never want the interface to scroll sideways – that
 * causes the entire page to “drag” when the user swipes horizontally and
 * feels broken.  Disabling the horizontal overflow on the root elements and
 * the preview frame container eliminates this behaviour while still allowing
 * vertical scrolling inside long chats or code blocks.
 */

@media (max-width: 640px) {
  html,
  body {
    overflow-x: hidden;
    overscroll-behavior-x: none; /* prevent iOS rubber‑band scrolling */
    touch-action: pan-y;        /* only allow vertical touch panning */
  }

  .preview-frame-container {
    overflow-x: hidden !important;
  }
}


.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 30, 30, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: white;
  box-sizing: border-box;
}

.spinner-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.loading-text {
  margin-top: 0;
}

.witty-message-container {
  margin-top: 0;
  text-align: center;
}

/* Witty message styling */
.witty-message-container {
  margin-top: 12px;
  text-align: center;
}

.witty-message {
  color: white;
  font-size: 14px;
  opacity: 0.8;
  display: block;
  font-style: italic;
}

/* AI Model toggle */
.ai-toggle-container {
  position: relative;
  width: auto;
  height: 28px;
}

.ai-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-toggle-track {
  position: relative;
  width: 180px;
  height: 28px;
  background-color: #333;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.ai-toggle-option {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: 0 8px;
  color: #ddd;
  font-size: 12px;
  font-weight: 500;
  width: 56px;
}

.ai-toggle-option svg {
  margin-right: 4px;
}

.ai-toggle-thumb {
  position: absolute;
  left: 2px;
  width: 60px;
  height: 24px;
  background-color: #555;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.ai-toggle-thumb.active-smart {
  transform: translateX(60px);
  background-color: #8a2be2; /* Purple for Smart */
}

.ai-toggle-thumb.active-fast {
  transform: translateX(0);
  background-color: #ff6b00; /* Orange for Fast */
}

.ai-toggle-thumb.active-claude {
  transform: translateX(118px);
  background-color: #1e88e5; /* Blue for Claude */
}

.ai-toggle-option.active {
  color: white;
}

/* New styles for AI selector in chat sidebar */
.ai-selector-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.chat-sidebar .ai-toggle-container {
  width: 100%;
}

.chat-sidebar .ai-toggle-track {
  width: 100%;
  background-color: #222222;
  border-radius: 24px;
  padding: 3px;
  height: 36px;
  display: flex;
  position: relative;
  justify-content: space-between;
}

.chat-sidebar .ai-toggle-option {
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  height: 30px;
  width: 33.3%;
  color: #bbb;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  cursor: pointer;
}

.chat-sidebar .ai-toggle-option svg {
  margin-right: 2px;
  margin-left: 2px;
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.chat-sidebar .ai-toggle-option.active {
  color: white;
}

.chat-sidebar .ai-toggle-thumb {
  position: absolute;
  height: 30px;
  width: 33.3%;
  border-radius: 20px;
  left: 3px;
  background-color: #4285f4;
  z-index: 1;
  transition: transform 0.3s ease;
}

.chat-sidebar .ai-toggle-thumb.active-fast {
  transform: translateX(0);
}

.chat-sidebar .ai-toggle-thumb.active-smart {
  transform: translateX(100%);
}

.chat-sidebar .ai-toggle-thumb.active-claude {
  transform: translateX(200%);
}

/* Editor/Preview toggle visibility classes - global */
.view-hidden {
  display: none !important;
}

.view-visible {
  display: block !important;
}

/* Mobile-specific styles */
@media (max-width: 767px) {
  .page-editor-container {
    overflow: hidden;
    position: relative;
  }
  
  .mobile-toggle-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
  }
  
  .mobile-toggle-btn {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #333;
    color: white;
    border-radius: 20px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
  
  .mobile-toggle-btn svg {
    margin-right: 8px;
  }
  
  /* On mobile, we need to handle the layout differently */
  .editor-layout {
    display: block;
    margin-top: 0 !important;
  }
  
  /* Hide the resize handle on mobile */
  .resize-handle {
    display: none;
  }
  
  /* Mobile view visibility classes */
  .mobile-view-hidden {
    display: none !important;
  }
  
  .mobile-view-visible {
    display: block !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    position: relative !important;
  }
  
  /* Make chat take full height of the visible viewport on mobile */
  .chat-sidebar.mobile-view-visible {
    /* Use dynamic viewport height where supported, fall back to 100vh */
    height: 100vh;
    height: 100dvh;
    max-height: none;
  }

  /* Ensure the chat interface itself stretches the full height */
  .chat-sidebar.mobile-view-visible .chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  /* Let the scrollable chat history flex‑grow between the header and input */
  .chat-sidebar.mobile-view-visible .chat-messages {
    /* Flex item that can shrink below its content height */
    flex: 1 1 auto;
    min-height: 0;          /* required for proper flexbox overflow */
    overflow-y: auto;
  }
}

/* Asset Selection Modal Styles */
.asset-selection-section {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #fff;
  border-radius: 8px;
  max-height: 80vh;
}

.asset-selection-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.asset-upload-container {
  background-color: #f9fafb;
}

.asset-grid-container {
  min-height: 200px;
}

.asset-item {
  position: relative;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
}

.asset-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.asset-item.selected {
  border-color: #3b82f6;
}

.asset-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
}

.asset-select-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.asset-item:hover .asset-select-btn {
  opacity: 1;
}

.asset-item.selected .asset-select-btn {
  opacity: 1;
  background-color: #2563eb;
}

/* Spinner for loading */
.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #3b82f6;
  animation: spin 1s ease-in-out infinite;
}

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

/* Tooltip styling */
.tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.premium-tooltip {
  display: none; /* Hidden by default, JavaScript will control visibility */
  background-color: rgba(0, 0, 0, 1);
  color: #fff;
  text-align: center;
  border-radius: 4px;
  padding: 5px 10px;
  position: fixed; /* Fixed position relative to viewport */
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  font-weight: 500;
  pointer-events: none;
}

.premium-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 1) transparent transparent transparent;
}

/* Premium indicator */
.premium-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background-color: rgba(255, 215, 0, 0.2);
  border-radius: 50%;
  position: absolute;
  top: -5px;
  right: auto;
  margin-left: -2px;
  transform: translateX(100%);
}

.premium-indicator svg {
  width: 10px;
  height: 10px;
  color: #FFD700;
}

/* Adjust position of tooltip for toggle options */
.ai-toggle-option {
  position: relative;
}

.ai-toggle-option .premium-tooltip {
  top: -30px;
  right: 50%;
  transform: translateX(50%);
}


  /* Witty message styling */
  .witty-message-container {
    margin-top: 12px;
    text-align: center;
  }
  
  .witty-message {
    color: white;
    font-size: 14px;
    opacity: 0.8;
    display: block;
    font-style: italic;
  }

  /* AI Model toggle */
  .ai-toggle-container {
    position: relative;
    width: auto;
    height: 28px;
  }
  
  .ai-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .ai-toggle-track {
    position: relative;
    width: 180px;
    height: 28px;
    background-color: #333;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  .ai-toggle-option {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    padding: 0 8px;
    color: #ddd;
    font-size: 12px;
    font-weight: 500;
    width: 56px;
  }
  
  .ai-toggle-option svg {
    margin-right: 4px;
  }
  
  .ai-toggle-thumb {
    position: absolute;
    left: 2px;
    width: 60px;
    height: 24px;
    background-color: #555;
    border-radius: 12px;
    transition: transform 0.3s ease;
  }
  
  .ai-toggle-thumb.active-smart {
    transform: translateX(60px);
    background-color: #8a2be2; /* Purple for Smart */
  }
  
  .ai-toggle-thumb.active-fast {
    transform: translateX(0);
    background-color: #ff6b00; /* Orange for Fast */
  }
  
  .ai-toggle-thumb.active-claude {
    transform: translateX(118px);
    background-color: #1e88e5; /* Blue for Claude */
  }
  
  .ai-toggle-option.active {
    color: white;
  }
  
  .chat-sidebar .ai-toggle-container {
    width: 100%;
  }
  
  .chat-sidebar .ai-toggle-track {
    width: 100%;
    background-color: #222222;
    border-radius: 24px;
    padding: 3px;
    height: 36px;
    display: flex;
    position: relative;
    justify-content: space-between;
  }
  
  .chat-sidebar .ai-toggle-option {
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    height: 30px;
    width: 33.3%;
    color: #bbb;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    cursor: pointer;
  }
  
  .chat-sidebar .ai-toggle-option svg {
    margin-right: 2px;
    margin-left: 2px;
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
  }
  
  .chat-sidebar .ai-toggle-option.active {
    color: white;
  }
  
  .chat-sidebar .ai-toggle-thumb {
    position: absolute;
    height: 30px;
    width: 33.3%;
    border-radius: 20px;
    left: 3px;
    background-color: #4285f4;
    z-index: 1;
    transition: transform 0.3s ease;
  }
  
  .chat-sidebar .ai-toggle-thumb.active-fast {
    transform: translateX(0);
  }
  
  .chat-sidebar .ai-toggle-thumb.active-smart {
    transform: translateX(100%);
  }
  
  .chat-sidebar .ai-toggle-thumb.active-claude {
    transform: translateX(200%);
  }

  /* Mobile-specific styles */
  @media (max-width: 767px) {
    .page-editor-container {
      overflow: hidden;
      position: relative;
    }
    
    .mobile-toggle-container {
      position: fixed;
      bottom: 20px;
      right: 20px;
      z-index: 1000;
    }
    
    .mobile-toggle-btn {
      display: flex;
      align-items: center;
      padding: 10px 15px;
      background-color: #333;
      color: white;
      border-radius: 20px;
      border: none;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-toggle-btn svg {
      margin-right: 8px;
    }
    
    /* On mobile, we need to handle the layout differently */
    .editor-layout {
      display: block;
    }
    
    /* Hide the resize handle on mobile */
    .resize-handle {
      display: none;
    }
    
    /* Mobile view visibility classes */
    .mobile-view-hidden {
      display: none !important;
    }
    
    .mobile-view-visible {
      display: block !important;
      width: 100% !important;
      left: 0 !important;
      right: 0 !important;
      position: relative !important;
    }
    
    /* Make chat take full height on mobile */
    .chat-sidebar.mobile-view-visible {
      height: 100vh;
      max-height: none;
    }
    
    /* Ensure the chat interface uses the full height */
    .chat-sidebar.mobile-view-visible .chat-container {
      height: 100%;
    }
    
    /* Make the chat messages section fill available space */
    .chat-sidebar.mobile-view-visible .chat-messages {
      max-height: calc(100vh - 150px);
    }
  }
  
  /* Asset Selection Modal Styles */
  .asset-selection-section {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #fff;
    border-radius: 8px;
    max-height: 80vh;
  }
  
  .asset-selection-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
  }
  
  .asset-upload-container {
    background-color: #f9fafb;
  }
  
  .asset-grid-container {
    min-height: 200px;
  }
  
  .asset-item {
    position: relative;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
  }
  
  .asset-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  .asset-item.selected {
    border-color: #3b82f6;
  }
  
  .asset-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
  }
  
  .asset-select-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  
  .asset-item:hover .asset-select-btn {
    opacity: 1;
  }
  
  .asset-item.selected .asset-select-btn {
    opacity: 1;
    background-color: #2563eb;
  }
  
  /* Spinner for loading */
  .spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  /* Tooltip styling */
  .tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
  }
  
  .premium-tooltip {
    display: none; /* Hidden by default, JavaScript will control visibility */
    background-color: rgba(0, 0, 0, 1);
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 5px 10px;
    position: fixed; /* Fixed position relative to viewport */
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    pointer-events: none;
  }
  
  .premium-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -10px;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 1) transparent transparent transparent;
  }
  
  /* Premium indicator */
  .premium-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background-color: rgba(255, 215, 0, 0.2);
    border-radius: 50%;
    position: absolute;
    top: -5px;
    right: auto;
    margin-left: -2px;
    transform: translateX(100%);
  }
  
  .premium-indicator svg {
    width: 10px;
    height: 10px;
    color: #FFD700;
  }
  
  /* Adjust position of tooltip for toggle options */
  .ai-toggle-option {
    position: relative;
  }
  
  .ai-toggle-option .premium-tooltip {
    top: -30px;
    right: 50%;
    transform: translateX(50%);
  }

  /* Mobile-specific styles */

    /* Additional styles for interfaces page */
    .CodeMirror {
      height: 700px;
    }
    #model-options {
      width: 200px;
      z-index: 20; /* Ensure model options appear above the pill */
    }
    /* Transition styles for editor/preview switch */
    .view-container {
      /* Remove all transitions */
    }
    
    .view-hidden {
      display: none !important; /* Use display none instead of opacity/visibility transitions */
    }
    
    .view-visible {
      display: block !important; /* Simply display the element */
    }
  
    /* Default model selection */
    input#model-gpt-3_5-turbo:checked ~ #model-options-container #model-option-gpt-3_5-turbo {
      display: block;
    }
  
    /* Action indicator styles */
    .action-indicator {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background-color: rgba(255, 255, 255, 0.9);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
      padding: 2px;
      margin-left: 4px; /* Add spacing between text and icon */
      vertical-align: middle;
    }
  
    /* Add styles for action status messages to improve their appearance */
    .action-message {
      display: inline-flex;
      align-items: center;
      background-color: #f1f5f9;
      border-radius: 999px;
      padding: 6px 12px;
      font-size: 14px;
      font-weight: 500;
      line-height: 1;
      color: #334155;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }
  
    /* AI Switch Styles */
    .ai-switch-container {
      position: relative;
      display: inline-block;
    }
    
    .ai-switch {
      position: relative;
      display: inline-block;
      width: 140px;
      height: 30px;
    }
    
    .ai-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }
    
    .ai-slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #2d3748;
      border-radius: 34px;
      transition: .3s;
      display: flex;
      align-items: center;
      padding: 0 4px;
    }
    
    .ai-slider:before {
      position: absolute;
      content: "";
      height: 22px;
      width: 65px;
      left: 4px;
      bottom: 4px;
      background-color: #4a5568;
      border-radius: 34px;
      transition: .3s;
      z-index: 1;
    }
    
    input:checked + .ai-slider:before {
      transform: translateX(67px);
      background-color: #805ad5;
    }
    
    .ai-switch-option {
      flex: 1;
      text-align: center;
      z-index: 2;
      font-size: 12px;
      font-weight: 500;
      transition: .3s;
      position: relative;
    }
    
    .smart-label {
      color: white;
    }
    
    .genius-label {
      color: #a0aec0;
    }
    
    input:checked + .ai-slider .smart-label {
      color: #a0aec0;
    }
    
    input:checked + .ai-slider .genius-label {
      color: white;
    }
    
    .ai-premium-indicator {
      background-color: #ffc107;
      color: #000;
      padding: 2px;
      border-radius: 50%;
    }
    
  
    /* Loading overlay and 3D spinner styles */
    .loading-overlay {
      position: absolute;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.7);
      z-index: 10;
      border-top-left-radius: 0px !important;
      border-top-right-radius: 0px !important;
      border-bottom-left-radius: 0.5rem !important;
      border-bottom-right-radius: 0.5rem !important;
      pointer-events: none; /* Prevent interaction with overlay */
      transition: opacity 0.3s ease-in-out;
    }
  
    #editor-loading-overlay {
      opacity: 0.5;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }
    
    /* Ensure parent containers are positioned for absolute children */
    #monaco-editor, #preview-window {
      position: relative;
    }
  
    .spinner-container {
      position: relative;
      width: 80px;
      height: 80px;
      margin-bottom: 16px;
    }
  
    .loading-text {
      color: white;
      font-size: 14px;
      margin-top: 8px;
    }
  
    .animated-gradient-circle {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      background: linear-gradient(45deg, #6366F1, #8B5CF6, #EC4899, #F59E0B);
      background-size: 300% 300%;
      animation: gradientShift 3s ease infinite, pulse 2s ease-in-out infinite, spin 6s linear infinite;
      box-shadow: 0 0 20px rgba(99, 102, 241, 0.8);
      transform-style: preserve-3d;
      perspective: 500px;
    }
  
    .gradient-inner {
      position: absolute;
      top: 15%;
      left: 15%;
      width: 70%;
      height: 70%;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.8);
      background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(233, 213, 255, 0.4) 70%);
      filter: blur(2px);
      animation: innerSpin 4s linear infinite reverse, innerPulse 3s ease-in-out infinite;
    }
  
    @keyframes gradientShift {
      0% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
      100% { background-position: 0% 50%; }
    }
  
    @keyframes pulse {
      0%, 100% { transform: scale(0.95) rotate3d(1, 1, 1, 0deg); }
      50% { transform: scale(1.05) rotate3d(1, 1, 1, 10deg); }
    }
  
    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
  
    @keyframes innerSpin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
  
    @keyframes innerPulse {
      0%, 100% { transform: scale(0.9); opacity: 0.6; }
      50% { transform: scale(1.1); opacity: 0.9; }
    }
  
    /* Ensure modal appears on top */
    #revision-history-modal {
      z-index: 5000; /* High z-index */
    }
  
    /* Typing indicator animation */
    .typing-dots {
      display: flex;
      align-items: center;
      height: 16px;
    }
    
    .typing-dots span {
      display: inline-block;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background-color: #666;
      margin: 0 2px;
      animation: typing-dot 1.4s infinite ease-in-out both;
    }
    
    .typing-dots span:nth-child(1) {
      animation-delay: -0.32s;
    }
    
    .typing-dots span:nth-child(2) {
      animation-delay: -0.16s;
    }
    
    @keyframes typing-dot {
      0%, 80%, 100% { transform: scale(0.7); opacity: 0.6; }
      40% { transform: scale(1); opacity: 1; }
    }
  
    /* Visual Editor Styles */
    .visual-editor-panel {
      position: absolute;
      top: 20px;
      right: 20px;
      width: 340px;
      max-height: calc(100vh - 40px);
      background: rgba(255, 255, 255, 0.98);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid rgba(209, 213, 219, 0.5);
      border-radius: 12px;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
      z-index: 1000;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    }
  
    .visual-editor-header {
      background: transparent;
      padding: 16px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    }
  
    .visual-editor-title {
      font-weight: 600;
      font-size: 16px;
      color: #111827;
    }
  
    .visual-editor-close {
      background: transparent;
      border: none;
      color: #9ca3af;
      font-size: 20px;
      line-height: 1;
      cursor: pointer;
      padding: 4px;
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
    }
  
    .visual-editor-close:hover {
      background: #f3f4f6;
      color: #4b5563;
    }
  
    .visual-editor-content {
      flex: 1;
      padding: 20px;
      overflow-y: auto;
      /* Custom scrollbar */
      scrollbar-width: thin;
      scrollbar-color: #cbd5e1 transparent;
    }
    
    .visual-editor-content::-webkit-scrollbar {
      width: 6px;
    }
    
    .visual-editor-content::-webkit-scrollbar-track {
      background: transparent;
    }
    
    .visual-editor-content::-webkit-scrollbar-thumb {
      background-color: #cbd5e1;
      border-radius: 20px;
    }
  
    .visual-editor-field {
      margin-bottom: 20px;
    }
  
    .visual-editor-label {
      display: block;
      font-size: 11px;
      font-weight: 700;
      color: #6b7280;
      margin-bottom: 8px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
  
    .visual-editor-input,
    .visual-editor-textarea,
    .visual-editor-select {
      width: 100%;
      padding: 10px 12px;
      background: #f9fafb;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      font-size: 14px;
      color: #1f2937;
      transition: all 0.2s;
    }
  
    .visual-editor-input:hover,
    .visual-editor-textarea:hover,
    .visual-editor-select:hover {
      border-color: #d1d5db;
      background: #fff;
    }
  
    .visual-editor-input:focus,
    .visual-editor-textarea:focus,
    .visual-editor-select:focus {
      outline: none;
      border-color: #6366f1;
      background: #fff;
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }
  
    .visual-editor-textarea {
      min-height: 100px;
      resize: vertical;
      font-family: inherit;
      line-height: 1.5;
    }
  
    .visual-editor-footer {
      padding: 16px 20px;
      border-top: 1px solid rgba(229, 231, 235, 0.5);
      display: flex;
      gap: 12px;
      background: #fafafa;
    }
  
    .visual-editor-btn {
      flex: 1;
      padding: 10px 16px;
      border: none;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    .visual-editor-btn-primary {
      background: #4f46e5;
      color: white;
      box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    }
  
    .visual-editor-btn-primary:hover {
      background: #4338ca;
      transform: translateY(-1px);
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }
    
    .visual-editor-btn-primary:active {
      transform: translateY(0);
    }
  
    .visual-editor-btn-secondary {
      background: white;
      border: 1px solid #e5e7eb;
      color: #374151;
    }
  
    .visual-editor-btn-secondary:hover {
      background: #f9fafb;
      border-color: #d1d5db;
      color: #111827;
    }
  
    /* Hover effect for editable elements in preview */
    .visual-editor-hoverable {
      outline: 2px dashed rgba(99, 102, 241, 0.5) !important;
      outline-offset: -2px;
      cursor: pointer !important;
      transition: all 0.2s;
      position: relative;
    }
    
    .visual-editor-hoverable::after {
      content: '';
      position: absolute;
      inset: 0;
      background: rgba(99, 102, 241, 0.05);
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.2s;
    }
  
    .visual-editor-hoverable:hover {
      outline: 2px solid #6366f1 !important;
    }
    
    .visual-editor-hoverable:hover::after {
      opacity: 1;
    }
  
    .visual-editor-selected {
      outline: 2px solid #4f46e5 !important;
      outline-offset: -2px;
      position: relative;
      z-index: 10;
      box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
    }
  
    .visual-editor-color-input {
      display: flex;
      gap: 10px;
      align-items: center;
      background: #f9fafb;
      padding: 6px;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
    }
  
    .visual-editor-color-input input[type="color"] {
      width: 40px;
      height: 40px;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      padding: 0;
      background: none;
    }
    
    .visual-editor-color-input input[type="color"]::-webkit-color-swatch-wrapper {
      padding: 0;
    }
    
    .visual-editor-color-input input[type="color"]::-webkit-color-swatch {
      border: 1px solid rgba(0,0,0,0.1);
      border-radius: 6px;
    }
  
    .visual-editor-color-input input[type="text"] {
      flex: 1;
      border: none;
      background: transparent;
      padding: 4px;
      font-family: monospace;
      font-size: 13px;
      color: #374151;
    }
    
    .visual-editor-color-input input[type="text"]:focus {
      box-shadow: none;
      outline: none;
    }
  
    .visual-editor-element-tag {
      display: inline-flex;
      align-items: center;
      background: #eff6ff;
      color: #4f46e5;
      font-size: 12px;
      font-weight: 600;
      padding: 4px 10px;
      border-radius: 20px;
      margin-bottom: 16px;
      text-transform: lowercase;
      border: 1px solid #bfdbfe;
    }
    
    .visual-editor-element-tag::before {
      content: 'Selected: ';
      color: #6b7280;
      margin-right: 4px;
      font-weight: 500;
      text-transform: none;
    }
  
    /* Asset Selector Styles */
    .visual-editor-asset-selector {
      position: relative;
    }
  
    .visual-editor-asset-button {
      width: 100%;
      padding: 12px;
      border: 2px dashed #d1d5db;
      border-radius: 6px;
      background: #f9fafb;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      color: #374151;
      min-height: 80px;
    }
  
    .visual-editor-asset-button:hover {
      border-color: #667eea;
      background: #f3f4f6;
    }
  
    .visual-editor-asset-preview-img {
      max-width: 100%;
      max-height: 60px;
      border-radius: 4px;
      margin-bottom: 4px;
    }
  
    .visual-editor-asset-change-text {
      font-size: 11px;
      color: #667eea;
      font-weight: 500;
    }
  
    .visual-editor-asset-dropdown {
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      right: 0;
      max-height: 250px;
      background: white;
      border: 1px solid #d1d5db;
      border-radius: 6px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      z-index: 1001;
      overflow-y: auto;
    }
  
    .visual-editor-asset-loading {
      padding: 20px;
      text-align: center;
      color: #6b7280;
      font-size: 12px;
    }
  
    .visual-editor-asset-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      padding: 8px;
    }
  
    .visual-editor-asset-item {
      aspect-ratio: 1;
      cursor: pointer;
      border: 2px solid transparent;
      border-radius: 4px;
      overflow: hidden;
      transition: all 0.2s;
    }
  
    .visual-editor-asset-item:hover {
      border-color: #667eea;
      transform: scale(1.05);
    }
  
    .visual-editor-asset-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  
    .visual-editor-asset-empty {
      padding: 30px 20px;
      text-align: center;
      color: #6b7280;
      font-size: 12px;
      line-height: 1.5;
    }
  
    /* Custom Range Slider Styling */
    #ai-model-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: #ffffff;
      cursor: pointer;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
      border: 2px solid #6366f1; /* Indigo-500 */
      /* Center the thumb: track is h-2 (8px), thumb is 20px. (8-20)/2 = -6px */
      margin-top: 0px; 
      transform: translateY(-2px); /* Fine tune */
    }
    
    #ai-model-slider::-moz-range-thumb {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: #ffffff;
      cursor: pointer;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
      border: 2px solid #6366f1;
      border: none;
    }
    
    /* Ensure the thumb is centered vertically */
    #ai-model-slider {
      display: flex;
      align-items: center;
    }
