/* ============================================================================
   Documentation Styles - Filevue
   ============================================================================ */

:root {
    --primary: #4CAF50;
    --primary-dark: #2E7D32;
    --primary-light: #66BB6A;
    --text-primary: #1d2327;
    --text-secondary: #50575e;
    --text-muted: #8c8f94;
    --border: #e0e0e0;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fdf9;
    --bg-hover: #f5f5f5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius: 8px;
    --sidebar-width: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding-bottom: env(safe-area-inset-bottom);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================================================
   Container
   ============================================================================ */

.docs-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   Header
   ============================================================================ */

.docs-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.docs-header__content {
    max-width: 1600px;
    margin: 0 auto;
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.docs-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.docs-logo svg {
    color: var(--primary);
}

.docs-header__nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.docs-header__nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.docs-header__nav a:hover,
.docs-header__nav a.active {
    color: var(--primary);
}

.docs-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white !important;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.2s;
}

.docs-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.docs-mobile-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.docs-mobile-menu span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ============================================================================
   Layout
   ============================================================================ */

.docs-layout {
    display: flex;
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================================================
   Sidebar
   ============================================================================ */

.docs-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    padding: 24px;
    overflow-y: auto;
    height: calc(100vh - 64px);
    position: sticky;
    top: 64px;
}

.docs-search {
    position: relative;
    margin-bottom: 24px;
}

.docs-search__input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
}

.docs-search__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.docs-search__shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================================================================
   Navigation
   ============================================================================ */

.docs-nav__section {
    margin-bottom: 32px;
}

.docs-nav__title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.docs-nav__list {
    list-style: none;
}

.docs-nav__link {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.docs-nav__link:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.docs-nav__link.active {
    background: var(--bg-secondary);
    color: var(--primary);
    font-weight: 500;
}

/* ============================================================================
   Main Content
   ============================================================================ */

.docs-main {
    flex: 1;
    padding: 40px;
    padding-left: max(40px, env(safe-area-inset-left));
    padding-right: max(40px, env(safe-area-inset-right));
    overflow-y: auto;
}

.docs-content {
    max-width: 800px;
}

.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.docs-breadcrumb a {
    color: var(--text-muted);
}

.docs-breadcrumb a:hover {
    color: var(--primary);
}

.docs-breadcrumb::after {
    content: '→';
    margin-left: 8px;
}

.docs-breadcrumb:last-child::after {
    display: none;
}

/* ============================================================================
   Article
   ============================================================================ */

.docs-article h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.docs-article h2 {
    font-size: 32px;
    font-weight: 600;
    margin: 40px 0 16px;
    color: var(--text-primary);
}

.docs-article h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 32px 0 12px;
    color: var(--text-primary);
}

.docs-article h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 8px;
    color: var(--text-primary);
}

.docs-lead {
    font-size: 20px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.docs-article p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

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

.docs-article li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.docs-article code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary-dark);
}

.docs-article pre {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    overflow-x: auto;
    margin: 24px 0;
}

.docs-article pre code {
    background: none;
    padding: 0;
}

/* ============================================================================
   Cards
   ============================================================================ */

.docs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.docs-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.3s;
    display: block;
}

.docs-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.docs-card__icon {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary);
}

.docs-card__icon svg {
    width: 24px;
    height: 24px;
}

.docs-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.docs-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================================================
   Call to Action
   ============================================================================ */

.docs-cta {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    margin: 48px 0;
}

.docs-cta h2 {
    font-size: 28px;
    margin: 0 0 12px 0;
}

.docs-cta p {
    margin: 0 0 24px 0;
}

.docs-cta__actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.docs-btn--primary {
    background: var(--primary);
    color: white !important;
}

.docs-btn--secondary {
    background: transparent;
    color: var(--text-primary) !important;
    border: 1px solid var(--border);
}

.docs-btn--secondary:hover {
    background: var(--bg-hover);
}

/* ============================================================================
   Navigation (Prev/Next)
   ============================================================================ */

.docs-pagination {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 48px 0;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.docs-pagination__link {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.docs-pagination__link:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.docs-pagination__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.docs-pagination__title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.docs-pagination__link--next {
    text-align: right;
}

/* ============================================================================
   Feedback
   ============================================================================ */

.docs-feedback {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin: 48px 0;
}

.docs-feedback__question {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.docs-feedback__buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.docs-feedback__btn {
    padding: 10px 24px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.docs-feedback__btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.docs-feedback__btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================================================
   Footer
   ============================================================================ */

.docs-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 24px;
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.docs-footer__content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.docs-footer__left p {
    font-size: 14px;
    color: var(--text-muted);
}

.docs-footer__right {
    display: flex;
    gap: 24px;
}

.docs-footer__right a {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================================================
   Alert Boxes
   ============================================================================ */

.docs-alert {
    border-radius: var(--radius);
    padding: 16px;
    margin: 24px 0;
    border-left: 4px solid;
}

.docs-alert--info {
    background: #e3f2fd;
    border-color: #2196F3;
    color: #0d47a1;
}

.docs-alert--warning {
    background: #fff3e0;
    border-color: #FF9800;
    color: #e65100;
}

.docs-alert--success {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.docs-alert--danger {
    background: #ffebee;
    border-color: #f44336;
    color: #b71c1c;
}

/* ============================================================================
   Responsive
   ============================================================================ */

@media (max-width: 1024px) {
    .docs-sidebar {
        position: fixed;
        left: -100%;
        top: calc(64px + env(safe-area-inset-top));
        width: 280px;
        height: calc(100vh - 64px - env(safe-area-inset-top));
        transition: left 0.3s;
        z-index: 90;
        box-shadow: var(--shadow-lg);
        padding-left: max(24px, env(safe-area-inset-left));
        padding-right: max(24px, env(safe-area-inset-right));
    }

    .docs-sidebar.open {
        left: 0;
    }

    .docs-main {
        padding: 24px;
    }

    .docs-mobile-menu {
        display: flex;
    }

    .docs-header__nav {
        gap: 16px;
    }

    .docs-header__nav a:not(.docs-btn) {
        display: none;
    }
}

@media (max-width: 768px) {
    .docs-article h1 {
        font-size: 36px;
    }

    .docs-article h2 {
        font-size: 28px;
    }

    .docs-lead {
        font-size: 18px;
    }

    .docs-cards {
        grid-template-columns: 1fr;
    }

    .docs-cta__actions {
        flex-direction: column;
    }

    .docs-pagination {
        flex-direction: column;
    }

    .docs-pagination__link--next {
        text-align: left;
    }

    .docs-footer__content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
