/* Custom styles for Leader-ID Documentation */

/* Custom primary color */
:root {
  --md-primary-fg-color: #2185fb;
  --md-primary-fg-color--light: #4a9dfc;
  --md-primary-fg-color--dark: #1a6bc9;
  --md-accent-fg-color: #2185fb;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #2185fb;
  --md-primary-fg-color--light: #4a9dfc;
  --md-primary-fg-color--dark: #1a6bc9;
  --md-accent-fg-color: #2185fb;
}

img {
    max-width: 100%;
    height: auto;
}

p > img {
    margin: 1rem 0;
}

.admonition {
    margin: 1rem 0;
}

/* Hide "Главная" tab in navigation */
.md-tabs__list > li:first-child {
    display: none;
}

/* Hide breadcrumbs */
.md-path {
    display: none;
}

/* Navigation tabs with overflow dropdown */
.md-tabs,
.md-tabs__inner,
.md-tabs__list {
    overflow: visible !important;
}

.md-tabs__link {
    font-size: 0.7rem;
    padding: 0 0.6rem;
    white-space: nowrap;
}

/* Dropdown container */
.md-tabs__dropdown {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.md-tabs__dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    padding: 0 0.8rem;
    cursor: pointer;
    height: 100%;
    transition: color 0.2s;
}

.md-tabs__dropdown-toggle:hover {
    color: white;
}

.md-tabs__dropdown-toggle svg {
    transition: transform 0.2s;
}

.md-tabs__dropdown--open .md-tabs__dropdown-toggle svg {
    transform: rotate(180deg);
}

/* Dropdown menu */
.md-tabs__dropdown-menu {
    position: fixed;
    min-width: 220px;
    background: var(--md-primary-fg-color);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    display: none;
    z-index: 999999;
}

.md-tabs__dropdown--open .md-tabs__dropdown-menu,
.md-tabs__dropdown-menu--open {
    display: block !important;
}

.md-tabs__dropdown-menu li {
    display: block;
    margin: 0;
    padding: 0;
}

.md-tabs__dropdown-menu a,
.md-tabs__dropdown-link {
    display: block !important;
    padding: 0.6rem 1rem !important;
    color: white !important;
    font-size: 0.8rem !important;
    text-decoration: none !important;
    background: transparent !important;
}

.md-tabs__dropdown-menu a:hover,
.md-tabs__dropdown-link:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.md-tabs__dropdown-link--active {
    font-weight: 600 !important;
}

/* Hide tabs on mobile - use burger menu */
@media screen and (max-width: 960px) {
    .md-tabs {
        display: none;
    }
}

/* Hide right sidebar (table of contents) */
.md-sidebar--secondary {
    display: none !important;
}

/* Section-scoped sidebar navigation */
body.lid-section-nav .md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item:not(.md-nav__item--active) {
    display: none;
}

/* Card styles for index page */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #333;
}

.card h4 a {
    color: inherit;
    text-decoration: none;
}

.card h4 a:hover {
    color: var(--md-primary-fg-color);
}

.card .card-count {
    color: var(--md-primary-fg-color);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 2rem 0 1rem 0;
    color: #333;
}

.section-title:first-child {
    margin-top: 0;
}

/* Dark mode cards */
[data-md-color-scheme="slate"] .card {
    background: var(--md-default-bg-color);
}

[data-md-color-scheme="slate"] .card h4,
[data-md-color-scheme="slate"] .section-title {
    color: var(--md-default-fg-color);
}
