/**
 * AmanDevelops AI API - Documentation Portal Stylesheet
 * File: public/_styles/docs.css
 */

:root {
    --docs-sidebar-w: 290px;
    --code-bg: #090d16;
    --code-border: rgba(255, 255, 255, 0.08);
    --accent-glow: rgba(99, 102, 241, 0.15);
    --primary-accent: #6366f1;
    --primary-accent-hover: #4f46e5;
}

.docs-page-shell {
    background-color: var(--bg-primary, #0b0f19);
    min-height: 100vh;
}

/* Top Notification & AI Quick-Bar */
.docs-action-bar {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 14px 24px;
    position: sticky;
    top: 70px;
    z-index: 40;
}

.docs-action-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #94a3b8;
}

.docs-breadcrumb a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.15s;
}

.docs-breadcrumb a:hover {
    color: #6366f1;
}

.docs-breadcrumb-sep {
    color: #475569;
}

.docs-breadcrumb-active {
    color: #f8fafc;
    font-weight: 600;
}

.docs-quick-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-ai-prompt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
}

.btn-ai-prompt:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
}

.btn-raw-md {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-raw-md:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Layout Grid */
.docs-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    display: grid;
    grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr);
    gap: 40px;
    align-items: flex-start;
}

/* Sticky Sidebar */
.docs-sidebar {
    position: sticky;
    top: 140px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding-right: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

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

.docs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.docs-nav-group {
    margin-bottom: 24px;
}

.docs-group-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0 12px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.docs-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 3px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.docs-nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.docs-nav-link.active {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    font-weight: 600;
}

.nav-badge {
    font-size: 0.6875rem;
    padding: 2px 7px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    font-weight: 600;
}

.docs-nav-link.active .nav-badge {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
}

/* Live Page Content */
.docs-content-area {
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 0;
}

/* Search / Filter Box */
.docs-filter-box {
    margin-bottom: 24px;
    position: relative;
}

.docs-filter-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 16px 10px 42px;
    color: #ffffff;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.docs-filter-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.docs-filter-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

/* Typography & Headings */
.docs-heading {
    color: #f8fafc;
    font-weight: 700;
    position: relative;
    scroll-margin-top: 150px;
}

.docs-h1 {
    font-size: 2.125rem;
    margin-top: 0;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 40%, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.docs-h2 {
    font-size: 1.5rem;
    margin-top: 44px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: -0.01em;
}

.docs-h3 {
    font-size: 1.2rem;
    margin-top: 32px;
    margin-bottom: 12px;
    color: #e2e8f0;
}

.heading-anchor {
    position: absolute;
    left: -24px;
    color: #6366f1;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.15s;
    font-weight: 400;
}

.docs-heading:hover .heading-anchor {
    opacity: 1;
}

.docs-paragraph {
    color: #cbd5e1;
    line-height: 1.75;
    margin-bottom: 18px;
    font-size: 0.95rem;
}

.docs-divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 36px 0;
}

.docs-link {
    color: #818cf8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.docs-link:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

.docs-inline-code {
    background: rgba(255, 255, 255, 0.08);
    color: #e0e7ff;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Lists */
.docs-list, .docs-list-ordered {
    color: #cbd5e1;
    line-height: 1.7;
    padding-left: 24px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.docs-list li, .docs-list-ordered li {
    margin-bottom: 6px;
}

/* Blockquotes */
.docs-blockquote {
    margin: 20px 0;
    padding: 14px 20px;
    border-left: 4px solid #6366f1;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 0 8px 8px 0;
    color: #cbd5e1;
    font-style: italic;
}

/* GitHub Style Alerts */
.docs-alert {
    border-radius: 10px;
    padding: 16px 20px;
    margin: 24px 0;
    border: 1px solid transparent;
    font-size: 0.925rem;
}

.docs-alert-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 700;
}

.docs-alert-note {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
    color: #bfdbfe;
}
.docs-alert-note .docs-alert-title { color: #60a5fa; }

.docs-alert-tip {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: #a7f3d0;
}
.docs-alert-tip .docs-alert-title { color: #34d399; }

.docs-alert-important {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.25);
    color: #ddd6fe;
}
.docs-alert-important .docs-alert-title { color: #a78bfa; }

.docs-alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fde68a;
}
.docs-alert-warning .docs-alert-title { color: #fbbf24; }

.docs-alert-caution {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: #fecaca;
}
.docs-alert-caution .docs-alert-title { color: #f87171; }

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.4);
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.docs-table th {
    background: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
    padding: 12px 16px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.docs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    vertical-align: top;
    line-height: 1.6;
}

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

.docs-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Fenced Code Blocks */
.code-block-wrapper {
    margin: 22px 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-block-lang {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.code-copy-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.code-copy-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.code-block-wrapper pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.code-block-wrapper code {
    font-family: inherit;
}

/* Toast Alert */
.docs-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.docs-toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Modal for AI Integration Prompt */
.ai-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ai-modal-backdrop.show {
    display: flex;
}

.ai-modal-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    max-width: 650px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ai-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.ai-modal-close:hover {
    color: #ffffff;
}

.ai-modal-body {
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.ai-modal-body p {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-top: 0;
    margin-bottom: 16px;
}

.ai-prompt-textarea {
    width: 100%;
    height: 220px;
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: #cbd5e1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    resize: none;
    outline: none;
}

.ai-modal-footer {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Responsive */
@media (max-width: 1024px) {
    .docs-wrapper {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .docs-sidebar {
        position: static;
        max-height: none;
        padding-right: 0;
        background: rgba(15, 23, 42, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.07);
        border-radius: 12px;
        padding: 16px;
    }
    .docs-content-area {
        padding: 24px;
    }
}

/* Documentation Inactive / Maintenance Notice Alert */
.docs-alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 28px;
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    border-top: 1px solid rgba(245, 158, 11, 0.2);
    border-right: 1px solid rgba(245, 158, 11, 0.2);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.docs-alert-warning {
    border-left-color: #f59e0b;
}

.docs-alert-private {
    border-left-color: #818cf8;
    background: rgba(99, 102, 241, 0.08);
    border-top: 1px solid rgba(99, 102, 241, 0.25);
    border-right: 1px solid rgba(99, 102, 241, 0.25);
    border-bottom: 1px solid rgba(99, 102, 241, 0.25);
}

.docs-alert-private .docs-alert-title {
    color: #a5b4fc;
}

.docs-alert-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fbbf24;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.docs-alert-body {
    color: #cbd5e1;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Sidebar Sub-page Navigation Item */
.docs-nav-link.docs-nav-sublink {
    padding-left: 28px;
    font-size: 0.8125rem;
    color: #94a3b8;
    position: relative;
}

.docs-nav-link.docs-nav-sublink::before {
    content: "↳";
    position: absolute;
    left: 14px;
    color: #64748b;
    font-size: 0.75rem;
}

.docs-nav-link.docs-nav-sublink:hover {
    color: #f1f5f9;
}

.docs-nav-link.docs-nav-sublink.active {
    color: #818cf8;
}

/* Dynamic Overview Table Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-maintenance {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-beta {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.docs-table-link {
    color: #818cf8;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.docs-table-link:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

