/**
 * Polanger VideoHub Documentation Styles
 * 100% Mobile Responsive
 */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #e50914;
    --primary-hover: #c40812;
    --bg: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-code: #1e1e1e;
    --text: #1a1a2e;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border: #e9ecef;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #ffffff;
    --sidebar-text-muted: rgba(255, 255, 255, 0.6);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: var(--primary);
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
    --danger: #dc3545;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: 0.2s ease;
    --sidebar-width: 280px;
    --header-height: 60px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    background: var(--sidebar-bg);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: var(--shadow-lg);
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
}

.version {
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--sidebar-text-muted);
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    padding: 12px 24px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sidebar-text-muted);
}

.nav-link {
    display: block;
    padding: 10px 24px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--sidebar-hover);
}

.nav-link.active {
    background: var(--sidebar-hover);
    border-left-color: var(--primary);
    color: var(--primary);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 40px;
}

/* Top CTA — purchase & developer docs */
.doc-top-cta {
    margin-bottom: 40px;
}

.doc-cta-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
    justify-content: center;
    padding: 20px 20px 18px;
    background: linear-gradient(145deg, #f8f9fb 0%, #eef1f5 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.doc-cta-btn {
    flex: 1 1 260px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none !important;
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.doc-cta-btn .doc-cta-btn-label {
    flex: 1;
}

.doc-cta-icon {
    flex-shrink: 0;
    opacity: 0.95;
}

.doc-cta-external {
    flex-shrink: 0;
    opacity: 0.85;
}

.doc-cta-btn-primary {
    background: var(--primary);
    color: #fff !important;
    border: 2px solid var(--primary);
    box-shadow: 0 2px 8px rgba(229, 9, 20, 0.25);
}

.doc-cta-btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(229, 9, 20, 0.35);
}

.doc-cta-btn-secondary {
    background: #fff;
    color: var(--text) !important;
    border: 2px solid var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.doc-cta-btn-secondary:hover {
    border-color: #1a1a2e;
    color: var(--text) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.doc-cta-hint {
    margin: 12px 0 0;
    padding: 0 4px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
    line-height: 1.2;
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 48px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text);
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 32px 0 16px;
    color: var(--text);
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text);
}

p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Lists */
ul, ol {
    margin: 0 0 24px 24px;
    color: var(--text-secondary);
}

li {
    margin-bottom: 8px;
}

li strong {
    color: var(--text);
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Code */
code {
    font-family: 'Fira Code', monospace;
    font-size: 0.875em;
    padding: 2px 6px;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--primary);
}

pre {
    margin: 0;
    padding: 0;
}

pre code {
    display: block;
    padding: 16px 20px;
    background: var(--bg-code);
    color: #e0e0e0;
    border-radius: 0 0 var(--radius) var(--radius);
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}

.code-block {
    margin: 20px 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.code-header {
    padding: 10px 16px;
    background: #2d2d2d;
    color: #999;
    font-size: 12px;
    font-weight: 500;
}

/* Tables */
.docs-table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    font-size: 14px;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    overflow: hidden;
}

.docs-table th,
.docs-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.docs-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text);
}

.docs-table tr:last-child td {
    border-bottom: none;
}

.docs-table tr:hover td {
    background: var(--bg-secondary);
}

/* Info Boxes */
.info-box,
.warning-box,
.success-box {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    margin: 24px 0;
    border-radius: var(--radius);
    border-left: 4px solid;
}

.info-box {
    background: rgba(23, 162, 184, 0.1);
    border-color: var(--info);
}

.warning-box {
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--warning);
}

.success-box {
    background: rgba(40, 167, 69, 0.1);
    border-color: var(--success);
}

.info-box-icon,
.warning-box-icon,
.success-box-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.info-box-content strong,
.warning-box-content strong,
.success-box-content strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

.info-box-content p,
.warning-box-content p,
.success-box-content p {
    margin: 0;
    font-size: 14px;
}

/* Step by Step Guide */
.step-by-step {
    margin: 24px 0;
}

.step {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.step:last-child {
    border-bottom: none;
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--text);
}

.step-content p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* FAQ */
.faq-item {
    margin: 24px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.faq-item h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.faq-item p {
    margin: 0;
    font-size: 14px;
}

/* Changelog */
.changelog-item {
    margin: 24px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.changelog-item h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.changelog-date {
    display: inline-block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.changelog-item ul {
    margin: 12px 0 0 20px;
}

/* Sections */
.doc-section {
    padding-bottom: 32px;
}

.doc-section:first-child h1 {
    margin-top: 0;
}

.doc-section:first-child h2:first-of-type {
    margin-top: 32px;
}

/* Footer */
.docs-footer {
    margin-top: 64px;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.docs-footer a {
    color: var(--text-secondary);
}

.docs-footer p {
    margin: 8px 0;
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Mobile Responsive */
@media screen and (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }

    .content-wrapper {
        padding: 40px 32px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 80px 24px 40px;
    }

    .doc-cta-inner {
        flex-direction: column;
        padding: 16px;
    }

    .doc-cta-btn {
        flex: 1 1 auto;
        width: 100%;
        min-height: 48px;
        font-size: 14px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.35rem;
        margin-top: 40px;
    }

    h3 {
        font-size: 1.15rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    .docs-table {
        display: block;
        overflow-x: auto;
    }

    .info-box,
    .warning-box,
    .success-box {
        flex-direction: column;
        gap: 12px;
    }

    pre code {
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .content-wrapper {
        padding: 72px 16px 32px;
    }

    .doc-top-cta {
        margin-bottom: 28px;
    }

    .doc-cta-inner {
        padding: 14px 12px;
        gap: 10px;
        border-radius: 10px;
    }

    .doc-cta-btn {
        padding: 12px 14px;
        border-radius: 9px;
    }

    .doc-cta-hint {
        font-size: 11px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .lead {
        font-size: 1rem;
    }

    ul, ol {
        margin-left: 16px;
    }

    .docs-table th,
    .docs-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .faq-item,
    .changelog-item {
        padding: 16px;
    }

    .code-block {
        margin: 16px -16px;
        border-radius: 0;
    }

    pre code {
        font-size: 12px;
        padding: 14px 16px;
    }
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Print Styles */
@media print {
    .sidebar,
    .mobile-menu-toggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .doc-top-cta {
        break-inside: avoid;
    }

    .doc-cta-btn {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }

    .content-wrapper {
        max-width: 100%;
        padding: 20px;
    }

    .code-block {
        break-inside: avoid;
    }

    a {
        color: var(--text);
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 12px;
        color: var(--text-muted);
    }
}
