body, html {
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.container-fluid {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
}

.app-header {
    background-color: #343a40;
    color: white;
    padding: 0.5rem 1rem;
    z-index: 1030;
}

.hamburger-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.75rem;
}

.main-content {
    display: flex;
    flex: 1;
    position: relative;
    height: calc(100vh - 56px);
    overflow: hidden;
    max-height: calc(100vh - 60px);
}

.sidebar {
    background-color: #f8f9fa;
    width: 300px;
    height: 100%;
    position: fixed;
    top: 56px;
    left: 0;
    z-index: 1020;
    padding: 1rem;
    padding-bottom: 2rem;
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar .admin-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}
 
.sidebar .notes-list {
    margin-top: 1rem;
    margin-bottom: 2rem; 
}

.sidebar .note-item {
    padding: 0.15rem;
    font-size: 13px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.sidebar .note-item:hover {
    background-color: #e9ecef;
}

.sidebar .note-item.active {
    background-color: #e9ecef;
    border-left: 3px solid #007bff;
}

.note-config {
    background-color: #f1f3f5;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.content-area {
    margin-left: 300px;
    width: calc(100% - 300px);
    height: 100%;
    transition: margin-left 0.3s ease, width 0.3s ease;
    overflow-y: auto;
    box-sizing: border-box;
}

.content-area.full-width {
    margin-left: 0;
    width: 100%;
}

.editor-container {
    height: 100%; 
    box-sizing: border-box;
    position: relative;
}

/* SimpleMDE custom styles */
.CodeMirror, .CodeMirror-scroll {
    min-height: calc(100vh - 150px);
    height: auto;
    max-height: calc(100vh - 150px);
}

.editor-toolbar {
    border-radius: 4px 4px 0 0;
}

.action-buttons {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
}

.editor-textarea {
    width: 100%;
    min-height: calc(100dvh - 4rem);
    height: auto;
    max-height: calc(100dvh - 4rem);
}

.note-readonly-view {
    min-height: calc(100dvh - 4rem);
    max-height: calc(100dvh - 4rem);
    overflow-y: auto;
    padding: 1rem 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #fff;
    line-height: 1.6;
}

.note-readonly-view :first-child {
    margin-top: 0;
}

.note-readonly-view img {
    max-width: 100%;
    height: auto;
}

.note-readonly-view pre {
    padding: 0.75rem;
    border-radius: 6px;
    background-color: #f8f9fa;
    overflow-x: auto;
}

.editor-textarea-loading {
    opacity: 0 !important;
    visibility: hidden !important;
}

.editor-container-loading .editor-toolbar,
.editor-container-loading .CodeMirror,
.editor-container-loading .editor-statusbar,
.editor-container-loading .CodeMirror-scroll {
    opacity: 0 !important;
    visibility: hidden !important;
}

.editor-loading-state {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.editor-loading-card {
    width: min(520px, 100%);
}

.editor-loading-title {
    margin-bottom: 0.75rem;
    color: #536174;
    font-size: 0.95rem;
    font-weight: 600;
}

.editor-loading-line {
    height: 12px;
    margin-bottom: 0.5rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #dce3ec 0%, #f5f8fc 50%, #dce3ec 100%);
    background-size: 200% 100%;
    animation: editorShimmer 1.2s linear infinite;
}

.editor-loading-line.short {
    width: 70%;
    margin-bottom: 0;
}

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

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
    } 
    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }  
}
