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

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Top Toolbar Styles */
.top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    padding: 12px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.toolbar-left .doc-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.toolbar-right {
    display: flex;
    align-items: center;
}

.version-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switch-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

.toggle-switch {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 4px;
    backdrop-filter: blur(10px);
}

.toggle-switch input[type="radio"] {
    display: none;
}

.toggle-switch label {
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.toggle-switch input[type="radio"]:checked + label {
    background: white;
    color: #1a73e8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle-switch label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.toggle-switch input[type="radio"]:checked + label:hover {
    background: white;
    color: #1a73e8;
}

.container {
    display: flex;
    height: calc(100vh - 60px); /* Subtract toolbar height */
}

.sidebar {
    width: 280px;
    background-color: #f8f9fa;
    color: #333;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid #e4e6e8;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e4e6e8;
    color: #1a73e8;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    color: #1a73e8;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar ul li a:hover, .sidebar ul li a.active {
    background-color: rgba(26, 115, 232, 0.1);
    color: #1a73e8;
}

.sidebar ul li a.active {
    font-weight: 600;
    border-left: 3px solid #1a73e8;
}

/* Navigation Content Switching */
.nav-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: fadeOut 0.3s ease;
}

.nav-content.active {
    display: block !important;
    opacity: 1 !important;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Table of Contents Collapsible Style */
.toc {
    margin: 0;
    padding: 0;
}

.toc-item {
    margin-bottom: 8px;
}

.toc-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
}

.toc-header a {
    flex-grow: 1;
    padding: 8px 12px !important;
}

.toggle-btn {
    display: inline-block;
    width: 22px;
    height: 22px;
    text-align: center;
    line-height: 22px;
    font-weight: bold;
    font-size: 14px;
    background-color: #e8f0fe;
    border-radius: 4px;
    margin-right: 8px;
    color: #1a73e8;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Add arrow styling for toggle buttons */
.toggle-btn::before {
    content: "\25B6"; /* Right arrow Unicode */
    display: inline-block;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.toc-item:has(.toc-sublist.active) .toggle-btn::before {
    content: "\25BC"; /* Down arrow Unicode */
    display: inline-block;
}

.toggle-btn:hover {
    background-color: #d2e3fc;
}

.toc-sublist {
    display: none;
    margin-left: 30px !important;
    margin-top: 6px;
    border-left: 1px solid #e4e6e8;
    padding-left: 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.toc-sublist.active {
    display: block;
}

.toc-sublist li {
    margin-bottom: 6px;
}

.toc-sublist li a {
    font-size: 0.95em;
    padding: 6px 12px;
    color: #5f6368;
}

.toc-sublist li a:hover {
    color: #1a73e8;
}

.main-content {
    flex: 1;
    padding: 10px 5px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.main-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    transition: opacity 0.3s ease;
}

/* Content Page Styles */
.content-page {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: #3c4043;
    padding: 20px 10px;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-in-out;
    background-color: #fff;
}

.content-page h1 {
    color: #202124;
    border-bottom: 2px solid #f1f3f4;
    padding-bottom: 15px;
    margin-bottom: 30px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.content-page h2 {
    color: #1a73e8;
    margin: 35px 0 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.content-page p {
    margin-bottom: 20px;
    font-size: 16px;
}

.content-page ul, .content-page ol {
    margin-left: 40px;
    margin-bottom: 20px;
}

.content-page li {
    margin-bottom: 8px;
}

.content-page a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s;
}

.content-page a:hover {
    border-bottom: 1px solid #1a73e8;
    text-decoration: none;
}

/* Code block styling */
pre {
    position: relative;
    background-color: #f8f9fa;
    border: 1px solid #e4e6e8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    overflow: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', Courier, monospace;
    color: #24292e;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre;
}

.code-container {
    position: relative;
    margin-bottom: 20px;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e8f0fe;
    border: 1px solid #d2e3fc;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.2s;
    color: #1a73e8;
    font-weight: 500;
    z-index: 10;
}

.copy-button:hover {
    opacity: 1;
    background-color: #d2e3fc;
}

.copy-button.copied {
    background-color: #d2e3fc;
    color: #1a73e8;
    border-color: #1a73e8;
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    padding-top: 20px;
    border-top: 1px solid #f1f3f4;
}

.navigation a {
    background-color: #e8f0fe;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    color: #1a73e8;
    transition: all 0.2s;
}

.navigation a:hover {
    background-color: #d2e3fc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chapter-links {
    margin-top: 40px;
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #1a73e8;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.chapter-links h3 {
    margin-top: 0;
    color: #202124;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Additional styles from section HTML files */
.note {
    background-color: #e8f0fe;
    border-left: 4px solid #1a73e8;
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.example {
    background-color: #e6f4ea;
    border-left: 4px solid #34a853;
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.warning {
    background-color: #fef7e0;
    border-left: 4px solid #fbbc04;
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Table styles */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 25px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

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

th, td {
    padding: 15px;
    text-align: left;
}

th {
    background-color: #f1f3f4;
    font-weight: 600;
    color: #202124;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #f1f3f4;
}

blockquote {
    border-left: 4px solid #1a73e8;
    padding-left: 20px;
    margin-left: 0;
    color: #5f6368;
    font-style: italic;
}

/* Image styling */
img {
    max-width: 100%;
    height: auto;
    border: 1px solid #e4e6e8;
    border-radius: 8px;
    padding: 5px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}



/* Mobile Responsive Styles */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover, .sidebar-toggle.toggle-active {
    background-color: #0d47a1;
}

@media (max-width: 768px) {
    .top-toolbar {
        flex-direction: column;
        gap: 12px;
        padding: 16px 20px;
    }
    
    .toolbar-left .doc-title {
        font-size: 1.3rem;
        text-align: center;
    }
    
    .version-switcher {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .switch-label {
        font-size: 0.85rem;
    }
    
    .toggle-switch {
        min-width: 200px;
        justify-content: center;
    }
    
    .container {
        flex-direction: column;
        height: calc(100vh - 120px); /* Adjust for larger toolbar on mobile */
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 999;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.sidebar-open {
        transform: translateY(0);
    }
    
    .main-content {
        margin-top: 50px;
        transition: margin-top 0.3s ease;
    }
    
    .content-page {
        padding: 20px;
    }
    
    .sidebar-toggle {
        display: block;
    }
}

/* Page Transitions */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
} 