:root {
    --teya-lime: #E0E722;
    --teya-blue: #008BB9;
    --teya-black: #000000;
    --teya-white: #FFFFFF;
    --teya-gray-light: #f9fafb;
    --teya-gray: #6b7280;
    --teya-gray-dark: #374151;
}

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

body {
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
    padding-top: 80px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout */
.main-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: #ffffff;
    border-bottom: 3px solid var(--teya-lime);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease-in-out;
}

.navbar.scrolled {
    border-bottom-width: 2px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    transition: height 0.3s ease-in-out;
}

.navbar.scrolled .nav-container {
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
    color: #1f2937;
}

.logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    transition: height 0.3s ease-in-out;
}

.navbar.scrolled .logo {
    height: 32px;
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
    background: rgba(224, 231, 34, 0.1);
    padding: 12px 24px;
    border-radius: 50px;
    border: 1px solid rgba(224, 231, 34, 0.2);
    transition: all 0.3s ease-in-out;
}

.navbar.scrolled .nav-links {
    gap: 30px;
    padding: 8px 20px;
}

.nav-links a {
    text-decoration: none;
    color: #374151;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    padding: 8px 16px;
    border-radius: 24px;
    position: relative;
}

.navbar.scrolled .nav-links a {
    font-size: 14px;
    padding: 6px 12px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--teya-black) !important;
    background: var(--teya-lime) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(224, 231, 34, 0.3);
}

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

.ai-assistant-btn {
    background: linear-gradient(135deg, var(--teya-lime), #c4d600);
    border: 1px solid var(--teya-lime);
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    color: var(--teya-black);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(224, 231, 34, 0.2);
}

.ai-assistant-btn:hover {
    background: linear-gradient(135deg, #c4d600, var(--teya-lime));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(224, 231, 34, 0.3);
}

.ai-assistant-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(224, 231, 34, 0.2);
}

.ai-assistant-btn i {
    font-size: 14px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

/* Chat Modal */
.chat-modal {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 450px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.chat-modal.active {
    opacity: 1;
    visibility: visible;
}

.chat-modal.fullscreen {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    transform: none;
}

.chat-container {
    background: var(--teya-white);
    border-radius: 16px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

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

.chat-header {
    background: linear-gradient(135deg, var(--teya-lime), #c4d600);
    color: var(--teya-black);
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.joe-lime-avatar {
    width: 36px;
    height: 36px;
    background: var(--teya-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.joe-lime-avatar i {
    color: var(--teya-lime);
    font-size: 18px;
    animation: sparkle 2s ease-in-out infinite;
}

.chat-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.status {
    font-size: 12px;
    opacity: 0.8;
}

.close-chat-btn,
.fullscreen-toggle-btn {
    background: none;
    border: none;
    color: var(--teya-black);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-chat-btn:hover,
.fullscreen-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
    max-width: 80%;
}

.assistant-message {
    align-self: flex-start;
    max-width: 100%;
    width: 100%;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar.joe-lime {
    background: linear-gradient(135deg, var(--teya-lime), #c4d600);
    color: var(--teya-black);
}

.avatar.user {
    background: var(--teya-gray);
    color: var(--teya-white);
}

.message-content {
    background: #f3f4f6;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.user-message .message-content {
    max-width: calc(100% - 60px);
    background: var(--teya-lime);
    color: var(--teya-black);
}

.assistant-message .message-content {
    max-width: calc(100% - 50px);
    width: calc(100% - 50px);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.message-name {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.8;
}

.message-time {
    font-size: 10px;
    opacity: 0.6;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.chat-input-container {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: var(--teya-lime);
}

.send-message-btn {
    background: var(--teya-lime);
    color: var(--teya-black);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.send-message-btn:hover {
    background: #c4d600;
    transform: scale(1.05);
}

.send-message-btn:active {
    transform: scale(0.95);
}

/* Inline code styles */
.inline-code {
    background: #f7fafc;
    color: #d73a49;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    border: 1px solid #e2e8f0;
}

/* Typing indicator */
.typing-indicator .message-text {
    padding: 8px 12px;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--teya-gray);
    animation: typing-bounce 1.4s infinite both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Design OAuth Flow Link Styling */
.design-oauth-link {
    background: transparent !important;
    color: var(--teya-gray) !important;
    font-weight: 500 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 12px 20px !important;
    box-shadow: none !important;
    border: none !important;
    border-left: 3px solid transparent !important;
    transition: all 0.2s ease !important;
}

.design-oauth-link:hover {
    background: var(--teya-gray-light) !important;
    color: var(--teya-black) !important;
    border-left-color: var(--teya-lime) !important;
    transform: none !important;
    box-shadow: none !important;
}

.design-oauth-link.active {
    background: var(--teya-lime) !important;
    color: var(--teya-black) !important;
    border-left-color: var(--teya-lime) !important;
    font-weight: 600 !important;
}

.design-oauth-link i {
    color: inherit !important;
    font-size: 14px !important;
}

.design-oauth-link.active i {
    color: var(--teya-black) !important;
}

/* Callout Styles */
.callout {
    padding: 20px;
    border-radius: 12px;
    margin: 24px 0;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.callout.info {
    background: rgba(0, 139, 185, 0.1);
    border: 1px solid rgba(0, 139, 185, 0.2);
    color: var(--teya-black);
}

.callout i {
    color: var(--teya-blue);
    font-size: 20px;
    margin-top: 2px;
}

/* Code Tabs */
.code-tabs {
    margin: 24px 0;
}

.tab-buttons {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    color: var(--teya-gray);
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--teya-gray-light);
    color: var(--teya-black);
}

.tab-btn.active {
    background: var(--teya-lime);
    color: var(--teya-black);
    font-weight: 600;
}

.tab-content {
    position: relative;
}

.tab-pane {
    display: none;
}

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

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin: 24px 0;
}

.error-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--teya-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.error-table th {
    background: var(--teya-gray-light);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--teya-black);
    border-bottom: 1px solid #e5e7eb;
}

.error-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: var(--teya-gray);
}

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

.error-table code {
    background: var(--teya-gray-light);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    color: var(--teya-black);
}

/* Footer */
.footer {
    background: var(--teya-black);
    color: rgb(232, 232, 154);
    padding: 30px 0;
    border-top: 3px solid var(--teya-lime);
    margin-top: auto;
}

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

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.footer-links a {
    color: rgb(232, 232, 154);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--teya-white);
}

.footer-copyright {
    color: rgb(232, 232, 154);
    font-size: 14px;
}

.footer-copyright p {
    margin: 0;
}

/* Page Layout with Sidebar */
.page-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--teya-white);
    border-right: 1px solid #e5e7eb;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    transition: background-color 0.3s;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--teya-black);
    margin-bottom: 8px;
}

.sidebar-header p {
    font-size: 14px;
    color: var(--teya-gray);
    margin: 0;
}

.sidebar-nav {
    padding: 16px 0;
}

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

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--teya-gray);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}

.nav-link:hover {
    background: var(--teya-gray-light);
    color: var(--teya-black);
    border-right-color: var(--teya-lime);
}

.nav-link.active {
    background: var(--teya-lime);
    color: var(--teya-black);
    border-right-color: var(--teya-lime);
    font-weight: 600;
}

.nav-link i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.nav-parent {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    color: var(--teya-gray);
    background: transparent;
    border-right: 3px solid transparent;
    font-weight: 400;
    transition: all 0.2s;
}

.nav-parent:hover {
    background: var(--teya-gray-light);
    color: var(--teya-black);
    border-right-color: var(--teya-lime);
}

.nav-parent.active {
    background: var(--teya-lime);
    color: var(--teya-black);
    border-right-color: var(--teya-lime);
    font-weight: 500;
}

.nav-parent i {
    margin-right: 8px;
    width: 16px;
}

.nav-parent i:last-child {
    margin-left: auto;
    margin-right: 0;
    transition: transform 0.2s ease;
}

/* Sub Navigation */
.sub-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: 20px;
    margin-top: 8px;
    display: none;
}

.nav-item:hover .sub-nav,
.nav-item.active .sub-nav {
    display: block;
}

.sub-nav-item {
    margin: 0;
}

.sub-nav-link {
    display: block;
    padding: 10px 20px 10px 44px;
    text-decoration: none;
    color: var(--teya-gray);
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
    border-right: 2px solid transparent;
}

.sub-nav-link:hover {
    background: var(--teya-gray-light);
    color: var(--teya-black);
    border-right-color: var(--teya-lime);
}

.sub-nav-link.active {
    background: #e8e8e8;
    color: var(--teya-black);
    border-right-color: var(--teya-lime);
    font-weight: 500;
}

.sub-nav-link i {
    margin-right: 8px;
    width: 14px;
}

/* Sub-Sub Navigation (Third Level) */
.sub-sub-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: 20px;
    margin-top: 4px;
    display: none;
}

.sub-nav-item:hover .sub-sub-nav,
.sub-nav-item.active .sub-sub-nav {
    display: block;
}

.sub-sub-nav-item {
    margin: 0;
}

.sub-sub-nav-link {
    display: block;
    padding: 6px 60px;
    text-decoration: none;
    color: var(--teya-gray);
    font-size: 13px;
    transition: all 0.2s;
}

.sub-sub-nav-link:hover {
    background: #e8e8e8;
    color: var(--teya-black);
}

.sub-sub-nav-link.active {
    background: #e8e8e8;
    color: var(--teya-black);
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    background: var(--teya-white);
    transition: background-color 0.3s;
}

main {
    flex: 1;
}

.content-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
}

.content-section {
    margin-bottom: 60px;
}

.content-section h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--teya-black);
    margin-bottom: 16px;
}

.content-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--teya-black);
    margin-bottom: 16px;
    margin-top: 40px;
}

.section-intro {
    font-size: 18px;
    color: var(--teya-gray);
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Code Block */
.code-block {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    margin: 16px 0;
    border: 1px solid #333;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2d2d2d;
    padding: 12px 16px;
    border-bottom: 1px solid #333;
}

.code-header span, .code-language {
    color: #d4d4d4;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-code-btn, .copy-btn {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.copy-code-btn:hover, .copy-btn:hover {
    background: #404040;
    color: var(--teya-lime);
}

.code-block pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.code-block code {
    color: #d4d4d4;
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    white-space: pre;
    display: block;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--teya-blue);
    color: var(--teya-white);
    border: 2px solid var(--teya-blue);
}

.btn-primary:hover {
    background: var(--teya-white);
    color: var(--teya-blue);
    border-color: var(--teya-white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: var(--teya-white);
    color: var(--teya-black);
    border: 2px solid var(--teya-black);
}

.btn-secondary:hover {
    background: var(--teya-blue);
    color: var(--teya-white);
    border-color: var(--teya-blue);
    transform: translateY(-2px);
}

/* Feature Card - Used in some pages */
.feature-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    border: 1px solid #e5e7eb;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--teya-lime), var(--teya-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon i {
    color: var(--teya-black);
    font-size: 20px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1f2937;
}

.feature-card p {
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

/* Images in content areas */
.content-container img,
.content-section img,
.message-content img,
main img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 16px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Badge images (like Maven badges) should maintain their aspect ratio */
img[src*="shield"], 
img[src*="badge"],
img[src*="img.shields.io"] {
    max-width: 200px !important;
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
    margin: 4px !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    /* Navigation */
    body {
        padding-top: 60px;
    }
    
    .nav-container {
        padding: 0 16px;
        height: 60px;
    }
    
    .logo {
        height: 28px !important;
    }
    
    .navbar.scrolled .logo {
        height: 24px !important;
    }
    
    /* Hide desktop navigation and show mobile toggle */
    .nav-links {
        display: none !important;
    }
    
    .mobile-nav-toggle {
        display: block !important;
        background: none !important;
        border: none !important;
        color: #374151 !important;
        font-size: 18px !important;
        padding: 8px !important;
        border-radius: 6px !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        margin-right: 12px !important;
    }
    
    /* Adjust AI button for mobile */
    .ai-assistant-btn span {
        display: none;
    }
    
    .ai-assistant-btn {
        padding: 8px;
        min-width: 40px;
        width: 40px;
        height: 40px;
        justify-content: center;
    }
    
    /* Page layout mobile adjustments */
    .page-layout {
        flex-direction: column;
    }
    
    /* Force flex direction to column for main layout on mobile */
    div[style*="display: flex"][style*="flex: 1"] {
        flex-direction: column !important;
    }
    
    /* Sidebar mobile adjustments */
    .sidebar,
    aside[style*="width: 280px"],
    #sidebar {
        width: 100% !important;
        position: static !important;
        height: auto !important;
        border-right: none !important;
        border-bottom: 1px solid #e5e7eb !important;
        max-height: 300px !important;
        overflow-y: auto !important;
        flex: none !important;
    }
    
    /* Make sidebar collapsible on mobile */
    .sidebar-header {
        cursor: pointer;
        user-select: none;
        position: relative;
    }
    
    .sidebar-header::after {
        content: '\f107';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.collapsed .sidebar-header::after {
        transform: translateY(-50%) rotate(-90deg);
    }
    
    .sidebar.collapsed .sidebar-nav {
        display: none;
    }
    
    /* Main content mobile adjustments */
    .content-container {
        padding: 24px 16px;
        max-width: 100%;
    }
    
    main[id="content"],
    main[style*="flex: 1"] {
        padding: 20px 16px !important;
        width: 100% !important;
        flex: none !important;
        max-width: none !important;
    }
    
    .content-section h1 {
        font-size: 28px;
    }
    
    .content-section h2 {
        font-size: 20px;
    }
    
    /* Chat modal mobile */
    .chat-modal {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        height: 60vh;
        max-height: 450px;
    }
    
    .chat-modal.fullscreen {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw !important;
        height: 100vh !important;
    }
    
    .chat-messages {
        padding: 12px;
    }
    
    .chat-input-container {
        padding: 12px;
    }
    
    #chat-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Tables mobile */
    .table-container {
        margin: 16px -16px;
        overflow-x: auto;
    }
    
    .error-table {
        font-size: 14px;
        border-radius: 0;
        min-width: 600px;
    }
    
    .error-table th,
    .error-table td {
        padding: 12px;
    }
    
    /* Code blocks mobile */
    .code-block {
        margin: 16px -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    pre {
        font-size: 12px !important;
        line-height: 1.3 !important;
        overflow-x: auto !important;
    }
    
    /* Better mobile typography */
    h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
    h3 { font-size: clamp(1.25rem, 3.5vw, 1.75rem); }
    h4 { font-size: clamp(1.1rem, 3vw, 1.5rem); }
    
    /* Prevent horizontal scroll */
    body, html {
        overflow-x: hidden;
    }
    
    /* Footer mobile */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .footer-links {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Mobile navigation enhancements */
.mobile-nav-toggle {
    display: none !important;
}

.mobile-nav-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Mobile menu overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-menu {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 280px;
    height: calc(100vh - 80px);
    background: var(--teya-white);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
}

.mobile-nav-menu.active {
    right: 0;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav-links a {
    color: var(--teya-gray-dark);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: color 0.2s ease;
}

.mobile-nav-links a:hover {
    color: var(--teya-blue);
}

.mobile-nav-links a:last-child {
    border-bottom: none;
}

.mobile-nav-links i {
    width: 20px;
    text-align: center;
    color: var(--teya-lime);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Touch-friendly buttons on mobile */
@media (hover: none) and (pointer: coarse) {
    button, a, .nav-link, .feature-card {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-links a {
        padding: 12px 16px;
    }
    
    .btn {
        padding: 14px 28px;
        font-size: 16px;
    }
}

/* Tablet responsive adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-links {
        gap: 24px;
        padding: 10px 20px;
    }
    
    .content-container {
        padding: 32px 20px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 12px;
    }
    
    .logo {
        height: 24px !important;
    }
    
    .navbar.scrolled .logo {
        height: 20px !important;
    }
    
    .content-container {
        padding: 20px 12px;
    }
    
    .content-section h1 {
        font-size: 24px;
    }
    
    .content-section h2 {
        font-size: 18px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

/* Ensure close button works properly in fullscreen mode */
.chat-modal.fullscreen .close-chat-btn {
    position: relative;
    z-index: 10001;
    pointer-events: auto;
}

.chat-modal.fullscreen .chat-header-actions {
    z-index: 10001;
    pointer-events: auto;
}

/* Modern Responsive Sidebar - Stripe-style */
.sidebar-toggle {
    display: none;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: #f8f9fa;
}

.sidebar-toggle .hamburger-icon {
    font-size: 18px;
    color: #666;
}

.sidebar-toggle .section-title {
    flex: 1;
}

.sidebar-toggle .chevron-icon {
    font-size: 14px;
    color: #666;
    transition: transform 0.2s ease;
}

.sidebar-toggle.expanded .chevron-icon {
    transform: rotate(90deg);
}

.sidebar-nav-container {
    transition: all 0.3s ease;
}

.sidebar-nav-container.collapsed {
    max-height: 0;
    overflow: hidden;
}

.sidebar-nav-container.expanded {
    max-height: 1000px;
    overflow-y: auto;
}

/* Mobile-first responsive sidebar */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex !important;
    }
    
    /* Hide desktop header on mobile */
    .desktop-header {
        display: none !important;
    }
    
    /* Ensure the sidebar navigation is collapsible */
    .sidebar-nav-container {
        background: #fff;
        border-top: 1px solid #e5e7eb;
    }
    
    /* Style the header section differently on mobile */
    #sidebar > div:first-child {
        display: none !important;
    }
    
    /* Navigation links mobile adjustments */
    #sidebar .nav-link,
    #sidebar .sub-nav-link,
    #sidebar .sub-sub-nav-link {
        padding: 14px 20px !important;
        font-size: 15px !important;
        border-bottom: 1px solid #f0f0f0 !important;
        background: #fff !important;
        display: flex !important;
        align-items: center !important;
        min-height: 48px !important;
    }
    
    #sidebar .nav-link:hover,
    #sidebar .sub-nav-link:hover,
    #sidebar .sub-sub-nav-link:hover {
        background: #f8f9fa !important;
    }
    
    #sidebar .nav-link.active,
    #sidebar .sub-nav-link.active,
    #sidebar .sub-sub-nav-link.active {
        background: #e8f4fd !important;
        color: var(--teya-blue) !important;
        border-left: 3px solid var(--teya-blue) !important;
    }
    
    /* Section parent items on mobile */
    .nav-parent {
        padding: 14px 20px !important;
        background: #fff !important;
        border-bottom: 1px solid #f0f0f0 !important;
        min-height: 48px !important;
    }
    
    .nav-parent:hover {
        background: #f8f9fa !important;
    }
    
    /* Child navigation sections */
    .nav-children {
        background: #f8f9fa !important;
    }
    
    .nav-children .sub-nav-link {
        background: #f8f9fa !important;
        padding-left: 40px !important;
    }
    
    .nav-children .sub-nav-link:hover {
        background: #f0f0f0 !important;
    }
    
    /* Grandchildren navigation */
    .nav-grandchildren .sub-sub-nav-link {
        background: #f0f0f0 !important;
        padding-left: 60px !important;
        font-size: 14px !important;
    }
    
    .nav-grandchildren .sub-sub-nav-link:hover {
        background: #e8e8e8 !important;
    }
    
    /* Main layout container fixes */
    .main-layout {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .main-layout > div[style*="display: flex"] {
        flex-direction: column !important;
    }
}

/* Only used in specific pages */
.desktop-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin: 32px 0;
}

@media (max-width: 768px) {
    .desktop-two-column {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
}

/* Feature grid - used in apis/overview.html */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}