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

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.fade-in-delay-1 {
    animation-delay: 0.1s;
}

.fade-in-delay-2 {
    animation-delay: 0.2s;
}

.fade-in-delay-3 {
    animation-delay: 0.3s;
}

.fade-in-delay-4 {
    animation-delay: 0.4s;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    padding: 0;
    margin: 0;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.main-container {
    max-width: 85% !important;
    margin: 0 auto;
}

.doc-content {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-left: 280px;
    padding: 25px 35px;
    min-height: calc(100vh - 56px);
}

.breadcrumb {
    margin-bottom: 20px;
    background-color: transparent;
    padding: 0;
}

h1 {
    margin-top: 0;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

pre {
    background-color: #f6f8fa;
    border-radius: 6px;
    padding: 16px;
    overflow: auto;
    margin: 20px 0;
}

code {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
}

.directory-list {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 20px;
}

.directory-list li {
    margin-bottom: 12px;
}

.directory-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 4px;
    background-color: white;
    border: 1px solid #eee;
    transition: all 0.2s;
}

.directory-item:hover {
    background-color: #f8f9fa;
    border-color: #ddd;
    transform: translateY(-2px);
}

.directory-item .icon {
    margin-right: 12px;
    font-size: 20px;
}

.folder-icon {
    color: #ffc107;
}

.file-icon {
    color: #6c757d;
}

.navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    padding: 12px 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    padding: 8px 0;
}

.navbar .nav-link {
    padding: 8px 15px !important;
    margin: 0 3px;
    font-size: 1.05rem;
}

.navbar .nav-item {
    display: flex;
    align-items: center;
}

table {
    width: 100%;
    margin: 25px 0;
    border-collapse: collapse;
}

table, th, td {
    border: 1px solid #e1e4e8;
}

th, td {
    padding: 10px 15px;
}

th {
    background-color: #f6f8fa;
}

img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

.mermaid {
    margin: 30px 0;
}

.mermaid-container {
    position: relative;
    overflow: auto;
    max-width: 100%;
    margin: 25px 0;
}

.mermaid {
    margin-bottom: 25px;
    max-width: 100%;
}

.expand-mermaid {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    z-index: 100;
    opacity: 0.7;
}

.expand-mermaid:hover {
    opacity: 1;
}

.mermaid-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: auto;
}

.mermaid-modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 25px;
    width: 95%;
    max-width: 1500px;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mermaid-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.mermaid-modal-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
}

.close-mermaid-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close-mermaid-modal:hover {
    color: black;
}

.mermaid-modal .mermaid {
    max-width: 100%;
    overflow: auto;
    text-align: center;
}

.mermaid-modal .mermaid svg {
    margin: 0 auto;
}

.doc-container {
    display: flex;
    gap: 30px;
    margin: 20px 0;
}

.doc-navigation {
    width: 280px;
    background: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
}

.doc-main {
    flex: 1;
    min-width: 0;
}

.doc-navigation .nav-folder-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.doc-navigation .nav-items {
    list-style-type: none;
    padding-left: 18px;
    margin-bottom: 20px;
}

.doc-navigation .nav-file-item {
    padding: 6px 0;
    margin-bottom: 5px;
}

.doc-navigation .nav-folder-item {
    margin-bottom: 12px;
}

.doc-navigation a {
    color: #495057;
    text-decoration: none;
    display: block;
    padding: 8px;
    border-radius: 4px;
}

.doc-navigation a:hover {
    background-color: #f8f9fa;
}

.doc-navigation .active > a,
.doc-navigation .nav-file-item.active a {
    background-color: #f0f7ff;
    color: #0d6efd;
    font-weight: 500;
}

#markdown-content h1 {
    font-size: 2.2rem;
    margin-top: 2.5rem;
    margin-bottom: 1.8rem;
    border-bottom: 1px solid #e1e4e8;
    padding-bottom: 0.8rem;
}

#markdown-content h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
}

#markdown-content h3 {
    font-size: 1.5rem;
    margin-top: 1.8rem;
    margin-bottom: 1rem;
}

#markdown-content h4 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

#markdown-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

#markdown-content ul,
#markdown-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2.5rem;
}

#markdown-content li {
    margin-bottom: 0.5rem;
}

#markdown-content blockquote {
    padding: 1rem 1.5rem;
    border-left: 4px solid #dee2e6;
    background-color: #f8f9fa;
    color: #495057;
    margin: 1.5rem 0;
}

#markdown-content code:not([class*="language-"]) {
    background-color: rgba(27, 31, 35, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: #24292e;
}

#markdown-content img {
    max-width: 100%;
    display: block;
    margin: 2rem auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

a[href^="http://trend-viewer-backend.local"] {
    position: relative;
    color: #0366d6;
    text-decoration: none;
    font-weight: 500;
}

a[href^="http://trend-viewer-backend.local"]:hover {
    text-decoration: underline;
}

.section-header {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.8rem;
    margin-top: 2.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: #007bff;
}

.backend-nav-header {
    background-color: #f0f7ff;
    color: #0d6efd;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}

.directory-list li {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
    animation-delay: calc(0.05s * var(--item-index, 0));
}

/* Styles từ overview.blade.php */
.doc-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    border: none;
    overflow: hidden;
}

.doc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.doc-card-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.doc-card-header h2, 
.doc-card-header h3 {
    margin-bottom: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.doc-card-body {
    padding: 1.8rem;
    flex-grow: 1;
}

.doc-card-footer {
    padding: 1.2rem 1.8rem;
    background-color: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.doc-sections {
    margin-top: 25px;
}

.doc-section-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}

.doc-section-item:last-child {
    border-bottom: none;
}

.doc-stats {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 20px;
}

.btn-doc {
    background-color: #0d6efd;
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-doc:hover {
    background-color: #0a58ca;
    color: white;
    transform: translateY(-2px);
}

.btn-doc-outlined {
    background-color: white;
    color: #0d6efd;
    border: 1px solid #0d6efd;
}

.btn-doc-outlined:hover {
    background-color: #0d6efd;
    transform: translateY(-2px);
    color: white;
}

/* New additions for badges and icons */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.7rem;
    border-radius: 4px;
    margin-right: 8px;
}

.badge i {
    font-size: 0.8em;
    margin-right: 3px;
}

.navbar .nav-link.active {
    font-weight: 600;
    color: #007bff;
    position: relative;
    padding-bottom: 8px;
}

.navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background-color: #007bff;
}

.btn {
    border-radius: 5px;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s ease;
    margin-right: 10px;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Sidebar styles từ markdown.blade.php */
.doc-sidebar {
    background-color: #ffffff;
    border-right: 1px solid #e9ecef;
    height: 100vh;
    width: 280px;
    position: fixed;
    overflow-y: auto;
    transition: all 0.3s;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    padding: 18px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.sidebar-lang-selector {
    padding: 12px 18px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-item {
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 5px;
}

.sidebar-link {
    padding: 14px 18px;
    display: flex;
    justify-content: start;
    align-items: center;
    color: #444;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar-link:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.sidebar-link.active {
    background-color: #f0f7ff;
    font-weight: 600;
    color: #007bff;
    border-left: 3px solid #007bff;
}

.sidebar-submenu {
    list-style: none;
    padding-left: 15px;
    padding-top: 5px;
    padding-bottom: 5px;
    background-color: #fafafa;
}

.sidebar-submenu .sidebar-item {
    border-bottom: none;
}

.expand-icon {
    transition: transform 0.3s;
    margin-left: 10px;
}

.collapsed .expand-icon {
    transform: rotate(-90deg);
}

/* Responsive behavior */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 12px;
    }
    
    .main-container {
        max-width: 100% !important;
        padding: 0;
    }
    
    .doc-sidebar {
        width: 0;
        transform: translateX(-100%);
        z-index: 1030;
        top: 56px;
        left: 0;
        position: fixed;
    }
    
    .doc-sidebar.active {
        width: 280px;
        transform: translateX(0);
    }
    
    .doc-content {
        margin-left: 0;
        padding: 15px;
        border-radius: 0;
    }
    
    .sidebar-link {
        padding: 12px 15px;
    }
    
    /* Headings - smaller on mobile */
    #markdown-content h1 {
        font-size: 1.8rem;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }
    
    #markdown-content h2 {
        font-size: 1.5rem;
        margin-top: 1.3rem;
    }
    
    #markdown-content h3 {
        font-size: 1.3rem;
    }
    
    /* Tables responsive */
    #markdown-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Buttons in doc-card-footer */
    .doc-card-footer .btn {
        padding: 8px;
        font-size: 13px;
    }
    
    /* Navbar */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* Make cards full width */
    .doc-card {
        margin-bottom: 15px;
    }
    
    .doc-card-header {
        padding: 15px;
    }
    
    .doc-card-header h2 {
        font-size: 1.3rem;
    }
    
    .doc-card-body {
        padding: 15px;
    }
    
    .doc-card-footer {
        padding: 10px 15px;
    }
    
    /* Improve spacing */
    .row {
        margin-right: -10px;
        margin-left: -10px;
    }
    
    .col-md-6 {
        padding-right: 10px;
        padding-left: 10px;
    }
    
    /* Make diagram scrollable on mobile */
    .mermaid {
        overflow-x: auto;
        max-width: 100%;
    }
    
    /* Code blocks */
    pre {
        padding: 10px;
        font-size: 12px;
    }
    
    /* Modal for expanded diagrams */
    .mermaid-modal-content {
        width: 95%;
        padding: 15px;
        margin: 5% auto;
    }
}

/* Dark mode toggle */
.toggle-sidebar {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 5px 10px;
}

.toggle-sidebar:hover {
    background-color: #f0f0f0;
}

/* Additional spacing improvements */
ul, ol {
    padding-left: 2.5rem;
}

li {
    margin-bottom: 8px;
}

.alert {
    margin-bottom: 25px;
    padding: 15px 20px;
}

/* CSS from markdown.blade.php */
.navbar {
    padding: 10px 0;
    margin-bottom: 20px;
}

.navbar-brand {
    font-size: 1.3rem;
    padding: 8px 0;
}

.nav-link {
    padding: 8px 15px !important;
}

.doc-sidebar {
    height: calc(100vh - 75px);
    width: 30%;
    position: sticky;
    top: 10px;
    overflow-y: auto;
    transition: all 0.3s;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
    align-self: flex-start;
}

.main-container {
    display: flex;
    position: relative;
    padding-top: 10px;
}

.doc-content {
    margin-left: 20px;
}

@media (max-width: 768px) {
    .doc-sidebar {
        position: fixed;
        top: 65px;
        height: calc(100vh - 65px);
    }
    
    .doc-content {
        margin-left: 0;
    }
}

.sidebar-submenu { 
    list-style: none; 
    padding-left: 15px; 
    background-color: #fafafa; 
}

.sidebar-subitem { 
    border-top: 1px solid #f0f0f0; 
}

.sidebar-subitem a {
    padding: 10px 15px 10px 40px; 
    display: block; 
    color: #555;
    text-decoration: none; 
    transition: all 0.2s ease; 
    font-size: 0.95rem;
}

.sidebar-subitem a:hover { 
    background-color: #f0f7ff; 
    color: #007bff; 
}

.sidebar-subitem.active a {
    font-weight: 600; 
    color: #007bff; 
    background-color: #e6f2ff;
    border-left: 3px solid #007bff;
}

/* Submenu Level 2 */
.sidebar-submenu-l2 { 
    list-style: none; 
    padding-left: 0; 
    background-color: #f0f0f0; 
}

.sidebar-subitem-l2 { 
    border-top: 1px solid #e5e5e5; 
}

.sidebar-subitem-l2 a {
    padding: 8px 15px 8px 55px; 
    display: block; 
    color: #555;
    text-decoration: none; 
    transition: all 0.2s ease; 
    font-size: 0.9rem;
}

.sidebar-subitem-l2 a:hover { 
    background-color: #e8f1ff; 
    color: #007bff; 
}

.sidebar-subitem-l2.active a {
    font-weight: 600; 
    color: #007bff; 
    background-color: #d9ebff;
    border-left: 3px solid #007bff;
}

/* Folder styling */
.sidebar-sublink {
    padding: 10px 15px 10px 40px; 
    display: block; 
    color: #444;
    cursor: pointer; 
    transition: all 0.2s ease; 
    font-size: 0.95rem;
    background-color: #f5f5f5; 
    border-top: 1px solid #eaeaea;
}

.sidebar-sublink:hover { 
    background-color: #e8f1ff; 
    color: #007bff; 
}

.sidebar-sublink.active { 
    font-weight: 600; 
    background-color: #e0eeff; 
    color: #0056b3; 
}

.expand-icon { 
    transition: transform 0.3s; 
}

.collapsed .expand-icon { 
    transform: rotate(-90deg); 
}

.doc-sidebar {
    background-color: #ffffff;
    border-right: 1px solid #e9ecef;
    height: calc(100vh - 75px);
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 10px;
    overflow-y: auto;
    transition: all 0.3s;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.doc-content { 
    margin-left: 0;
    padding: 25px 35px; 
    min-height: calc(100vh - 75px);
    flex: 1;
}

.main-container {
    display: flex;
    max-width: 85% !important;
    gap: 0;
    position: relative;
}

.sidebar-header {
    padding: 18px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-item {
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 5px;
}

.sidebar-link {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #444;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar-link:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.sidebar-link.active {
    background-color: #f0f7ff;
    font-weight: 600;
    color: #007bff;
    border-left: 3px solid #007bff;
}

@media (max-width: 768px) {
    .doc-sidebar { 
        width: 0; 
        transform: translateX(-100%);
        position: fixed;
        top: 65px;
        height: calc(100vh - 65px);
    }
    
    .doc-sidebar.active { 
        width: 280px; 
        transform: translateX(0); 
    }
    
    .doc-content { 
        margin-left: 0; 
        padding: 15px;
    }
    
    .sidebar-link, .sidebar-sublink {
        padding: 12px 15px;
    }
}

.toggle-sidebar { 
    background: transparent; 
    border: 1px solid #ddd; 
    border-radius: 3px; 
    padding: 5px 10px;
}

.toggle-sidebar:hover { 
    background-color: #f0f0f0; 
}
