html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    margin: 0;
    padding: 0;
}

#app {
    height: 100vh;
}

.h-100 {
    height: 100% !important;
}

/* Toast improvements */
.toast-container {
    z-index: 1055;
}

.toast {
    min-width: 300px;
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Blazor error UI improvements */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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 spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Form improvements */
.form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Badge improvements */
.badge {
    font-weight: 500;
}

/* Button improvements */
.btn {
    font-weight: 500;
}

.btn-group .btn + .btn {
    margin-left: 0;
}

/* Utility classes */
.fw-medium {
    font-weight: 500 !important;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   MODERN RICH TEXT EDITOR STYLES
   ============================================ */

/* Editor Container */
.rich-editor-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Toolbar Styles */
.editor-toolbar {
    background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 8px 8px 0 0;
}

.editor-toolbar .btn-outline-secondary {
    border-color: #d0d0d0;
    color: #424242;
    background: #fff;
    padding: 6px 10px;
    transition: all 0.15s ease;
}

.editor-toolbar .btn-outline-secondary:hover {
    background: #e8e8e8;
    border-color: #b0b0b0;
    color: #212121;
    transform: translateY(-1px);
}

.editor-toolbar .btn-outline-secondary:active,
.editor-toolbar .btn-outline-secondary.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.editor-toolbar .vr {
    opacity: 0.3;
    margin: 0 8px;
}

.editor-toolbar .btn-group-sm .btn {
    font-size: 0.875rem;
}

.editor-toolbar i {
    font-size: 1rem;
}

/* Editor Content Area */
.editor-content {
    min-height: 400px;
    /*max-width: 900px;*/
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: #1a1a1a;
    outline: none;
}

.editor-content:focus {
    outline: none;
}

/* Typography Styles for Editor Content */
.editor-content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #111;
}

.editor-content h2 {
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #111;
}

.editor-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #222;
}

.editor-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.editor-content h5 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #444;
}

.editor-content h6 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #555;
}

.editor-content p {
    margin-bottom: 1.25rem;
}

.editor-content strong,
.editor-content b {
    font-weight: 600;
    color: #111;
}

.editor-content em,
.editor-content i {
    font-style: italic;
}

.editor-content u {
    text-decoration: underline;
}

.editor-content s,
.editor-content strike {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Links */
.editor-content a {
    color: #0d6efd;
    text-decoration: none;
    border-bottom: 1px solid rgba(13, 110, 253, 0.3);
    transition: all 0.15s ease;
}

.editor-content a:hover {
    color: #0a58ca;
    border-bottom-color: #0a58ca;
}

/* Lists */
.editor-content ul,
.editor-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

.editor-content ul {
    list-style-type: disc;
}

.editor-content ol {
    list-style-type: decimal;
}

.editor-content li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
}

.editor-content li > p {
    margin-bottom: 0.5rem;
}

/* Task Lists */
.editor-content ul.task-list {
    list-style: none;
    padding-left: 0;
}

.editor-content ul.task-list li.task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.editor-content ul.task-list li.task-item input[type="checkbox"] {
    margin-top: 0.375rem;
    cursor: not-allowed;
}

/* Blockquotes */
.editor-content blockquote {
    border-left: 4px solid #0d6efd;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    padding: 1rem 1rem 1rem 1.5rem;
    border-radius: 0 4px 4px 0;
}

.editor-content blockquote p {
    margin-bottom: 0.5rem;
}

.editor-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code */
.editor-content code {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0.2em 0.4em;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #d73a49;
}

.editor-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.5;
}

.editor-content pre code {
    background: transparent;
    border: none;
    color: inherit;
    padding: 0;
    font-size: 0.875rem;
}

/* Tables */
.editor-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.editor-content table td,
.editor-content table th {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    text-align: left;
    min-width: 100px;
}

.editor-content table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.editor-content table tr:nth-child(even) {
    background: #fafafa;
}

.editor-content table tr:hover {
    background: #f0f0f0;
}

/* Images */
.editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Horizontal Rule */
.editor-content hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 2rem 0;
}

/* Content Display (Read Mode) */
.content-display {
    /*max-width: 900px;*/
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: #1a1a1a;
}

.content-display h1,
.content-display h2,
.content-display h3,
.content-display h4,
.content-display h5,
.content-display h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.content-display p {
    margin-bottom: 1.25rem;
}

.content-display a {
    color: #0d6efd;
    text-decoration: none;
}

.content-display a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .editor-toolbar {
        padding: 8px 12px;
    }
    
    .editor-toolbar .btn-group {
        margin-bottom: 4px;
    }
    
    .editor-toolbar .vr {
        display: none;
    }
    
    .editor-content,
    .content-display {
        padding: 16px;
        font-size: 15px;
    }
}

/* Placeholder styling */
.editor-content:empty:before {
    content: 'Start writing your content...';
    color: #999;
    pointer-events: none;
}

/* Selection styling */
.editor-content ::selection {
    background: rgba(13, 110, 253, 0.2);
}