* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

:root {
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --sidebar-bg: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --hover-bg: #f1f5f9;
}

body {
    background-color: #ffffff;
    color: var(--text-primary);
    margin: 0;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.sidebar-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 32px;
    letter-spacing: -0.5px;
}

.pages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page,
.add-page {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.page i,
.add-page i {
    font-size: 16px;
    width: 20px;
}

.page:hover,
.add-page:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.page.active {
    background-color: #e0f2fe;
    color: var(--primary-color);
    font-weight: 500;
}

.delete-btn {
    visibility: hidden;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.delete-btn:hover {
    background-color: #fee2e2;
}

.page:hover .delete-btn {
    visibility: visible;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    overflow: hidden;
}

.toolbar {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 5px;
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
}

.toolbar button {
    padding: 8px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    position: relative;
}

.toolbar button:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.toolbar button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.toolbar button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: white;
}

.editor {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    line-height: 1.7;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.editor:focus {
    outline: none;
}

.editor h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.editor p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 16px;
}

.editor ul,
.editor ol {
    margin: 16px 0;
    padding-left: 24px;
}

.editor li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}


/* Animations */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page,
.editor>* {
    animation: fadeIn 0.3s ease-out forwards;
}


/* Responsive Design */

@media screen and (max-width: 1200px) {
    .container {
        grid-template-columns: 250px 1fr;
    }
    .toolbar button {
        padding: 8px;
    }
    .main-content {
        padding: 15px;
    }
}

@media screen and (max-width: 992px) {
    .container {
        grid-template-columns: 200px 1fr;
    }
    .sidebar {
        width: 200px;
    }
    .toolbar {
        flex-wrap: wrap;
        gap: 5px;
    }
    .toolbar button {
        padding: 6px;
    }
    .search-box {
        width: 180px;
    }
}

@media screen and (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        height: 100vh;
        width: 250px;
        z-index: 1000;
        transition: left 0.3s ease;
        background: var(--bg-color);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    .sidebar.active {
        left: 0;
    }
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: none;
        border: none;
        color: var(--text-color);
        font-size: 24px;
        cursor: pointer;
    }
    .main-content {
        margin-left: 0;
        padding: 60px 15px 15px;
    }
    .search-box {
        width: 100%;
    }
    .toolbar {
        justify-content: center;
    }
}

@media screen and (max-width: 576px) {
    .toolbar button {
        padding: 5px;
        font-size: 14px;
    }
    .page-title {
        font-size: 24px;
    }
    .search-filters label {
        display: block;
        margin: 5px 0;
    }
    .modal-dialog {
        width: 90%;
        margin: 20px auto;
    }
    .modal-content {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
    .toolbar {
        padding: 12px 16px;
    }
    .editor {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 200px;
    }
    .sidebar-header h1 {
        font-size: 24px;
    }
    .editor {
        padding: 16px;
    }
}


/* Touch Device Optimizations */

@media (hover: none) {
    .custom-cursor,
    .cursor-dot {
        display: none;
    }
    .sidebar::-webkit-scrollbar {
        width: 8px;
    }
    .page:hover,
    .toolbar button:hover {
        transform: none;
    }
}

#micButton.active {
    background-color: #ff4444;
    color: white;
}

#micButton.active:hover {
    background-color: #ff6666;
}

#micButton i {
    transition: all 0.3s ease;
}


/* Search styles */

.search-container {
    margin: 20px 0;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
}

.search-filters {
    margin-top: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
}


/* Task and Note styles */

.task-item,
.note-item {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}


/* Error message styles */

.error-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ff4444;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
}


/* Search results styles */

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.search-result {
    padding: 8px;
    cursor: pointer;
}

.search-result:hover {
    background: #f0f0f0;
}

.code-block-wrapper {
    margin: 1em 0;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.code-block-toolbar {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: #e0e0e0;
    border-bottom: 1px solid #ccc;
}

.language-selector {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.code-block-toolbar button {
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.table-wrapper {
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.table-toolbar {
    background: #f5f5f5;
    padding: 8px;
    border: 1px solid #ddd;
    border-bottom: none;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.table-controls-group {
    display: flex;
    gap: 4px;
    border-right: 1px solid #ddd;
    padding-right: 12px;
    margin-right: 12px;
}

.table-controls-group:last-child {
    border-right: none;
}

.table-control {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.table-control:hover {
    background: #eee;
}

.delete-control {
    color: #dc3545;
}

.delete-control:hover {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.editable-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.editable-table td {
    border: 1px solid #ddd;
    padding: 8px;
    transition: background-color 0.2s ease;
}

.editable-table td:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

.cell-hover {
    background-color: #f8f9fa;
}


/* Preserve whitespace and indentation */

.code-block-wrapper code:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.5);
}