/* Custom CSS for HFortix documentation */

/* ============================================================================
   Fortinet Brand Colors
   ============================================================================ */
:root {
    /* Fortinet primary colors */
    --fortinet-red: #E8002C;
    --fortinet-dark-blue: #2C3E50;
    --fortinet-light-gray: #F5F5F5;
    
    /* Override PyData theme colors */
    --pst-color-primary: var(--fortinet-red);
    --pst-color-secondary: var(--fortinet-dark-blue);
    --pst-color-link: var(--fortinet-red);
    --pst-color-link-hover: #B80023;  /* Darker red on hover */
}

/* Dark mode adjustments */
html[data-theme="dark"] {
    --pst-color-link: #FF4D6D;  /* Lighter red for dark mode */
    --pst-color-link-hover: #FF6B85;
}

/* ============================================================================
   Code Blocks
   ============================================================================ */
.highlight {
    border-radius: 4px;
    margin: 1em 0;
    border-left: 3px solid var(--pst-color-primary);  /* Red accent */
}

/* Inline code */
code.literal {
    background-color: var(--fortinet-light-gray);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

html[data-theme="dark"] code.literal {
    background-color: rgba(232, 0, 44, 0.1);  /* Subtle red tint in dark mode */
}

/* ============================================================================
   Tables
   ============================================================================ */
table.docutils {
    border: none;
    border-collapse: collapse;
}

table.docutils td, table.docutils th {
    border: 1px solid var(--pst-color-border);
    padding: 0.5rem;
}

table.docutils thead th {
    background-color: var(--fortinet-light-gray);
    font-weight: 600;
}

html[data-theme="dark"] table.docutils thead th {
    background-color: rgba(232, 0, 44, 0.15);
}

/* ============================================================================
   Admonitions
   ============================================================================ */
.admonition {
    margin: 1.5em 0;
    border-radius: 4px;
}

.admonition.note {
    border-left: 3px solid #2196F3;
}

.admonition.warning {
    border-left: 3px solid var(--fortinet-red);
}

.admonition.tip {
    border-left: 3px solid #4CAF50;
}

/* ============================================================================
   API Documentation
   ============================================================================ */
/* Make API documentation headers stand out */
dl.class > dt, dl.function > dt, dl.method > dt {
    background-color: var(--pst-color-surface);
    padding: 0.5rem;
    border-left: 3px solid var(--pst-color-primary);
    border-radius: 3px;
}

/* Better spacing for parameter lists */
dl.field-list {
    margin-top: 1em;
}

dl.field-list > dt {
    font-weight: 600;
    color: var(--pst-color-primary);
}

/* ============================================================================
   Sidebar and Navigation
   ============================================================================ */
/* Make the sidebar toc more compact */
.bd-sidebar-secondary .toc-entry {
    padding: 0.25rem 0;
}

/* Highlight current page in sidebar */
.bd-sidebar .active {
    color: var(--pst-color-primary);
    font-weight: 600;
}

/* ============================================================================
   Version Badges
   ============================================================================ */
.versionadded, .versionchanged, .deprecated {
    font-size: 0.9em;
    font-style: italic;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    margin: 0.5rem 0;
    display: inline-block;
}

.versionadded {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
}

.deprecated {
    background-color: rgba(232, 0, 44, 0.1);
    border-left: 3px solid var(--fortinet-red);
}

/* ============================================================================
   Grid and Cards (sphinx-design)
   ============================================================================ */
.sd-card {
    border-radius: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.sd-card-header.bg-success {
    background-color: #4CAF50 !important;
}

/* ============================================================================
   Copy Button (sphinx-copybutton)
   ============================================================================ */
button.copybtn {
    background-color: var(--pst-color-primary);
    opacity: 0.7;
}

button.copybtn:hover {
    opacity: 1;
}

/* ============================================================================
   Search
   ============================================================================ */
.bd-search .icon {
    color: var(--pst-color-primary);
}

/* ============================================================================
   Accessibility Improvements
   ============================================================================ */
/* Focus indicators for keyboard navigation */
a:focus, button:focus, input:focus {
    outline: 2px solid var(--pst-color-primary);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--pst-color-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}
