#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Скрыть индикатор загрузки */
.loading-progress {
    display: none;
}

.loading-progress-text {
    display: none;
}

/* Стили CodeMirror для имитации интерфейса 1С */
.CodeMirror {
    background-color: transparent;
    min-height: 300px;
    border: 1px solid #ccc;
    font-size: 14px;
    margin-bottom: 10px;
}

/* CodeMirror в split view */
.lesson-code-section .CodeMirror {
    min-height: 400px;
    border-radius: 0.5rem;
}

.CodeMirror-scroll {
    background-color: #ffffe0 !important; 
}

.cm-s-eclipse .CodeMirror {
    background-color: transparent !important;
}

.cm-s-eclipse .CodeMirror-scroll {
    background-color: #fffdd0 !important;
}

.cm-s-eclipse .cm-keyword {
    color: #ff0000 !important;
    font-weight: normal !important;
}

/* Когда встаем в скобки, чтоб не красились в черное */
.cm-s-eclipse span.CodeMirror-matchingbracket {
    color: #ff0000 !important;
    font-weight: normal !important;
    background-color: transparent !important;
    outline: none !important;
}

.cm-s-eclipse .cm-string {
    color: #000000 !important;
}

.cm-s-eclipse .cm-comment {
    color: #888888;
    font-style: italic;
}

.cm-s-eclipse .cm-number {
    color: #000000 !important;
}

.cm-s-eclipse .cm-variable {
    color: #0000cc !important;
}

/* Современная типографика в стиле ChatGPT */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.lesson-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: #374151;
    max-width: 100%;
}

.lesson-content h1,
.lesson-content h2,
.lesson-content h3,
.lesson-content h4 {
    font-weight: 600;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.lesson-content h2 {
    font-size: 1.75rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.lesson-content h3 {
    font-size: 1.5rem;
}

.lesson-content h4 {
    font-size: 1.25rem;
}

.lesson-content p {
    margin-bottom: 1.25rem;
    color: #374151;
}

.lesson-content ul,
.lesson-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

.lesson-content li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
}

.lesson-content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-size: 0.875em;
    color: #e11d48;
}

/* Блоки кода */
.code-block-wrapper {
    position: relative;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

.code-block-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.code-block-language {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-block-copy-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.code-block-copy-btn:hover {
    background-color: #e5e7eb;
    color: #111827;
}

.code-block-copy-btn:active {
    transform: scale(0.95);
}

.code-block-content-wrapper {
    background-color: #ffffff;
    overflow: hidden;
}

.code-block-content-wrapper .CodeMirror {
    height: auto;
    min-height: auto;
    border: none;
    background-color: #ffffff !important;
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
}

.code-block-content-wrapper .CodeMirror-scroll {
    min-height: auto;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    background-color: #ffffff !important;
}

.code-block-content-wrapper .cm-s-eclipse .CodeMirror {
    background-color: #ffffff !important;
}

.code-block-content-wrapper .cm-s-eclipse .CodeMirror-scroll {
    background-color: #ffffff !important;
}

.code-block-content-wrapper .CodeMirror-lines {
    padding: 0;
}

/* Старый стиль для обратной совместимости */
.code-block-content {
    padding: 1rem;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #111827;
    background-color: #ffffff;
}

/* Стили для кнопки "Запустить" */
.run-code-button {
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    box-shadow: 0 2px 8px rgba(103, 58, 183, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    min-width: auto !important;
    width: fit-content !important;
    height: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.run-code-button > div {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    line-height: 1 !important;
}

.run-code-button:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(103, 58, 183, 0.4) !important;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
}

.run-code-button:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(103, 58, 183, 0.3) !important;
}

.run-code-button:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

/* Стили для страницы урока с разделением (Split View) */
.lesson-split-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 64px); /* Вычитаем высоту навбара */
    overflow: hidden;
    position: relative;
}

.lesson-left-pane {
    width: 50%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.lesson-right-pane {
    width: 50%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.lesson-resizer {
    width: 4px;
    background-color: #e5e7eb;
    cursor: ew-resize;
    height: 100%;
    flex-shrink: 0;
    transition: background-color 0.2s;
    user-select: none;
    position: relative;
    z-index: 10;
    touch-action: none;
}

.lesson-resizer:hover {
    background-color: #667eea;
}

.lesson-vertical-resizer {
    height: 4px;
    width: 100%;
    background-color: #e5e7eb;
    cursor: ns-resize;
    flex-shrink: 0;
    transition: background-color 0.2s;
    user-select: none;
    margin: 0.5rem 0;
    position: relative;
    z-index: 10;
    touch-action: none;
}

.lesson-vertical-resizer:hover {
    background-color: #667eea;
}

/* Стили для таблицы пользователей в админ панели */
.users-table .user-id-column {
    max-width: 120px !important;
    width: 120px !important;
    min-width: 120px !important;
    word-wrap: break-word;
    word-break: break-all;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Стили для таблицы уроков в админ панели */
.lessons-table .lesson-id-column {
    max-width: 120px !important;
    width: 120px !important;
    min-width: 120px !important;
    word-wrap: break-word;
    word-break: break-all;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Top Navigation */
.lesson-top-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Description */
.lesson-description {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

/* Bottom Navigation */
.lesson-bottom-nav {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.lesson-nav-card {
    flex: 1;
    transition: all 0.2s;
}

.lesson-nav-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Code Editor Section */
.lesson-code-section {
    height: 50%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.lesson-code-section .CodeMirror {
    flex: 1;
    min-height: 0;
}

.lesson-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Preview Section */
.lesson-preview-section {
    height: 50%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.lesson-preview-content {
    flex: 1;
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    overflow-y: auto;
}

.preview-output {
    color: #111827;
}

.preview-error {
    color: #dc2626;
}

.preview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .lesson-content {
        font-size: 15px;
    }
    
    .lesson-content h2 {
        font-size: 1.5rem;
    }
    
    .lesson-content h3 {
        font-size: 1.25rem;
    }
    
    .run-code-button {
        padding: 0.5rem 1rem !important;
        min-width: auto !important;
    }
    
    .lesson-split-container {
        flex-direction: column;
        height: auto;
    }
    
    .lesson-left-pane,
    .lesson-right-pane {
        width: 100%;
        height: auto;
    }
    
    .lesson-resizer {
        display: none;
    }
}

/* Footer Styles */
.footer-custom {
    background-color: #37474f !important; /* Colors.BlueGray.Darken3 */
    color: #eceff1 !important; /* Colors.BlueGray.Lighten4 */
    margin-top: auto;
    width: 100%;
}

.footer-text {
    color: #eceff1 !important; /* Colors.BlueGray.Lighten4 */
    line-height: 1.6;
    font-size: 0.875rem;
}

.footer-contact {
    text-align: right;
}

.footer-email {
    color: #80deea !important; /* Светлый акцентный цвет для ссылки на темном фоне */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-email:hover {
    color: #b2ebf2 !important; /* Еще светлее при наведении */
    text-decoration: underline;
}

@media (max-width: 960px) {
    .footer-contact {
        text-align: left;
        margin-top: 1rem;
    }
}