:root {
    --primary-color: #7d4cf1;
    --secondary-color: #6a41cf;
    --text-color: #121826;
    --text-secondary: #4d5562;
    --bg-color: #f5f3f9;
    --sidebar-bg: #31293d;
    --border-color: #ddd;
    --code-bg: #f8f9fa;
    --header-bg: #ffffff;
    --link-color: #7d4cf1;
    --link-hover-color: #6a41cf;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --sidebar-link: #9da3ae;
    --sidebar-link-active: #ffffff;
    
    /* HRoom-specific colors */
    --hroom-primary: #7d4cf1;
    --hroom-primary-light: #9369f5;
    --hroom-secondary: #10b981;
    --hroom-gray-light: #f3f4f6;
    --hroom-gray-dark: #1f2937;
    --hroom-warning: #f59e0b;
    --hroom-error: #ef4444;
    --hroom-card-bg: #fff;
    --hroom-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
    --primary-color: #9369f5;
    --secondary-color: #a47ff6;
    --text-color: #e0e0e0;
    --text-secondary: #b4b9c2;
    --bg-color: #1a1a22;
    --sidebar-bg: #31293d;
    --border-color: #444;
    --code-bg: #2c3e50;
    --header-bg: #25232e;
    --link-color: #9369f5;
    --link-hover-color: #a47ff6;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --sidebar-link: #9da3ae;
    --sidebar-link-active: #ffffff;
    
    /* HRoom-specific colors in dark mode */
    --hroom-primary: #9369f5;
    --hroom-primary-light: #a47ff6;
    --hroom-secondary: #34d399;
    --hroom-gray-light: #374151;
    --hroom-gray-dark: #111827;
    --hroom-card-bg: #25232e;
    --hroom-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 300px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    transition: all 0.3s;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 10;
}

.sidebar .logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .logo h2 {
    color: var(--sidebar-link-active);
    font-size: 1.5rem;
}

.sidebar nav {
    padding: 20px 0;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li {
    padding: 5px 15px;
}

.sidebar nav ul li a {
    color: var(--sidebar-link);
    text-decoration: none;
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sidebar nav ul li a:hover, .sidebar nav ul li a.active {
    color: var(--sidebar-link-active);
    background-color: rgba(128, 128, 128, 0.2);
}

.sidebar nav ul li ul {
    padding-left: 20px;
    margin-top: 5px;
}

.sidebar nav ul li ul li {
    padding: 2px 0;
}

.content {
    flex: 1;
    padding: 20px;
    margin-left: 300px;
    transition: margin-left 0.3s;
}

.header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--header-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 {
    font-size: 2.5rem;
    margin-top: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 2rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

code {
    background-color: var(--code-bg);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    color: var(--text-secondary);
}

pre {
    background-color: var(--code-bg);
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.welcome-content {
    text-align: center;
    padding: 50px 20px;
}

.toc-overview {
    max-width: 600px;
    margin: 40px auto;
    text-align: left;
}

.toc-overview ul {
    list-style: none;
}

.toc-overview ul li {
    margin-bottom: 15px;
}

.toc-overview ul li a {
    font-size: 1.2rem;
    font-weight: 500;
}

.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
    margin-right: 10px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

.slider:before {
    background-color: white;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.print-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.print-button:hover {
    background-color: var(--secondary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 2px 0;
    transition: all 0.3s;
}

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

table th, table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

table th {
    background-color: var(--header-bg);
    font-weight: 600;
}

blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-color);
    background-color: rgba(128, 128, 128, 0.05);
    padding: 15px;
    border-radius: 0 5px 5px 0;
}

ul, ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 15px 0;
}

.api-services {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.api-service-card {
    background-color: var(--hroom-card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--hroom-card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.api-service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.api-service-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.api-service-card p {
    margin-bottom: 15px;
    color: var(--text-color);
}

.api-service-card code {
    display: block;
    background-color: var(--code-bg);
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.metrics-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.metric-item {
    display: flex;
    align-items: flex-start;
    background-color: var(--hroom-card-bg);
    border-radius: 8px;
    padding: 15px;
    box-shadow: var(--hroom-card-shadow);
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.metric-icon.engagement {
    background-color: #6366f1;
    position: relative;
}

.metric-icon.engagement::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M21 8v8h-3V8h3m-11 8V8h3v8h-3m7 0V8h3v8h-3M4 8h3v8H4V8z'/%3E%3C/svg%3E");
    background-size: contain;
}

.metric-icon.communication {
    background-color: #10b981;
    position: relative;
}

.metric-icon.communication::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E");
    background-size: contain;
}

.metric-icon.teamwork {
    background-color: #f59e0b;
    position: relative;
}

.metric-icon.teamwork::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM8 17.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5zM9.5 8c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5S9.5 9.38 9.5 8zm6.5 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E");
    background-size: contain;
}

.metric-icon.leadership {
    background-color: #ef4444;
    position: relative;
}

.metric-icon.leadership::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
    background-size: contain;
}

.metric-details h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.metric-details p {
    margin: 0;
    font-size: 0.9rem;
}

.api-endpoint-table {
    margin: 30px 0;
    overflow-x: auto;
}

.api-endpoint-table table {
    width: 100%;
    border-collapse: collapse;
}

.api-endpoint-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 15px;
    text-align: left;
}

.api-endpoint-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.api-endpoint-table tr:hover {
    background-color: var(--hroom-gray-light);
}

.interactive-code-demo {
    margin: 30px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--hroom-card-shadow);
}

.code-editor {
    background-color: var(--code-bg);
    padding: 15px;
    position: relative;
}

.code-editor pre {
    margin: 0;
    outline: none;
    white-space: pre-wrap;
}

.code-output {
    background-color: var(--hroom-gray-dark);
    color: white;
    padding: 0;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.run-code-button {
    background-color: var(--hroom-secondary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.run-code-button:hover {
    background-color: #0d9668;
}

#ai-demo-output {
    padding: 15px;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.tabs {
    margin: 30px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--hroom-card-shadow);
    background-color: var(--hroom-card-bg);
}

.tab-headers {
    display: flex;
    background-color: var(--hroom-gray-light);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.tab-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    background-color: var(--hroom-card-bg);
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.module-card {
    background-color: var(--hroom-card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--hroom-card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.module-card h2 {
    margin-top: 0;
    font-size: 1.4rem;
}

.module-card h2 a {
    color: var(--primary-color);
    text-decoration: none;
}

.module-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.module-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.module-link:hover {
    background-color: var(--secondary-color);
    text-decoration: none;
    color: white;
}

@media print {
    .sidebar, .header, .nav-toggle {
        display: none !important;
    }
    
    .content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    a {
        text-decoration: none;
        color: black;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: black;
        page-break-after: avoid;
    }
    
    img, pre, blockquote, table {
        page-break-inside: avoid;
    }
    
    a:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 100;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-end;
    }
    
    .theme-switch-wrapper {
        margin-bottom: 10px;
    }
    
    .api-services, .metrics-list {
        grid-template-columns: 1fr;
    }
    
    .tab-headers {
        flex-wrap: nowrap;
    }
}