/* General Styling */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-color: #dee2e6;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

body {
    font-size: 0.95rem;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
}

.container-fluid {
    flex: 1;
    display: flex;
}

.row {
    flex: 1;
    display: flex;
}

/* Navigation */
nav.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.sidebar {
    padding: 1rem 0;
}

.sidebar-heading {
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.category-list {
    padding: 0 1rem;
}

.category-list .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: #495057;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.category-list .nav-link:hover {
    background-color: #e9ecef;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

/* Main Content Area */
.main-content {
    max-width: 100%;
    overflow-x: hidden;
    padding: 2rem 1.5rem;
    background-color: white;
    min-height: calc(100vh - 113px);
}

footer {
    margin-top: auto;
}

@media (max-width: 767.98px) {
    .sidebar {
        display: none;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }
}

/* Cards and Containers */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0b5ed7;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #212529;
}

/* List Groups */
.list-group-item {
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Markdown Content Styling */
.entry-content {
    background-color: white;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;   
    word-break: break-word;
    /* overflow-wrap: break-word;     */
}

.entry-content table {
    width: 100%;    
    margin-bottom: 1rem;
    border-collapse: collapse;
    table-layout: auto;
}

.entry-content table th,
.entry-content table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
   
}

.entry-content table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #333;
}

.entry-content h1 {
    font-size: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3rem;
}

.entry-content h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3rem;
}

.entry-content h3 {
    font-size: 1.25rem;
}

.entry-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.entry-content ul {
    list-style-type: disc;
}

.entry-content ol {
    list-style-type: decimal;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    color: #6c757d;
    font-style: italic;
}

.container-fluid,
.row {
    min-width: 0;
}



.entry-content code:not(pre code) {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
}

.entry-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    position: relative;
}

.entry-content pre code {
    background-color: transparent;
    padding: 0;
    font-family: 'Courier New', monospace;
}


.entry-content img {
    width: 100%;
    min-width: 0px;
    height: auto;
    border-radius: 0.25rem;
    display: block;
}

.img-left {    
    margin-left: 0;
    margin-right: auto;
}   
.img-center {    
    margin-left: auto;
    margin-right: auto;
}
.img-right {    
    margin-left: auto;
    margin-right: 0;
}

/* Define image size classes */
.entry-content img.img-small {    
    max-width: 300px;
    height: auto;
}

.entry-content img.img-medium {
    max-width: 600px;
    height: auto;
}

.entry-content img.img-large {
    max-width: 900px;
    height: auto;
}



/* Text wrapping for left/right images */
.entry-content p, 
.entry-content div,
.entry-content ul,
.entry-content ol {
    overflow: auto; /* Clear floats within text */
}


.entry-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.entry-content a:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

/* Code block styling */
.hljs {
    padding: 1rem;
    border-radius: 0.25rem;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 1;
}

pre {
    position: relative;
}

/* Pagination styling */
.pagination {
    margin: 20px 0;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.pagination .page-link {
    color: #0d6efd;
}

.pagination .page-link:hover {
    color: #0a58ca;
}

/* File icon styling */
.file-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* Update all file icon color rules */
.file-icon.pdf i, .file-icon.pdf svg { color: #e74c3c; }
.file-icon.doc i, .file-icon.doc svg { color: #2b579a; }
.file-icon.xls i, .file-icon.xls svg { color: #217346; }
.file-icon.zip i, .file-icon.zip svg { color: #f39c12; }
.file-icon.txt i, .file-icon.txt svg { color: #7f8c8d; }
.file-icon.image i, .file-icon.image svg { color: #9b59b6; }
.file-icon.default i, .file-icon.default svg { color: #95a5a6; }


/* List group item adjustments */
.list-group-item .d-flex.align-items-center {
    align-items: flex-start !important;
}



/* Utility Classes */
.text-muted {
    color: #6c757d;
}

.border-bottom {
    border-bottom: 1px solid var(--border-color);
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 576px) {
    .entry-content {
        padding: 1rem;
    }
    
    .entry-content h1 {
        font-size: 1.5rem;
    }
    
    .entry-content h2 {
        font-size: 1.25rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }
}



/* Scroll to Top Button Styling */

#scrollToTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

#scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
}

#scrollToTopBtn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#scrollToTopBtn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* SVG icon styling */
#scrollToTopBtn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

blockquote p:nth-child(1) {
  color: var(--primary-color);
  font-weight: 500;
}

/* Alternative minimalist style (uncomment to use) */
/* 
        #scrollToTopBtn {
            background: #333;
            border-radius: 8px;
        }
        #scrollToTopBtn:hover {
            background: #000;
        }
        */

/* Alternative rounded square style (uncomment to use) */
/* 
        #scrollToTopBtn {
            border-radius: 12px;
        }
        */

/* Mobile responsiveness */
@media (max-width: 768px) {
    #scrollToTopBtn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    #scrollToTopBtn svg {
        width: 20px;
        height: 20px;
    }
}

