/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #10B981;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* Container Layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
}

.logo {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.logo-image {
    height: auto;
    display: block;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Search Styles */
.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Navigation Styles */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

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

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    position: relative;
}

.has-submenu > .nav-link {
    padding-right: 1rem;
}

.has-submenu > .nav-link > span:first-of-type {
    flex-shrink: 0;
}

.nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: rgba(79, 70, 229, 0.05);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

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

.nav-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    color: inherit;
}

.nav-item.hidden {
    display: none;
}

/* Submenu Toggle Icon */
.submenu-toggle {
    font-size: 1rem;
    transition: transform 0.3s ease;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.6;
}

.has-submenu.open > .nav-link .submenu-toggle {
    transform: rotate(-180deg);
}

/* Sub Navigation Styles */
.sub-nav-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.has-submenu.open > .sub-nav-list {
    max-height: 500px;
    transition: max-height 0.4s ease-in;
}

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

.sub-nav-link {
    padding: 0.5rem 1.5rem 0.5rem 3.25rem;
    font-size: 0.85rem;
    font-weight: 400;
    border-left: 3px solid transparent;
    position: relative;
}

.sub-nav-link::before {
    content: '›';
    position: absolute;
    left: 2.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.sub-nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.sub-nav-link.active {
    background-color: rgba(79, 70, 229, 0.08);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.sub-nav-link.active::before {
    color: var(--primary-color);
}

.sub-nav-item.hidden {
    display: none;
}

/* Content Styles */
.content {
    flex: 1;
    padding: 3rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.content-section {
    margin-bottom: 4rem;
    scroll-margin-top: 2rem;
}

.content-subsection {
    scroll-margin-top: 2rem;
    margin-bottom: 2rem;
}

.content-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.content-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.content-section p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.content-section ul,
.content-section ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
    color: var(--text-secondary);
}

.content-section li {
    margin-bottom: 0.5rem;
}

/* Info Box */
.info-box {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3B82F6;
    padding: 1rem 1.25rem;
    border-radius: 0.375rem;
    margin: 1.5rem 0;
}

.warning-box {
    background-color: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #F59E0B;
    padding: 1rem 1.25rem;
    border-radius: 0.375rem;
    margin: 1.5rem 0;
}

/* Code Block */
.code-block {
    background-color: var(--text-primary);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #D1D5DB;
}

code {
    background-color: #2b2d30;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #D1D5DB;
}

/* Tables */
.config-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.config-table thead {
    background-color: var(--bg-tertiary);
}

.config-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.config-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 250px;
}
.config-table td:last-child {
    max-width: auto;
}
.config-table tr:hover {
    background-color: var(--bg-secondary);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: var(--transition);
}

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

.feature-card h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-card h3 svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    stroke: currentColor;
    color: var(--primary-color);
}

.feature-card p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* API Method */
.api-method {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.api-method h4 {
    margin-top: 0;
    color: var(--primary-color);
}

/* Troubleshooting */
.trouble-item {
    background-color: var(--bg-primary);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0.375rem;
}

.trouble-item h4 {
    margin-top: 0;
    color: var(--text-primary);
}

/* FAQ Items */
.faq-item {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.faq-item h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Support Grid */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.support-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

.support-card h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.support-card h3 svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    stroke: currentColor;
    color: var(--primary-color);
}

.support-card p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.response-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* Scrollbar Styles */
.sidebar::-webkit-scrollbar,
.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.nav-menu::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar::-webkit-scrollbar-thumb,
.nav-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.nav-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu {
        max-height: 400px;
    }

    .content {
        padding: 2rem 1.5rem;
    }

    .content-section h2 {
        font-size: 1.5rem;
    }

    .feature-grid,
    .support-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation for smooth appearance */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section {
    animation: fadeIn 0.5s ease-in-out;
}

/* Search highlight */
.highlight {
    background-color: yellow;
    font-weight: bold;
}

/* Documentation Pagination */
.doc-pagination {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.pagination-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: var(--transition);
    flex: 1;
    max-width: 45%;
}

.pagination-link:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pagination-link.prev-page {
    justify-content: flex-start;
}

.pagination-link.next-page {
    justify-content: flex-end;
    text-align: right;
}

.pagination-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pagination-arrow svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    color: inherit;
}

.pagination-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pagination-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.pagination-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pagination-link:hover .pagination-title {
    color: var(--primary-color);
}

.pagination-placeholder {
    flex: 1;
    max-width: 45%;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .doc-pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .pagination-link {
        max-width: 100%;
    }

    .pagination-placeholder {
        display: none;
    }
}

/* Settings Screenshots */
.settings-screenshot {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-screenshot img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.content-subsection .settings-screenshot {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

/* Image Lightbox Styles */
.settings-screenshot img {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.settings-screenshot img:hover {
    opacity: 0.9;
}

.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.lightbox-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    cursor: default;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.lightbox-close::before {
    content: '×';
    font-size: 3rem;
    line-height: 1;
}

.lightbox-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    color: #fff;
    text-align: center;
    font-size: 0.9rem;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .lightbox-content img {
        max-height: 85vh;
    }
    
    .lightbox-close {
        top: -35px;
        right: -10px;
        width: 35px;
        height: 35px;
    }
    
    .lightbox-close::before {
        font-size: 2.5rem;
    }
    
    .lightbox-caption {
        bottom: -35px;
        font-size: 0.8rem;
    }
}

