/* ==========================================================================
   Sixty Deuce Design - Documentation Site Styles
   BEM Naming Convention
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
    /* Colors */
    --docs-primary: #1e4fb9;
    --docs-primary-dark: #153985;
    --docs-primary-light: #2159d1;
    --docs-secondary: #64748b;
    --docs-accent: #f59e0b;
    
    /* Backgrounds */
    --docs-bg-body: #f8fafc;
    --docs-bg-sidebar: #ffffff;
    --docs-bg-header: #1e293b;
    --docs-bg-card: #ffffff;
    --docs-bg-hover: #f1f5f9;
    
    /* Text */
    --docs-text-primary: #1e293b;
    --docs-text-secondary: #64748b;
    --docs-text-muted: #94a3b8;
    --docs-text-inverse: #ffffff;
    
    /* Borders */
    --docs-border-color: #e2e8f0;
    --docs-border-radius: 8px;
    --docs-border-radius-lg: 12px;
    
    /* Shadows */
    --docs-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --docs-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --docs-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --docs-header-height: 64px;
    --docs-sidebar-width: 280px;
    
    /* Transitions */
    --docs-transition: 0.2s ease;
}

/* --------------------------------------------------------------------------
   Base Styles
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.docs {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--docs-bg-body);
    color: var(--docs-text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Header Block
   -------------------------------------------------------------------------- */
.docs__header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--docs-header-height);
    background-color: var(--docs-bg-header);
    z-index: 1000;
    box-shadow: var(--docs-shadow-md);
}

.docs__header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.5rem;
    max-width: 1920px;
    margin: 0 auto;
}

/* Logo */
.docs__logo {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.docs__logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--docs-text-inverse);
}

.docs__logo-accent {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--docs-accent);
}

/* Search */
.docs__search {
    position: relative;
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
}

.docs__search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--docs-text-muted);
    font-size: 1.25rem;
    pointer-events: none;
}

.docs__search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid transparent;
    border-radius: var(--docs-border-radius);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--docs-text-inverse);
    font-size: 0.875rem;
    font-family: inherit;
    transition: var(--docs-transition);
}

.docs__search-input::placeholder {
    color: var(--docs-text-muted);
}

.docs__search-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--docs-primary-light);
}

/* Search Results Dropdown */
.docs__search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background-color: var(--docs-bg-card);
    border-radius: var(--docs-border-radius);
    box-shadow: var(--docs-shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

.docs__search-results--active {
    display: block;
}

.docs__search-result {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--docs-text-primary);
    border-bottom: 1px solid var(--docs-border-color);
    transition: var(--docs-transition);
}

.docs__search-result:last-child {
    border-bottom: none;
}

.docs__search-result:hover,
.docs__search-result--active {
    background-color: var(--docs-bg-hover);
}

.docs__search-result-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.docs__search-result-category {
    font-size: 0.75rem;
    color: var(--docs-text-muted);
}

.docs__search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--docs-text-muted);
    font-size: 0.875rem;
}

/* Menu Toggle (Mobile) */
.docs__menu-toggle {
    display: none;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--docs-text-inverse);
    cursor: pointer;
    border-radius: var(--docs-border-radius);
    transition: var(--docs-transition);
}

.docs__menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   Layout Block
   -------------------------------------------------------------------------- */
.docs__layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--docs-header-height);
}

/* --------------------------------------------------------------------------
   Sidebar Block
   -------------------------------------------------------------------------- */
.docs__sidebar {
    position: fixed;
    top: var(--docs-header-height);
    left: 0;
    bottom: 0;
    width: var(--docs-sidebar-width);
    background-color: var(--docs-bg-sidebar);
    border-right: 1px solid var(--docs-border-color);
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--docs-transition);
}

/* Nav */
.docs__nav {
    padding: 1.5rem 0;
}

.docs__nav-section {
    margin-bottom: 1.5rem;
}

.docs__nav-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--docs-text-muted);
    margin: 0;
}

.docs__nav-title .material-symbols-outlined {
    font-size: 1.125rem;
}

.docs__nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs__nav-list--quick {
    background-color: var(--docs-bg-hover);
    border-radius: 0;
    margin: 0.5rem 0;
    padding: 0.5rem 0;
}

.docs__nav-item {
    margin: 0;
}

.docs__nav-link {
    display: block;
    padding: 0.5rem 1.5rem 0.5rem 3rem;
    color: var(--docs-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--docs-transition);
    border-left: 3px solid transparent;
}

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

.docs__nav-link--active {
    color: var(--docs-primary);
    background-color: rgba(37, 99, 235, 0.08);
    border-left-color: var(--docs-primary);
}

/* --------------------------------------------------------------------------
   Main Content Block
   -------------------------------------------------------------------------- */
.docs__main {
    flex: 1;
    margin-left: var(--docs-sidebar-width);
    min-height: calc(100vh - var(--docs-header-height));
}

.docs__content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Welcome Section */
.docs__welcome {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
}

.docs__welcome-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--docs-text-primary);
    margin: 0 0 0.5rem;
}

.docs__welcome-subtitle {
    font-size: 1.25rem;
    color: var(--docs-primary);
    font-weight: 600;
    margin: 0 0 1rem;
}

.docs__welcome-description {
    font-size: 1rem;
    color: var(--docs-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Category Cards */
.docs__categories {
    margin-bottom: 2rem;
}

.docs__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.docs__category-card {
    background-color: var(--docs-bg-card);
    border-radius: var(--docs-border-radius-lg);
    box-shadow: var(--docs-shadow-sm);
    border: 1px solid var(--docs-border-color);
    transition: var(--docs-transition);
    overflow: hidden;
}

.docs__category-card:hover {
    box-shadow: var(--docs-shadow-md);
    border-color: var(--docs-primary-light);
}

.docs__category-card--expanded {
    border-color: var(--docs-primary);
}

.docs__category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: var(--docs-transition);
}

.docs__category-header:hover {
    background-color: var(--docs-bg-hover);
}

.docs__category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--docs-primary);
    border-radius: var(--docs-border-radius);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.docs__category-info {
    flex: 1;
    min-width: 0;
}

.docs__category-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--docs-text-primary);
    margin: 0 0 0.25rem;
}

.docs__category-desc {
    font-size: 0.8125rem;
    color: var(--docs-text-secondary);
    margin: 0;
    line-height: 1.4;
}

.docs__category-toggle {
    color: var(--docs-text-muted);
    font-size: 1.5rem;
    transition: transform var(--docs-transition);
    flex-shrink: 0;
}

.docs__category-card--expanded .docs__category-toggle {
    transform: rotate(180deg);
    color: var(--docs-primary);
}

/* Category Documents List */
.docs__category-docs {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: var(--docs-bg-hover);
    border-top: 1px solid transparent;
}

.docs__category-card--expanded .docs__category-docs {
    max-height: 500px;
    border-top-color: var(--docs-border-color);
}

.docs__category-docs li {
    border-bottom: 1px solid var(--docs-border-color);
}

.docs__category-docs li:last-child {
    border-bottom: none;
}

.docs__category-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem 0.75rem 4.5rem;
    color: var(--docs-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--docs-transition);
}

.docs__category-link::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--docs-border-color);
    border-radius: 50%;
    margin-right: 0.75rem;
    transition: var(--docs-transition);
}

.docs__category-link:hover {
    color: var(--docs-primary);
    background-color: rgba(37, 99, 235, 0.05);
}

.docs__category-link:hover::before {
    background-color: var(--docs-primary);
}

/* Document Display */
.docs__document {
    background-color: var(--docs-bg-card);
    border-radius: var(--docs-border-radius-lg);
    box-shadow: var(--docs-shadow-sm);
    border: 1px solid var(--docs-border-color);
    overflow: hidden;
}

.docs__document[hidden] {
    display: none;
}

.docs__document-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: var(--docs-bg-hover);
    border-bottom: 1px solid var(--docs-border-color);
}

.docs__back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--docs-border-color);
    border-radius: var(--docs-border-radius);
    background-color: var(--docs-bg-card);
    color: var(--docs-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--docs-transition);
}

.docs__back-btn:hover {
    color: var(--docs-primary);
    border-color: var(--docs-primary);
}

.docs__back-btn .material-symbols-outlined {
    font-size: 1.125rem;
}

.docs__document-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--docs-text-primary);
    margin: 0;
}

.docs__document-body {
    padding: 2rem;
    line-height: 1.8;
}

/* Markdown Content Styles */
.docs__document-body h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--docs-text-primary);
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--docs-border-color);
}

.docs__document-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--docs-text-primary);
    margin: 2rem 0 1rem;
}

.docs__document-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--docs-text-primary);
    margin: 1.5rem 0 0.75rem;
}

.docs__document-body h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--docs-text-secondary);
    margin: 1.25rem 0 0.5rem;
}

.docs__document-body p {
    margin: 0 0 1rem;
}

.docs__document-body ul,
.docs__document-body ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.docs__document-body li {
    margin-bottom: 0.5rem;
}

.docs__document-body strong {
    font-weight: 700;
    color: var(--docs-text-primary);
}

.docs__document-body code {
    background-color: var(--docs-bg-hover);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: 'Consolas', 'Monaco', monospace;
}

.docs__document-body pre {
    background-color: var(--docs-bg-header);
    color: var(--docs-text-inverse);
    padding: 1rem;
    border-radius: var(--docs-border-radius);
    overflow-x: auto;
    margin: 0 0 1rem;
}

.docs__document-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.docs__document-body blockquote {
    border-left: 4px solid var(--docs-primary);
    margin: 0 0 1rem;
    padding: 0.5rem 0 0.5rem 1rem;
    background-color: rgba(37, 99, 235, 0.05);
    border-radius: 0 var(--docs-border-radius) var(--docs-border-radius) 0;
}

.docs__document-body blockquote p:last-child {
    margin-bottom: 0;
}

.docs__document-body hr {
    border: none;
    height: 1px;
    background-color: var(--docs-border-color);
    margin: 2rem 0;
}

.docs__document-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1rem;
}

.docs__document-body th,
.docs__document-body td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--docs-border-color);
}

.docs__document-body th {
    background-color: var(--docs-bg-hover);
    font-weight: 600;
}

.docs__document-body a {
    color: var(--docs-primary);
    text-decoration: none;
}

.docs__document-body a:hover {
    text-decoration: underline;
}

/* Loading State */
.docs__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--docs-text-muted);
}

.docs__loading-spinner {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Error State */
.docs__error {
    text-align: center;
    padding: 3rem;
    color: var(--docs-text-muted);
}

.docs__error-icon {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Responsive Styles
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .docs__sidebar {
        transform: translateX(-100%);
    }

    .docs__sidebar--open {
        transform: translateX(0);
    }

    .docs__main {
        margin-left: 0;
    }

    .docs__menu-toggle {
        display: flex;
    }

    .docs__search {
        margin: 0 1rem;
    }
}

@media (max-width: 768px) {
    :root {
        --docs-header-height: 56px;
    }

    .docs__logo-text {
        font-size: 1rem;
    }

    .docs__logo-accent {
        display: none;
    }

    .docs__search {
        margin: 0 0.75rem;
    }

    .docs__search-input {
        padding: 0.625rem 1rem 0.625rem 2.5rem;
        font-size: 0.8125rem;
    }

    .docs__search-icon {
        left: 0.75rem;
        font-size: 1.125rem;
    }

    .docs__content {
        padding: 1rem;
    }

    .docs__welcome {
        padding: 2rem 1rem;
    }

    .docs__welcome-title {
        font-size: 1.75rem;
    }

    .docs__welcome-subtitle {
        font-size: 1rem;
    }

    .docs__category-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .docs__document-body {
        padding: 1rem;
    }

    .docs__document-body h1 {
        font-size: 1.5rem;
    }

    .docs__document-body h2 {
        font-size: 1.25rem;
    }
}

/* Sidebar Overlay for Mobile */
.docs__sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--docs-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.docs__sidebar-overlay--active {
    display: block;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.docs__visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
