/* 
   Dautucong System Documentation Stylesheet
   Design Style: Premium Modern Slate & Blue
   Typography: Roboto (Google Fonts)
*/

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

:root {
    --primary-color: #0f172a;       /* Slate 900 */
    --primary-light: #1e293b;      /* Slate 800 */
    --secondary-color: #2563eb;    /* Blue 600 */
    --secondary-light: #eff6ff;   /* Blue 50 */
    --accent-color: #0d9488;       /* Teal 600 */
    --accent-light: #f0fdfa;      /* Teal 50 */
    --bg-color: #f8fafc;          /* Slate 50 */
    --card-bg: #ffffff;
    --text-color: #334155;        /* Slate 700 */
    --text-muted: #64748b;        /* Slate 500 */
    --border-color: #e2e8f0;      /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --sidebar-width: 280px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

/* Page Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: #f8fafc;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    height: 70px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    background-color: var(--secondary-color);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.25rem;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.4);
}

.brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0.75rem;
}

/* Custom Scrollbar for Sidebar & Content */
.sidebar-nav::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
body::-webkit-scrollbar-track {
    background: #f1f5f9;
}
body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.nav-group {
    margin-bottom: 1.5rem;
}

.nav-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding-left: 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 400;
    font-size: 0.925rem;
    transition: all var(--transition-fast);
    margin-bottom: 0.125rem;
}

.nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #ffffff;
    background-color: var(--secondary-color);
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-icon {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Topbar */
.header-topbar {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

.header-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-light);
}

.header-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Content Viewport */
.content-viewport {
    flex: 1;
    padding: 2.5rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Typography elements */
h1 {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    letter-spacing: -0.2px;
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 400;
}

ul, ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Page Intro Block */
.intro-block {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 100%);
    border: 1px solid #dbeafe;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.intro-block h1 {
    color: #1e3a8a;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.intro-block p {
    color: #1e40af;
    font-size: 1.1rem;
    margin-bottom: 0;
    font-weight: 400;
}

/* Cards & Grid Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    color: var(--primary-light);
}

.card-icon {
    font-size: 1.35rem;
    color: var(--secondary-color);
}

.card-border-primary {
    border-top: 4px solid var(--secondary-color);
}

.card-border-accent {
    border-top: 4px solid var(--accent-color);
}

.card-border-warning {
    border-top: 4px solid #d97706; /* Amber 600 */
}

/* GitHub style Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid transparent;
}

.alert-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.alert-note {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left-color: #64748b;
    color: #475569;
}
.alert-note .alert-title { color: #475569; }

.alert-tip {
    background-color: #f0fdf4;
    border: 1px solid #dcfce7;
    border-left-color: #16a34a;
    color: #15803d;
}
.alert-tip .alert-title { color: #15803d; }

.alert-important {
    background-color: #f5f3ff;
    border: 1px solid #ede9fe;
    border-left-color: #7c3aed;
    color: #6d28d9;
}
.alert-important .alert-title { color: #6d28d9; }

.alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-left-color: #d97706;
    color: #b45309;
}
.alert-warning .alert-title { color: #b45309; }

/* Timeline UI Component */
.timeline-container {
    margin: 2rem 0;
    position: relative;
    padding-left: 2rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 7px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    top: 5px;
    left: -2rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3px solid var(--secondary-color);
    z-index: 2;
}

.timeline-item.active .timeline-marker {
    background-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.timeline-content {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

/* Horizontal Timeline Steps (6 phases) */
.steps-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 2.5rem 0;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

.step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 0.5rem;
    min-width: 130px;
}

.step-item::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background-color: var(--border-color);
    z-index: 1;
}

.step-item:last-child::after {
    display: none;
}

.step-num {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    border: 2px solid var(--border-color);
    z-index: 2;
    transition: all var(--transition-fast);
}

.step-item.active .step-num {
    background-color: var(--secondary-color);
    color: #ffffff;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.step-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-light);
}

.step-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Tables Styling */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.925rem;
}

th {
    background-color: #f8fafc;
    color: var(--primary-color);
    font-weight: 700;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Table badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-primary { background-color: #dbeafe; color: #1e40af; }
.badge-success { background-color: #dcfce7; color: #15803d; }
.badge-warning { background-color: #fef3c7; color: #b45309; }
.badge-danger { background-color: #fee2e2; color: #b91c1c; }

/* Mermaid & Diagrams containers */
.diagram-container {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
}

.diagram-caption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: -1rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Footer bottom metadata */
.docs-footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.825rem;
    color: var(--text-muted);
}

/* Mobile Sidebar Backdrop Overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 95;
    backdrop-filter: blur(2px);
}

.sidebar-backdrop.active {
    display: block;
}

/* Custom styles to force Roboto on Mermaid diagrams */
.mermaid text, 
.mermaid .labelText, 
.mermaid .nodeText {
    font-family: 'Roboto', sans-serif !important;
}

/* RESPONSIVE DESIGN MEDIA QUERIES */
@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .hamburger-btn {
        display: block;
    }
    
    .content-viewport {
        padding: 1.5rem;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.35rem;
    }
    
    .intro-block {
        padding: 1.5rem;
    }
}
