/**
 * Lemma Documentation Styles
 */

/* Hero Section */
.docs-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    color: var(--white);
    padding: 60px 20px;
    text-align: center;
}

.docs-hero h1 {
    font-size: 2.5rem;
    margin: 0 0 12px;
    font-weight: 700;
    color: var(--white);
}

.docs-hero p {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* Docs Search */
.docs-search-container {
    position: relative;
    max-width: 560px;
    margin: 28px auto 0;
}

.docs-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.docs-search-icon {
    position: absolute;
    left: 16px;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    z-index: 1;
}

.docs-search-input {
    width: 100%;
    padding: 14px 60px 14px 48px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.docs-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.docs-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.docs-search-kbd {
    position: absolute;
    right: 14px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.docs-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0,0,0,0.05);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    text-align: left;
}

.docs-search-results.active {
    display: block;
    animation: searchDropIn 0.2s ease;
}

@keyframes searchDropIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.docs-search-results:empty {
    display: none;
}

.docs-search-result {
    display: block;
    padding: 14px 18px;
    text-decoration: none;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s ease;
}

.docs-search-result:last-child {
    border-bottom: none;
}

.docs-search-result:hover,
.docs-search-result.selected {
    background: var(--gray-50);
}

.docs-search-result-title {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.95rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-search-result-title .category-tag {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-tag.getting-started { background: #dbeafe; color: #1d4ed8; }
.category-tag.integration { background: #d1fae5; color: #047857; }
.category-tag.sdk { background: #fef3c7; color: #b45309; }
.category-tag.api { background: #ede9fe; color: #6d28d9; }
.category-tag.resources { background: #fce7f3; color: #be185d; }

.docs-search-result-excerpt {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.docs-search-result-excerpt mark {
    background: #fef08a;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.docs-search-no-results {
    padding: 24px 18px;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.docs-search-hint {
    padding: 12px 18px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 12px 12px;
}

.docs-search-hint kbd {
    padding: 2px 6px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-family: inherit;
    margin: 0 4px;
}

/* Container */
.docs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* Layout Grid */
.docs-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 60px;
}

/* Sidebar */
.docs-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.docs-nav {
    padding-right: 20px;
}

.nav-section {
    margin-bottom: 28px;
}

.nav-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    padding-left: 12px;
}

.docs-nav .nav-link {
    display: block;
    padding: 8px 12px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.docs-nav .nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.docs-nav .nav-link.active {
    background: var(--primary);
    color: var(--white);
}

/* Main Content */
.docs-main {
    min-width: 0;
}

/* Section Styling */
.docs-section {
    margin-bottom: 48px;
    scroll-margin-top: 80px;
}

.docs-section h2 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
}

.docs-section h3 {
    font-size: 1.2rem;
    color: var(--gray-800);
    margin: 32px 0 12px;
}

.docs-section p {
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 16px;
}

/* Code Blocks */
.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    margin: 16px 0;
    position: relative;
}

.code-header {
    background: #2d2d2d;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    margin: -20px -20px 16px -20px;
    font-size: 0.75rem;
    color: #888;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-block code {
    font-family: inherit;
    background: none;
    padding: 0;
}

.copy-btn {
    background: #3d3d3d;
    border: none;
    color: #ccc;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #4d4d4d;
}

/* Inline Code */
.docs-main code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--gray-800);
}

/* API Endpoints */
.api-endpoint {
    background: var(--gray-50);
    padding: 16px 20px;
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    margin: 16px 0;
}

.http-method {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.7rem;
    margin-right: 10px;
    letter-spacing: 0.05em;
}

.http-post {
    background: #10b981;
    color: white;
}

.http-get {
    background: #3b82f6;
    color: white;
}

.http-put {
    background: #f59e0b;
    color: white;
}

.http-delete {
    background: #ef4444;
    color: white;
}

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

.feature-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 24px;
    border-radius: 12px;
    transition: box-shadow 0.2s;
}

.feature-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-card h3 {
    color: var(--primary);
    margin: 0 0 12px;
    font-size: 1rem;
}

.feature-card p {
    color: var(--gray-600);
    margin: 0;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Callouts */
.callout {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.callout--info {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
}

.callout--warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.callout--success {
    background: #d1fae5;
    border-left: 4px solid #10b981;
}

.callout--danger {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
}

.callout-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-900);
}

/* Tables */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.docs-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.docs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
    color: var(--gray-600);
}

.docs-table tr:hover {
    background: var(--gray-50);
}

/* Parameters List */
.params-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.params-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}

.params-list li:last-child {
    border-bottom: none;
}

.param-name {
    font-family: monospace;
    font-weight: 600;
    color: var(--gray-900);
}

.param-type {
    font-size: 0.8rem;
    color: var(--primary);
    margin-left: 8px;
}

.param-required {
    font-size: 0.7rem;
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.param-optional {
    font-size: 0.7rem;
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

/* Tabs */
.docs-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
}

.docs-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 0.9rem;
    color: var(--gray-600);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.docs-tab:hover {
    color: var(--gray-900);
}

.docs-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.docs-tab-content {
    display: none;
}

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

/* Mobile Navigation Toggle - Hidden on Desktop */
.docs-mobile-nav-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), #764ba2);
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 201;
    cursor: pointer;
    border: none;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.docs-mobile-nav-toggle svg {
    width: 24px;
    height: 24px;
}

.docs-mobile-nav-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
}

.docs-mobile-nav-toggle.active {
    background: var(--gray-800);
}

/* Sidebar Overlay - Hidden on Desktop */
.docs-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.docs-sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Responsive Styles */
@media (max-width: 900px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }
    
    .docs-hero h1 {
        font-size: 2rem;
    }
    
    /* Mobile search adjustments */
    .docs-search-container {
        margin-top: 20px;
    }
    
    .docs-search-input {
        padding: 12px 50px 12px 44px;
        font-size: 0.95rem;
    }
    
    .docs-search-kbd {
        display: none;
    }
    
    .docs-search-results {
        max-height: 60vh;
    }
    
    .docs-search-result {
        padding: 12px 14px;
    }
    
    .docs-search-hint {
        padding: 10px 14px;
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
    
    /* Show mobile nav toggle */
    .docs-mobile-nav-toggle {
        display: flex;
    }
    
    /* Enable overlay */
    .docs-sidebar-overlay {
        display: block;
    }
    
    /* Mobile sidebar drawer */
    .docs-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        background: white;
        z-index: 200;
        padding: 80px 24px 24px;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .docs-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .docs-sidebar .docs-nav {
        padding-right: 0;
    }
    
    /* Mobile sidebar header */
    .docs-sidebar::before {
        content: 'Documentation';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        display: block;
        font-size: 1.1rem;
        font-weight: 700;
        color: white;
        padding: 20px 24px;
        background: linear-gradient(135deg, var(--primary), #764ba2);
    }
    
    /* Larger touch targets on mobile */
    .docs-sidebar .nav-link {
        padding: 12px;
        font-size: 1rem;
    }
    
    .docs-sidebar .nav-title {
        margin-top: 8px;
    }
}
