/* ===================================
   Voleres Documentation
   =================================== */

/* --- CSS Custom Properties (shared with landing) --- */
:root {
    --color-primary: #7367f0;
    --color-primary-dark: #584cdb;
    --color-primary-light: #8d82fd;
    --color-primary-rgb: 115, 103, 240;
    --color-secondary: #82868b;
    --color-success: #28c76f;
    --color-danger: #ea5455;
    --color-warning: #ff9f43;
    --color-info: #00cfe8;

    --color-heading: #5e5873;
    --color-text: #6e6b7b;
    --color-text-light: #b9b9c3;
    --color-dark: #161616;

    --color-bg: #ffffff;
    --color-bg-light: #f8f8f8;
    --color-bg-alt: #f3f2ff;
    --color-border: #ebe9f1;

    --gradient: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-dark) 100%);

    --font-family: 'Montserrat', Helvetica, Arial, sans-serif;

    --border-radius: 0.75rem;
    --border-radius-lg: 1rem;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
    --transition: 0.3s ease;

    --nav-height: 60px;
    --sidebar-width: 280px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-heading);
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    background: var(--color-bg-light);
    color: var(--color-danger);
    border: 1px solid var(--color-border);
}

/* ===================================
   Top Navigation
   =================================== */
.docs-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

.docs-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.5rem;
    max-width: 100%;
}

.docs-nav__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.docs-nav__sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--color-heading);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background var(--transition);
}

.docs-nav__sidebar-toggle:hover {
    background: var(--color-bg-light);
}

.docs-nav__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.docs-nav__logo {
    width: 32px;
    height: 32px;
}

.docs-nav__name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-heading);
}

.docs-nav__divider {
    width: 1px;
    height: 24px;
    background: var(--color-border);
}

.docs-nav__section-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-light);
}

.docs-nav__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.docs-nav__search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 2rem;
    background: var(--color-bg-light);
    transition: all var(--transition);
    width: 280px;
}

.docs-nav__search:focus-within {
    border-color: var(--color-primary);
    background: var(--color-bg);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.docs-nav__search svg {
    color: var(--color-text-light);
    flex-shrink: 0;
}

.docs-nav__search input {
    border: none;
    background: none;
    outline: none;
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: var(--color-heading);
    width: 100%;
}

.docs-nav__search input::placeholder {
    color: var(--color-text-light);
}

.docs-nav__back {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all var(--transition);
    white-space: nowrap;
}

.docs-nav__back:hover {
    background: var(--color-bg-light);
    color: var(--color-primary);
}

/* ===================================
   Layout
   =================================== */
.docs-layout {
    display: flex;
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

/* ===================================
   Sidebar
   =================================== */
.docs-sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    background: var(--color-bg);
    border-right: 1px solid var(--color-border);
    padding: 1.5rem 0;
    z-index: 50;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.docs-sidebar__group {
    margin-bottom: 1.5rem;
}

.docs-sidebar__heading {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
}

.docs-sidebar__nav ul {
    list-style: none;
}

.docs-sidebar__link {
    display: block;
    padding: 0.375rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-text);
    transition: all var(--transition);
    border-left: 2px solid transparent;
}

.docs-sidebar__link:hover {
    color: var(--color-primary);
    background: var(--color-bg-light);
}

.docs-sidebar__link--active {
    color: var(--color-primary);
    font-weight: 600;
    background: var(--color-bg-alt);
    border-left-color: var(--color-primary);
}

/* ===================================
   Overlay (mobile)
   =================================== */
.docs-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 45;
}

.docs-overlay--visible {
    display: block;
}

/* ===================================
   Main Content
   =================================== */
.docs-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

.docs-content {
    max-width: 820px;
    margin: 0 auto;
    padding: 2.5rem 3rem 4rem;
}

/* ===================================
   Hero Header
   =================================== */
.docs-hero {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--color-border);
}

.docs-hero__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.docs-hero__subtitle {
    font-size: 1.125rem;
    color: var(--color-text);
    line-height: 1.7;
    max-width: 600px;
}

/* ===================================
   Articles
   =================================== */
.docs-article {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--color-border);
}

.docs-article:last-of-type {
    border-bottom: none;
}

.docs-article h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    padding-top: 0.5rem;
}

.docs-article h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.docs-article p {
    margin-bottom: 1rem;
    line-height: 1.75;
}

.docs-article ul,
.docs-article ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.docs-article li {
    margin-bottom: 0.5rem;
    line-height: 1.65;
}

.docs-article li ul,
.docs-article li ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ===================================
   Tables
   =================================== */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.docs-table thead th {
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--color-border);
    background: var(--color-bg-light);
}

.docs-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.docs-table tbody tr:last-child td {
    border-bottom: none;
}

.docs-table tbody tr:hover {
    background: var(--color-bg-light);
}

.docs-table--compact td {
    padding: 0.5rem 1rem;
}

/* Permissions table */
.docs-table--permissions {
    text-align: center;
}

.docs-table--permissions td:first-child,
.docs-table--permissions th:first-child {
    text-align: left;
}

.docs-table__check {
    color: var(--color-success);
    font-weight: 700;
    font-size: 1.125rem;
}

.docs-table__cross {
    color: var(--color-border);
    font-weight: 400;
    font-size: 1.125rem;
}

/* ===================================
   Badges
   =================================== */
.docs-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25em 0.75em;
    border-radius: 2rem;
    white-space: nowrap;
}

.docs-badge--primary {
    background: rgba(var(--color-primary-rgb), 0.12);
    color: var(--color-primary);
}

.docs-badge--success {
    background: rgba(40, 199, 111, 0.12);
    color: var(--color-success);
}

.docs-badge--warning {
    background: rgba(255, 159, 67, 0.12);
    color: var(--color-warning);
}

.docs-badge--danger {
    background: rgba(234, 84, 85, 0.12);
    color: var(--color-danger);
}

.docs-badge--neutral {
    background: var(--color-bg-light);
    color: var(--color-secondary);
    border: 1px solid var(--color-border);
}

.docs-badge--info {
    background: rgba(0, 207, 232, 0.12);
    color: #00a1b5;
}

/* ===================================
   Callouts
   =================================== */
.docs-callout {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border-left: 3px solid;
}

.docs-callout__icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.docs-callout p {
    margin-bottom: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.docs-callout strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

/* Info callout */
.docs-callout--info {
    background: rgba(var(--color-primary-rgb), 0.06);
    border-color: var(--color-primary);
}

.docs-callout--info .docs-callout__icon {
    color: var(--color-primary);
}

.docs-callout--info strong {
    color: var(--color-primary);
}

/* Tip callout */
.docs-callout--tip {
    background: rgba(40, 199, 111, 0.06);
    border-color: var(--color-success);
}

.docs-callout--tip .docs-callout__icon {
    color: var(--color-success);
}

.docs-callout--tip strong {
    color: var(--color-success);
}

/* Warning callout */
.docs-callout--warning {
    background: rgba(255, 159, 67, 0.06);
    border-color: var(--color-warning);
}

.docs-callout--warning .docs-callout__icon {
    color: var(--color-warning);
}

.docs-callout--warning strong {
    color: var(--color-warning);
}

/* ===================================
   Feature Grid (facility icons)
   =================================== */
.docs-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.docs-feature-item {
    display: flex;
    gap: 0.875rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
}

.docs-feature-item svg {
    color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.docs-feature-item strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--color-heading);
    margin-bottom: 0.125rem;
}

.docs-feature-item p {
    font-size: 0.8125rem;
    margin-bottom: 0;
    color: var(--color-text);
}

/* ===================================
   FAQ
   =================================== */
.docs-faq {
    margin-bottom: 1.5rem;
}

.docs-faq__item {
    margin-bottom: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: var(--color-bg);
    overflow: hidden;
    transition: all var(--transition);
}

.docs-faq__item:hover {
    border-color: rgba(var(--color-primary-rgb), 0.3);
}

.docs-faq__item[open] {
    border-color: var(--color-primary);
    box-shadow: 0 2px 12px rgba(var(--color-primary-rgb), 0.1);
}

.docs-faq__item summary {
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-heading);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color var(--transition);
}

.docs-faq__item summary::-webkit-details-marker {
    display: none;
}

.docs-faq__item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-primary);
    flex-shrink: 0;
    margin-left: 1rem;
}

.docs-faq__item[open] summary::after {
    content: '\2212';
}

.docs-faq__answer {
    padding: 0 1.25rem 1rem;
    font-size: 0.875rem;
    line-height: 1.7;
}

.docs-faq__answer ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

/* ===================================
   Contact Cards
   =================================== */
.docs-contact-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.docs-contact-card {
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}

.docs-contact-card:hover {
    border-color: rgba(var(--color-primary-rgb), 0.2);
    box-shadow: var(--shadow);
}

.docs-contact-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    background: var(--color-bg-alt);
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.docs-contact-card h3 {
    font-size: 1.0625rem;
    margin-bottom: 0.5rem;
}

.docs-contact-card p {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.docs-contact-card a {
    font-weight: 600;
    font-size: 0.9375rem;
}

/* ===================================
   Footer
   =================================== */
.docs-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.docs-footer p {
    margin-bottom: 0.5rem;
}

/* ===================================
   Search Results
   =================================== */
.docs-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}

.docs-search-results--visible {
    display: block;
}

.docs-search-result {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
    text-decoration: none;
}

.docs-search-result:last-child {
    border-bottom: none;
}

.docs-search-result:hover {
    background: var(--color-bg-light);
}

.docs-search-result__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-heading);
    margin-bottom: 0.125rem;
}

.docs-search-result__section {
    font-size: 0.75rem;
    color: var(--color-text-light);
}

.docs-search-no-results {
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* Search highlight */
.docs-highlight {
    background: rgba(255, 159, 67, 0.25);
    border-radius: 2px;
    padding: 0 2px;
}

/* Hidden article (search filter) */
.docs-article--hidden {
    display: none;
}

/* ===================================
   Responsive: Tablet
   =================================== */
@media (max-width: 1100px) {
    .docs-content {
        padding: 2rem;
    }
}

@media (max-width: 1024px) {
    .docs-nav__search {
        width: 220px;
    }
}

/* ===================================
   Responsive: Mobile
   =================================== */
@media (max-width: 768px) {
    .docs-nav__sidebar-toggle {
        display: flex;
    }

    .docs-nav__search {
        width: 160px;
    }

    .docs-nav__divider,
    .docs-nav__section-label {
        display: none;
    }

    .docs-nav__back span {
        display: none;
    }

    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
        box-shadow: none;
        z-index: 50;
    }

    .docs-sidebar--open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .docs-main {
        margin-left: 0;
    }

    .docs-content {
        padding: 1.5rem;
    }

    .docs-hero__title {
        font-size: 1.75rem;
    }

    .docs-article h2 {
        font-size: 1.375rem;
    }

    .docs-article h3 {
        font-size: 1.125rem;
    }

    .docs-feature-grid {
        grid-template-columns: 1fr;
    }

    .docs-contact-cards {
        grid-template-columns: 1fr;
    }

    .docs-table {
        font-size: 0.8125rem;
    }

    .docs-table thead th,
    .docs-table tbody td {
        padding: 0.5rem 0.625rem;
    }

    /* Permissions table horizontal scroll */
    .docs-table--permissions {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .docs-nav__search {
        display: none;
    }

    .docs-hero__title {
        font-size: 1.5rem;
    }

    .docs-content {
        padding: 1.25rem 1rem;
    }
}
