html, body {
  height: 100%;
}

body {
  margin: 0;
}

/* Telerik Scheduler - Ensure proper layout */
.k-scheduler {
    width: 100% !important;
    display: block !important;
}

.k-scheduler-table {
    width: 100% !important;
    table-layout: fixed !important;
}

.k-scheduler-layout {
    width: 100% !important;
}

/* Prevent MudBlazor from interfering with Telerik */
.mud-paper .k-scheduler,
.mud-paper .k-scheduler * {
    box-sizing: border-box;
}

/* Telerik Material theme dark mode adjustments */
.mud-theme-dark .k-scheduler {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

.mud-theme-dark .k-scheduler-header,
.mud-theme-dark .k-scheduler-header-wrap {
    background-color: #252526 !important;
    border-color: #3e3e42 !important;
    color: #cccccc !important;
}

.mud-theme-dark .k-scheduler-table td {
    border-color: #3e3e42 !important;
    background-color: #2d2d30 !important;
}

.mud-theme-dark .k-scheduler-table th {
    background-color: #252526 !important;
    color: #cccccc !important;
    border-color: #3e3e42 !important;
}

/* Calendar view buttons and navigation */
.mud-theme-dark .k-scheduler-toolbar,
.mud-theme-dark .k-scheduler-footer {
    background-color: #252526 !important;
    border-color: #3e3e42 !important;
}

.mud-theme-dark .k-scheduler .k-nav-current {
    background-color: #0e639c !important;
    color: #ffffff !important;
}

/* Month view cells */
.mud-theme-dark .k-scheduler-monthview .k-scheduler-cell {
    background-color: #2d2d30 !important;
    color: #cccccc !important;
}

.mud-theme-dark .k-scheduler-monthview .k-alt {
    background-color: #252526 !important;
}

.mud-theme-dark .k-scheduler-monthview .k-today {
    background-color: #1e3a5f !important;
}

/* Week/Day view cells */
.mud-theme-dark .k-scheduler-times th,
.mud-theme-dark .k-scheduler-times td {
    background-color: #252526 !important;
    border-color: #3e3e42 !important;
    color: #cccccc !important;
}

/* Events remain colorful */
.mud-theme-dark .k-event {
    border-color: rgba(0, 0, 0, 0.3) !important;
}

/* Hover states */
.mud-theme-dark .k-scheduler-table td:hover {
    background-color: #37373d !important;
}

/* Selected state */
.mud-theme-dark .k-state-selected {
    background-color: #0e639c !important;
    color: #ffffff !important;
}

/* ===== Knowledge Base Styles ===== */

/* Hover Effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

/* Search Autocomplete */
.search-autocomplete .mud-input-root {
    border-radius: 8px;
}

.search-autocomplete .mud-input-filled {
    background-color: white !important;
}

/* Markdown Content */
.markdown-content {
    line-height: 1.8;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

/* ==========================================
   KNOWLEDGE BASE GRID LAYOUTS - NUCLEAR FIX
   ========================================== */

/* HIGHEST SPECIFICITY: Force grid display for KB article layouts */
body .mud-main-content .article-content > div[style*="display: grid"],
body .mud-main-content .article-content > div[style*="display:grid"],
body .mud-main-content .article-content .kb-grid {
    display: grid !important;
}

/* Force 2-column grid */
body .mud-main-content .article-content > div[style*="grid-template-columns: 1fr 1fr"],
body .mud-main-content .article-content .kb-grid-2col {
    grid-template-columns: 1fr 1fr !important;
}

/* Force 3-column grid */
body .mud-main-content .article-content > div[style*="grid-template-columns: 1fr 1fr 1fr"],
body .mud-main-content .article-content .kb-grid-3col {
    grid-template-columns: 1fr 1fr 1fr !important;
}

/* Force sidebar grid (2:1) */
body .mud-main-content .article-content > div[style*="grid-template-columns: 2fr 1fr"],
body .mud-main-content .article-content .kb-grid-sidebar {
    grid-template-columns: 2fr 1fr !important;
}

/* Force gap */
body .mud-main-content .article-content > div[style*="gap"] {
    display: grid !important;
}

@media (max-width: 768px) {
    body .mud-main-content .article-content > div[style*="grid-template-columns"],
    body .mud-main-content .article-content .kb-grid {
        grid-template-columns: 1fr !important;
    }
}

    padding-left: 2rem;
}

.markdown-content code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.markdown-content pre {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Flex wrap utility */
.flex-wrap {
    flex-wrap: wrap;
}

/* Article Content (Rich Text HTML) */
.article-content { line-height: 1.8; font-size: 1.05rem; }
