
body {
margin: 0;
padding: 0;
height: 100vh;
overflow: hidden;
background-color: #1e1e1e;
color: #e0e0e0;
}

.sidebar {
background-color: #171b26;
color: #e0e0e0;
height: 100vh;
padding: 0;
width: 190px;
transition: all 0.3s ease;
z-index: 1000;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
}

.sidebar-header {
background: linear-gradient(135deg, #24334d, #1a2235);
padding: 14px 12px;
text-align: center;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
border-bottom: 1px solid #2c3a50;
color: #61dafb;
font-size: 0.7rem;
letter-spacing: 0.5px;
position: relative;
}

.sidebar-button {
display: flex;
align-items: center;
width: 100%;
padding: 10px 14px;
text-align: left;
color: #c9d1d9;
background-color: transparent;
border: none;
border-left: 3px solid transparent;
cursor: pointer;
transition: all 0.2s ease;
font-size: 0.85rem;
margin: 3px 0;
}

.sidebar-button:hover {
background-color: rgba(97, 218, 251, 0.08);
color: #ffffff;
border-left: 3px solid #61dafb;
}

.sidebar-button i {
color: #61dafb;
width: 20px;
text-align: center;
margin-right: 10px;
font-size: 0.9rem;
opacity: 0.9;
}

.sidebar-button:hover i {
opacity: 1;
}

.sidebar-footer {
padding: 12px;
text-align: center;
font-size: 0.75rem;
background: linear-gradient(135deg, #1a2235, #24334d);
width: 100%;
border-top: 1px solid #2c3a50;
color: #8b949e;
}

.sidebar-content {
height: calc(100vh - 130px);
overflow-y: auto;
background-color: #171b26;
padding: 8px 0;
flex: 1;
}

/* Scrollbar styling for sidebar specifically */
.sidebar-content::-webkit-scrollbar {
width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
background: rgba(97, 218, 251, 0.3);
border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
background: rgba(97, 218, 251, 0.5);
}

.main-content {
height: 100vh;
overflow: hidden;
background-color: #1e1e1e;
}

.editor-container {
height: 100%;
border-right: 1px solid #333;
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
}

.preview-container {
height: 100%;
overflow: auto;
background-color: #fff; /* Keep preview with white background */
}

textarea {
width: 100%;
height: 100%;
border: none;
resize: none;
padding: 15px;
font-family: 'Consolas', 'Monaco', monospace;
background-color: #1e1e1e;
color: #e0e0e0;
line-height: 1.5;
}

.editor-header {
background-color: #252526;
padding: 5px 15px;
border-bottom: 1px solid #333;
font-family: monospace;
color: #e0e0e0;
}

.toggle-sidebar {
display: none;
background: none;
border: none;
color: #e0e0e0;
font-size: 1.2rem;
cursor: pointer;
}

.sidebar-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
z-index: 999;
}

/* Mobile adjustments */
@media (max-width: 991.98px) {
.sidebar {
position: fixed;
left: -190px;
transition: left 0.3s ease;
}

.sidebar.show {
left: 0;
}

.toggle-sidebar {
display: block;
position: fixed;
top: 10px;
left: 10px;
z-index: 1000;
}

.mobile-header {
display: flex;
background-color: #1e1e1e;
color: #e0e0e0;
padding: 10px;
justify-content: center;
align-items: center;
position: relative;
}

.sidebar-overlay.show {
display: block;
}

.content-wrapper {
padding-top: 50px;
}
}

/* Tablet adjustments for split view */
@media (max-width: 767.98px) {
.split-view {
flex-direction: column;
}

.editor-container, .preview-container {
width: 100%;
height: 50vh;
}

.editor-container {
border-right: none;
border-bottom: 1px solid #333;
}
}

/* Fixed footer for mobile */
@media (max-height: 600px) {
.sidebar-footer {
position: static;
}
}

.sidebar-content {
height: calc(100vh - 130px);
overflow-y: auto;
}

.btn-toolbar {
display: none;
}

@media (max-width: 767.98px) {
.btn-toolbar {
display: flex;
padding: 6px 8px;
background-color: #252526;
border-bottom: 1px solid #333;
flex-direction: row;
gap: 6px;
justify-content: space-between;
align-items: center;
}

.btn-toolbar .top-row,
.btn-toolbar .bottom-row {
display: flex;
gap: 6px;
}

.btn-toolbar .bottom-row {
margin: 0;
}

.btn-toolbar .btn {
color: #e0e0e0;
border-color: #444;
font-size: 12px;
padding: 4px 8px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 0;
border-radius: 4px;
white-space: nowrap;
min-width: auto;
}

.btn-toolbar .btn i {
margin-right: 4px;
font-size: 12px;
}

/* Mobile header adjustments */
.mobile-header {
padding: 6px;
font-size: 0.9rem;
}

/* Adjust split view for mobile */
@media (max-width: 767.98px) {
.split-view {
flex-direction: column;
}

.editor-container, 
.preview-container {
width: 100%;
height: calc(50vh - 45px); /* Reduce the height taken by toolbar */
}

.editor-container {
border-right: none;
border-bottom: 1px solid #333;
}
}

/* Extra small devices */
@media (max-width: 380px) {
.btn-toolbar .btn {
font-size: 11px;
padding: 4px 6px;
}

.btn-toolbar .btn i {
margin-right: 3px;
font-size: 11px;
}
}
}

/* Code editor styling */
#codeEditor {
width: 100%;
height: 100%;
padding: 15px;
font-family: monospace;
font-size: 14px;
background-color: #1e1e1e;
color: #d4d4d4;
white-space: pre-wrap !important;
word-wrap: break-word !important;
overflow-wrap: break-word !important;
overflow-y: auto !important;
overflow-x: hidden;
line-height: 1.5;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
width: 10px;
height: 10px;
}

::-webkit-scrollbar-track {
background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
background: #424242;
border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
background: #4f4f4f;
}

/* Resize handle styles */
.gutter {
    background-color: #eee;
    background-repeat: no-repeat;
    background-position: 50%;
    width: 10px;
    cursor: col-resize;
}

.gutter:hover {
    background-color: #ddd;
}

.split-view {
    display: flex;
    width: 100%;
}

/* Ensure this only applies to desktop */
@media (max-width: 767px) {
    .gutter {
        display: none;
    }
}

/* Add these styles at the end of your file */
#codeEditor.hljs {
    padding: 15px;
    font-family: monospace;
    font-size: 14px;
    background-color: #1e1e1e;
}

.hljs {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Undo/Redo button styles - removing */
#undoBtn, #redoBtn, 
#mobileUndoBtn, #mobileRedoBtn {
display: none;
}

/* Additional sidebar styles */
.sidebar-footer-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 7px 12px;
    text-align: center;
    color: #8b949e;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    border-radius: 4px;
}

.sidebar-footer-button:hover {
    color: #61dafb;
    background-color: rgba(97, 218, 251, 0.05);
}

.sidebar-footer-button i {
    margin-right: 8px;
    font-size: 0.85rem;
    opacity: 0.8;
}

.copyright {
    font-size: 0.65rem;
    color: #6c757d;
    opacity: 0.7;
}

/* Close button in sidebar header */
.close-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

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

.CodeMirror {
    height: 100% !important;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    background-color: #1e1e1e !important;
    color: #d4d4d4 !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* CodeMirror Scrollbar Styles */
.CodeMirror-vscrollbar {
    width: 10px !important;
}

.CodeMirror-vscrollbar::-webkit-scrollbar {
    width: 10px;
}

.CodeMirror-vscrollbar::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.CodeMirror-vscrollbar::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

.CodeMirror-vscrollbar::-webkit-scrollbar-thumb:hover {
    background: #4f4f4f;
}

.CodeMirror-scroll {
    overflow-y: scroll !important;
    overflow-x: auto !important;
    margin-right: 0 !important;
}

.CodeMirror-gutters {
    background-color: #1e1e1e !important;
    border-right: 1px solid #333 !important;
}

.CodeMirror-linenumber {
    color: #666 !important;
}

.CodeMirror-cursor {
    border-left: 2px solid #fff !important;
}

.CodeMirror-selected {
    background-color: #264f78 !important;
}

.CodeMirror-focused .CodeMirror-selected {
    background-color: #264f78 !important;
}

.cm-s-monokai .cm-tag {
    color: #e06c75 !important;
}

.cm-s-monokai .cm-attribute {
    color: #d19a66 !important;
}

.cm-s-monokai .cm-string {
    color: #98c379 !important;
}

.cm-s-monokai .cm-comment {
    color: #7f848e !important;
    font-style: italic !important;
}

.CodeMirror-line > span {
    position: relative;
    z-index: 2;
}

.CodeMirror .cm-error {
    background-color: rgba(255, 0, 128, 0.15) !important;
    color: #f8f8f2 !important;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    border-bottom: 1px dashed rgba(255, 0, 128, 0.5);
}
@media (max-width: 767.98px) {

.sidebar-header {

    margin-left: -30px;
}
}

.skeleton-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.skeleton-header {
    height: 50px;
    background: linear-gradient(90deg, #252525 25%, #2a2a2a 50%, #252525 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    flex: 1;
    display: flex;
    padding: 15px;
    gap: 15px;
}

.skeleton-sidebar {
    width: 190px;
    background: #252525;
    border-radius: 4px;
    overflow: hidden;
}

.skeleton-sidebar-header {
    height: 50px;
    background: linear-gradient(90deg, #2a2a2a 25%, #303030 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 15px;
}

.skeleton-sidebar-item {
    height: 40px;
    margin: 10px;
    background: linear-gradient(90deg, #2a2a2a 25%, #303030 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-main {
    flex: 1;
    display: flex;
    gap: 10px;
}

.skeleton-editor {
    flex: 1;
    background: #252525;
    border-radius: 4px;
    overflow: hidden;
}

.skeleton-preview {
    flex: 1;
    background: #252525;
    border-radius: 4px;
    overflow: hidden;
}

.skeleton-line {
    height: 20px;
    margin: 10px;
    background: linear-gradient(90deg, #2a2a2a 25%, #303030 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 2px;
}

.skeleton-line:nth-child(2) { width: 85%; }
.skeleton-line:nth-child(3) { width: 75%; }
.skeleton-line:nth-child(4) { width: 90%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hide skeleton loader when page is loaded */
.skeleton-loader.loaded {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (max-width: 767.98px) {
    .skeleton-content {
        flex-direction: column;
    }
    
    .skeleton-sidebar {
        display: none;
    }
    
    .skeleton-main {
        flex-direction: column;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    position: relative;
    background-color: #171b26;
    margin: 5vh auto;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #2c3a50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #24334d, #1a2235);
}

.modal-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #61dafb;
}

.modal-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #61dafb;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    color: #e0e0e0;
    line-height: 1.6;
}

.modal-nav {
    padding: 0 20px 20px;
}

.modal-nav a {
    display: inline-block;
    color: #61dafb;
    text-decoration: none;
    margin-right: 20px;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.modal-nav a:hover {
    color: #ffffff;
}

@media (max-width: 576px) {
    .modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-header h1 {
        font-size: 1.2rem;
    }
}

.main-heading {
    color: #61dafb;
    font-size: 1.8rem;
    margin: 0;
    padding: 1rem;
    text-align: center;
    background: linear-gradient(135deg, #24334d, #1a2235);
    border-bottom: 1px solid #2c3a50;
}

/* Hide visually but maintain accessibility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
