/* ================================
   Documentation Page Styles
   Raycast Premium Theme
   ================================ */

/* Layout */
.doc-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    padding-top: 96px; /* Account for floating navbar */
}

/* Sidebar */
.doc-sidebar {
    position: sticky;
    top: 96px;
    height: calc(100vh - 96px);
    overflow-y: auto;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
}

.doc-sidebar::-webkit-scrollbar {
    width: 4px;
}

.doc-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.doc-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.doc-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--border-color-hover);
}

.doc-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.doc-sidebar-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.doc-version {
    font-size: 0.6875rem;
    padding: 3px 8px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 4px;
    font-weight: 600;
}

.doc-nav {
    padding: 0 12px;
}

.doc-nav-section {
    margin-bottom: 20px;
}

.doc-nav-title {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 8px;
    margin-bottom: 6px;
}

.doc-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.doc-sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.doc-sidebar-link.active {
    color: var(--text-primary);
    background: rgba(255, 99, 99, 0.12);
}

.doc-sidebar-link.active svg {
    color: var(--accent-primary);
}

.doc-sidebar-link svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Main Content */
.doc-content {
    padding: 40px 48px;
    max-width: 820px;
}

.doc-header {
    margin-bottom: 40px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
}

.doc-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.doc-header p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Sections */
.doc-section {
    margin-bottom: 56px;
    scroll-margin-top: calc(var(--nav-height) + 24px);
}

.doc-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.01em;
}

.doc-section h2 svg {
    color: var(--accent-primary);
}

.doc-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 28px 0 14px;
    color: var(--text-primary);
}

.doc-section p {
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 14px;
    font-size: 0.9375rem;
}

.doc-section a {
    color: var(--accent-primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.doc-section a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* Cards */
.doc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin: 20px 0;
}

.doc-card h3 {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 1rem;
}

/* Lists */
.doc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doc-list li {
    position: relative;
    padding: 7px 0 7px 24px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.doc-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 5px;
    height: 5px;
    background: var(--accent-primary);
    border-radius: 50%;
}

.doc-list-check li::before {
    content: '';
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23ff6363' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    border-radius: 0;
    top: 10px;
}

.doc-list-ordered {
    counter-reset: list-counter;
}

.doc-list-ordered li {
    counter-increment: list-counter;
}

.doc-list-ordered li::before {
    content: counter(list-counter) ".";
    background: none;
    color: var(--accent-primary);
    font-weight: 600;
    top: 7px;
    width: auto;
}

.doc-note {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 10px;
}

/* Steps */
.doc-steps {
    margin: 20px 0;
}

.doc-step {
    display: flex;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
}

.doc-step:last-child {
    border-bottom: none;
}

.doc-step-number {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.doc-step-content {
    flex: 1;
}

.doc-step-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.doc-step-content p {
    margin: 0;
    font-size: 0.875rem;
}

/* Alerts */
.doc-alert {
    display: flex;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin: 18px 0;
    font-size: 0.875rem;
}

.doc-alert svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.doc-alert strong {
    display: block;
    margin-bottom: 3px;
}

.doc-alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.doc-alert-info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.doc-alert-success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--accent-secondary-light);
}

.doc-alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Tabs */
.doc-tabs {
    display: flex;
    gap: 6px;
    margin: 20px 0 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.doc-tab {
    padding: 8px 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.doc-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.doc-tab.active {
    color: white;
    background: var(--gradient-primary);
}

.doc-tab-content {
    display: none;
    padding: 14px 0;
}

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

/* Table */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
}

.doc-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.doc-table td:first-child {
    width: 38%;
    color: var(--text-primary);
}

.doc-table td:last-child {
    color: var(--text-secondary);
}

/* Code */
code {
    font-family: var(--font-mono);
    font-size: 0.8125em;
    background: var(--bg-tertiary);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--accent-primary);
}

/* Code Block with Copy Button */
.code-block {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 50px 14px 16px;
    margin: 12px 0;
    overflow-x: auto;
}

.code-block code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.8125rem;
    white-space: nowrap;
}

/* Folder Structure Code Block */
.code-block.folder-structure {
    padding: 16px 20px;
}

.code-block.folder-structure code {
    white-space: pre;
    display: block;
    line-height: 1.6;
}

/* FAQ Styles */
.doc-faq {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.doc-faq-item {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.doc-faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.doc-faq-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.doc-faq-item p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.code-copy {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.code-copy:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.code-copy.copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--accent-secondary);
}

/* Keyboard Key */
kbd {
    display: inline-block;
    padding: 3px 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
}

/* Accordion */
.doc-accordion {
    margin: 20px 0;
}

.doc-accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
    transition: all var(--transition-base);
}

.doc-accordion-item:hover {
    border-color: var(--border-color-hover);
}

.doc-accordion-item.active {
    border-color: rgba(255, 99, 99, 0.3);
}

.doc-accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-sans);
}

.doc-accordion-header svg {
    color: var(--text-tertiary);
    transition: transform var(--transition-base);
}

.doc-accordion-item.active .doc-accordion-header svg {
    transform: rotate(180deg);
    color: var(--accent-primary);
}

.doc-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
}

.doc-accordion-item.active .doc-accordion-content {
    max-height: 500px;
}

.doc-accordion-content p,
.doc-accordion-content ul,
.doc-accordion-content ol {
    padding: 0 18px;
    margin-bottom: 14px;
    font-size: 0.875rem;
}

.doc-accordion-content ul,
.doc-accordion-content ol {
    padding-left: 36px;
}

.doc-accordion-content li {
    padding: 3px 0;
}

/* Support Cards */
.doc-support-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.doc-support-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    text-decoration: none;
    transition: all var(--transition-base);
}

.doc-support-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 99, 99, 0.3);
    background: var(--bg-card-hover);
}

.doc-support-icon {
    margin-bottom: 14px;
    color: var(--accent-primary);
}

.doc-support-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.doc-support-card p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin: 0 0 14px;
    line-height: 1.5;
}

.doc-support-link {
    color: var(--accent-primary-light);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Nav active link */
.nav-link-active {
    color: var(--text-primary) !important;
}

/* Doc Card Highlight */
.doc-card-highlight {
    background: linear-gradient(135deg, rgba(255, 99, 99, 0.05), rgba(168, 85, 247, 0.03));
    border-color: rgba(255, 99, 99, 0.2);
}

/* Download Links */
.doc-download-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.doc-download-links .btn {
    flex: 1;
    min-width: 180px;
}

/* Large Code Block */
.code-block-large {
    padding: 16px 20px;
}

.code-block-large code {
    font-size: 0.75rem;
    word-break: break-all;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1024px) {
    .doc-layout {
        grid-template-columns: 1fr;
    }
    
    .doc-sidebar {
        display: none;
    }
    
    .doc-content {
        padding: 28px 24px;
    }
    
    .doc-support-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .doc-header h1 {
        font-size: 1.75rem;
    }
    
    .doc-section h2 {
        font-size: 1.25rem;
    }
    
    .doc-tabs {
        flex-wrap: wrap;
    }
    
    .doc-download-links {
        flex-direction: column;
    }
    
    .doc-download-links .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .doc-layout {
        padding-top: 80px;
    }
    
    .doc-content {
        padding: 20px 16px;
    }
    
    .doc-header {
        margin-bottom: 32px;
    }
    
    .doc-header h1 {
        font-size: 1.5rem;
    }
    
    .doc-header p {
        font-size: 0.9375rem;
    }
    
    .doc-section {
        margin-bottom: 40px;
    }
    
    .doc-section h2 {
        font-size: 1.125rem;
    }
    
    .doc-card {
        padding: 16px;
    }
    
    .doc-card h3 {
        font-size: 1rem;
    }
    
    .doc-step {
        padding: 16px;
    }
    
    .doc-step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8125rem;
    }
    
    .doc-step-content h4 {
        font-size: 0.9375rem;
    }
    
    .code-block {
        padding: 12px 14px;
    }
    
    .code-block code {
        font-size: 0.75rem;
    }
    
    .code-block-large code {
        font-size: 0.6875rem;
    }
    
    .doc-alert {
        padding: 12px;
    }
    
    .doc-alert svg {
        width: 18px;
        height: 18px;
    }
    
    .doc-support-card {
        padding: 20px;
    }
}
