/* ===================================================================
   Yarana Smart Home — Docs Pages Layout & Component Styles
   Variables align with /assets/css/style.css
   =================================================================== */

/* ── Docs page layout ──────────────────────────────────────────────── */
.docs-layout {
    min-height: calc(100vh - 70px);
    padding-top: 70px;
}

.docs-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* ── Docs Typography ───────────────────────────────────────────────── */
.docs-content h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 12px;
    color: var(--c-text);
}

.docs-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 40px 0 14px;
    color: var(--c-text);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--c-border);
}

.docs-content h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 28px 0 10px;
    color: var(--c-green);
}

.docs-content h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 20px 0 8px;
    color: var(--c-text-2);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.docs-content p {
    color: var(--c-text-2);
    margin-bottom: 14px;
    line-height: 1.75;
    font-size: 15px;
}

.docs-content ul,
.docs-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.docs-content li {
    color: var(--c-text-2);
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.6;
}

.docs-content ol li {
    list-style: decimal;
}

.docs-content ul li {
    list-style: disc;
}

/* ── Code & Pre ────────────────────────────────────────────────────── */
.docs-content pre {
    background: var(--c-bg-3);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 18px 20px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.6;
}

.docs-content code {
    font-family: 'SF Mono', Menlo, Monaco, 'Courier New', monospace;
    font-size: 13px;
    color: var(--c-green);
    background: rgba(16, 185, 129, .1);
    padding: 2px 7px;
    border-radius: 5px;
}

.docs-content pre code {
    background: transparent;
    padding: 0;
    color: var(--c-text);
    font-size: 13px;
}

/* ── API Doc Cards ─────────────────────────────────────────────────── */
.api-doc-card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.api-doc-card:hover {
    border-color: var(--c-green);
    box-shadow: 0 6px 24px var(--c-shadow);
    transform: translateY(-2px);
}

.api-doc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.api-method {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'SF Mono', monospace;
    text-transform: uppercase;
    flex-shrink: 0;
}

.method-get    { background: rgba(14, 165, 233, .15); color: #0ea5e9; }
.method-post   { background: rgba(16, 185, 129, .15); color: #10b981; }
.method-put    { background: rgba(245, 158, 11, .15);  color: #d97706; }
.method-delete { background: rgba(239, 68, 68, .15);   color: #dc2626; }
.method-patch  { background: rgba(168, 85, 247, .15);  color: #9333ea; }

.api-endpoint {
    font-family: 'SF Mono', Menlo, Monaco, monospace;
    font-size: 13px;
    color: var(--c-text-2);
    background: var(--c-bg-3);
    padding: 4px 10px;
    border-radius: 6px;
    word-break: break-all;
}

.api-doc-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--c-text);
}

.api-doc-card h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text-3);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 16px 0 8px;
}

.api-auth {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--c-border);
    font-size: 13px;
    color: var(--c-text-3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}

.auth-pill.none  { background: rgba(16,185,129,.12); color: var(--c-green); }
.auth-pill.user  { background: rgba(14,165,233,.12); color: var(--c-blue); }
.auth-pill.admin { background: rgba(251,191,36,.12); color: #d97706; }

/* ── Library Doc Cards ─────────────────────────────────────────────── */
.library-doc-card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.library-doc-card:hover {
    border-color: var(--c-green);
    box-shadow: 0 6px 24px var(--c-shadow);
}

.library-doc-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--c-green);
    display: flex;
    align-items: center;
    gap: 8px;
}

.library-doc-card h4::before {
    content: '#';
    color: var(--c-text-3);
    font-weight: 400;
}

/* ── Section group label ───────────────────────────────────────────── */
.docs-section-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16,185,129,.1);
    color: var(--c-green);
    border: 1px solid rgba(16,185,129,.2);
    border-radius: 50px;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 32px 0 16px;
}

/* ── Docs alert/info box ───────────────────────────────────────────── */
.docs-alert {
    background: rgba(14,165,233,.08);
    border: 1px solid rgba(14,165,233,.2);
    border-left: 3px solid var(--c-blue);
    border-radius: 10px;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 14px;
    color: var(--c-text-2);
}

.docs-alert.warn {
    background: rgba(251,191,36,.08);
    border-color: rgba(251,191,36,.2);
    border-left-color: #d97706;
}

/* ── Docs header breadcrumb ────────────────────────────────────────── */
.docs-hero {
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 40px;
}

.docs-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-text-3);
    font-size: 13px;
    margin-bottom: 10px;
    text-decoration: none;
    transition: color .2s;
}

.docs-hero-label:hover {
    color: var(--c-green);
    text-decoration: none;
}

.docs-hero h1 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 8px;
}

.docs-hero p {
    font-size: 16px;
    color: var(--c-text-2);
    margin-bottom: 0;
}

/* ── Docs nav back button ──────────────────────────────────────────── */
.btn-header-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--c-green), var(--c-blue));
    color: #fff;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}

.btn-header-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16,185,129,.35);
    text-decoration: none;
    color: #fff;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
    color: var(--c-text);
}

.logo-text .logo-accent {
    color: var(--c-green);
}

/* ── Theme toggle in docs ──────────────────────────────────────────── */
.docs-theme-btn {
    background: none;
    border: 1.5px solid var(--c-border);
    color: var(--c-text-2);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 16px;
    cursor: pointer;
    transition: all .2s;
}

.docs-theme-btn:hover {
    border-color: var(--c-green);
    color: var(--c-green);
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .docs-content {
        padding: 28px 16px 60px;
    }

    .docs-content h1 {
        font-size: 26px;
    }

    .docs-content h2 {
        font-size: 19px;
    }

    .api-doc-header {
        flex-wrap: wrap;
    }

    .api-endpoint {
        word-break: break-all;
        font-size: 11px;
    }
}
