body * {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    font-family: 'San Francisco', Helvetica, Arial, sans-serif;
    background-color: #f1f1f1;
}

#main {
    display: flex;
    height: 100%;
}

#left-panel {
    width: 40%;
    box-sizing: border-box;
}

#preview {
    width: 60%;
    box-sizing: border-box;
    background-color: #fff;
    height: 100vh;
}

#editor {
    height: 80vh;
}

.CodeMirror {
    width: 100%;
    height: 100%;
    border: none;
    font-family: monospace;
    font-size: 14px;
}

.CodeMirror-vscrollbar {
    scrollbar-width: thin;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 8px 8px;
}

#footer {
    height: 20vh;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #ccc;
}

#footer textarea {
    width: 100%;
    height: 70%;
    resize: none;
    font-family: 'San Francisco', Helvetica, Arial, sans-serif;
    font-size: 16px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#footer textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.25);
}

#footer button {
    height: 100%;
    font-size: 16px;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    margin-left: 0.5em;
}

#footer button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

#footer button.secondary {
    background-color: #6c757d;
}

#footer button.secondary:hover {
    background-color: #5a6268;
}


#footer button:disabled,
#footer button[disabled] {
    background-color: #cccccc;
    color: #666666;
}

#footer button:hover {
    transform: none
}

.button-group {
    display: flex;
    justify-content: space-between;
}

#right-button-group {
    display: flex;
}

#apiKeyDialogButton {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    color: #333;
    padding: 10px;
    transition: color 0.3s ease;
}

#apiKeyDialogButton:hover {
    color: #007bff;
}

#spinner {
    width: 1em;
    height: 1em;
    border: 4px solid rgb(0, 123, 255);
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Toaster styles */
#toaster {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1em 2em 0.8em 2em;
    background-color: #d3d3d3;
    color: #333;
    border-radius: 5px;
    align-items: initial;
    font-weight: bold;
    border: 3px solid #fff;
    font-size: 150%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}


#sharePopup {
    
}

#sharePopupStep1 ul {
    font-size:smaller;
    padding-left: 2em;
}

.warning {
    color: crimson;
}

.gutter {
    cursor: ew-resize;
    background-color: #ccc;
    transition: transform 0.2s ease, background-color 0.2s ease;
    transform-origin: center;
}
 
.gutter:hover {
    background-color: rgba(255, 235, 59, 1);
    transform: scaleX(1.5);
}

.controls-toolbar {
	display: flex;
	align-items: center;
	padding: 10px;
	/* border-bottom: 1px solid #ccc; */
	background-color: rgba(255, 235, 59, 0.5);
	border-radius: 8px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}
.controls-toolbar:hover {
    background-color: rgba(255, 235, 59, 1);
    /*border-radius: 0;*/
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.11);
	/*border: 1px solid #ffcf5f;*/
}

.browser-toolbar-buttons {
    display: flex;
}

.browser-toolbar-button {
    display: flex;
    justify-content: center;
    /* Horizontal centering */
    align-items: center;
    height: 25px;
    padding: 0 5px;
    filter: grayscale(1);
    margin-left: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

#shareButton {
}

.browser-toolbar-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.browser-toolbar-button svg {
    margin-right: 2px;
}

/* Browser simulator */
.desktop {
    font-family: Arial, sans-serif;
    background-color: #0078d7;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    height: 100%;
}

.browser-window {
    width: 80%;
    height: 80%;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.desktop.maximized {
    
}

.desktop.maximized .browser-window {
    height: 97%;
    width: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.desktop.maximized .browser-content iframe {
    border-radius: 0;
}

.desktop.maximized .controls-toolbar {
	width: 100%;
	justify-content: center;
	color: #444;
    border-radius: 0;
    background-color: #f1f1f1;
    border-top: 1px solid #ccc;
}

.browser-header {
    background-color: #f1f1f1;
    padding: 10px;
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.browser-icon {
        display: flex;
        padding-left: 5px;
}

.browser-icon img {
    width: 20px;    display: block!important;

    height: 20px;
    filter:grayscale(1);
}

.close-btn {
    background-color: #ff5f57;
}

.minimize-btn {
    background-color: #ffbd2e;
}

.maximize-btn {
    background-color: #28c940;
}

.browser-url {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex-grow: 1;
    padding: 4px 8px;
    margin-left: 10px;
}

.browser-content {
    flex-grow: 1;
    background-color: #fff;
    border-radius: 0 0 8px 8px;
}

#version-info {
	position: fixed;
	bottom: 8px;
	left: 20px;
	color: rgba(0,0,0,0.2);
	font-size: 12px;
}

@media (min-width: 811px) {
    #left-panel {
        display:block!important;
    }    
    #preview {
        display:block!important;
    }
    .tabs {
        display: none;
    }
}

/* small screens */
@media (max-width: 811px) {
    #main {
        flex-direction: column;
    }

    #left-panel {
        width: 100%!important;
    }

    #preview {
        width: 100%!important;
        display: none;
    }

    .tabs {
        display: flex;
        flex-direction: row;
        padding: 0;
        margin: 0;
        justify-content: space-around;
    }
    
    .tabs .tab {
        display: flex;
        width: 50%;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        height: 30px;
    }

    .tabs .tab.active {
        background-color: #0078d7;
        color: white;
        cursor: pointer;
    }

    #editor {
        height: calc(77vh - 30px);
    }

    #footer {
        height: 23vh;
    }

    #preview {
        height: 97vh;
        
    }
    .browser-window {
        width: 95%;
        height: 80%;
    }
}

.model-selection {
    margin-bottom: 20px;
}

.model-selection select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#apiKeyInstructions {
    display: block;
    margin-bottom: 10px;
}