/* Custom styles for Skillplan Security Assessment Documentation */

/* ========================================
   Color Variables - Blue Theme
   ======================================== */
:root {
    --sp-blue-dark: #1a365d;
    --sp-blue-primary: #2563eb;
    --sp-blue-light: #3b82f6;
    --sp-blue-lighter: #60a5fa;
    --sp-blue-bg: #eff6ff;
    --sp-white: #ffffff;
    --sp-gray-light: #f8fafc;
    --sp-gray: #64748b;
}

/* ========================================
   Custom Header
   ======================================== */
.skillplan-header {
    background: linear-gradient(135deg, var(--sp-blue-dark) 0%, var(--sp-blue-primary) 100%);
    color: var(--sp-white);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.skillplan-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.skillplan-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skillplan-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--sp-white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--sp-blue-primary);
    font-size: 18px;
}

.skillplan-logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.skillplan-header-title {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.9;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 15px;
    margin-left: 5px;
}

.skillplan-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.skillplan-header-email {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--sp-white);
    text-decoration: none;
    font-size: 0.875rem;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.skillplan-header-email:hover {
    opacity: 1;
    text-decoration: underline;
}

.skillplan-header-email svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Adjust main content for fixed header */
body {
    padding-top: 65px !important;
}

.wy-nav-side {
    top: 65px !important;
    height: calc(100% - 65px) !important;
}

.wy-nav-content-wrap {
    margin-top: 0;
}

/* ========================================
   Custom Footer
   ======================================== */
.skillplan-footer {
    background: linear-gradient(135deg, var(--sp-blue-dark) 0%, var(--sp-blue-primary) 100%);
    color: var(--sp-white);
    padding: 20px 30px;
    text-align: center;
    font-size: 0.875rem;
    margin-top: 40px;
}

.skillplan-footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.skillplan-footer-company {
    font-weight: 500;
}

.skillplan-footer-address {
    opacity: 0.85;
}

.skillplan-footer-link {
    color: var(--sp-blue-lighter);
    text-decoration: none;
    transition: color 0.2s;
}

.skillplan-footer-link:hover {
    color: var(--sp-white);
    text-decoration: underline;
}

/* ========================================
   Table Styling - Blue Theme
   ======================================== */

/* Table container for horizontal scroll on overflow */
.wy-table-responsive {
    overflow-x: auto;
    margin: 1em 0;
    width: 100%;
}

table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    margin: 1em 0;
    table-layout: auto;
}

table th,
table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}

table th {
    background-color: var(--sp-blue-dark);
    color: white;
    font-weight: bold;
}

table td:first-child,
table th:first-child {
    font-weight: 500;
}

table tr:nth-child(even) {
    background-color: var(--sp-blue-bg);
}

table tr:hover {
    background-color: #dbeafe;
}

/* Scrollbar styling for tables */
.wy-table-responsive::-webkit-scrollbar {
    height: 10px;
}

.wy-table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.wy-table-responsive::-webkit-scrollbar-thumb {
    background: var(--sp-blue-light);
    border-radius: 4px;
}

.wy-table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--sp-blue-primary);
}

/* ========================================
   Code Block Improvements
   ======================================== */
pre {
    background-color: #1e293b;
    border-radius: 4px;
    padding: 1em;
    overflow-x: auto;
    position: relative;
    border-left: 3px solid var(--sp-blue-primary);
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* Inline code styling */
p code,
li code,
td code {
    background-color: var(--sp-blue-bg);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #bfdbfe;
    color: var(--sp-blue-dark);
}

/* ========================================
   Admonition Styling
   ======================================== */
.admonition {
    border-radius: 4px;
    margin: 1em 0;
}

.admonition.warning {
    border-left-color: #f0ad4e;
}

.admonition.note {
    border-left-color: var(--sp-blue-primary);
}

.admonition.tip {
    border-left-color: #5cb85c;
}

.admonition.danger {
    border-left-color: #d9534f;
}

/* ========================================
   Heading Styling
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    scroll-margin-top: 80px;
    color: var(--sp-blue-dark);
}

h1 {
    border-bottom: 2px solid var(--sp-blue-primary);
    padding-bottom: 10px;
}

h2 {
    border-bottom: 1px solid var(--sp-blue-light);
    padding-bottom: 8px;
}

/* ========================================
   Navigation Improvements
   ======================================== */
.wy-nav-content {
    max-width: 1200px;
}

.wy-nav-content-wrap {
    background: #fcfcfc;
}

/* Ensure content area uses available space */
.rst-content {
    max-width: 100%;
}

.wy-side-nav-search {
    background-color: var(--sp-blue-dark) !important;
}

.wy-menu-vertical header,
.wy-menu-vertical p.caption {
    color: var(--sp-blue-primary);
}

.wy-menu-vertical a:hover {
    background-color: var(--sp-blue-bg);
}

/* ========================================
   Copy Button for Code Blocks
   ======================================== */
.copy-button {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 5px 10px;
    background-color: var(--sp-blue-primary);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
}

pre:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    background-color: var(--sp-blue-light);
}

.copy-button.copied {
    background-color: #5cb85c;
}

/* ========================================
   Mermaid Diagram Styling - Professional
   ======================================== */
.mermaid {
    text-align: center;
    margin: 2em 0;
    padding: 1.5em;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.mermaid svg {
    max-width: 100%;
    height: auto;
}

/* Improve node styling */
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node ellipse,
.mermaid .node polygon,
.mermaid .node path {
    stroke-width: 2px;
}

/* Subgraph/cluster styling */
.mermaid .cluster rect {
    rx: 8px;
    ry: 8px;
}

/* Edge labels */
.mermaid .edgeLabel {
    background-color: white;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Sequence diagram enhancements */
.mermaid .actor {
    stroke-width: 2px;
}

.mermaid .messageText {
    font-size: 13px;
}

/* Add subtle animation on hover */
.mermaid:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

/* ========================================
   Links - Blue Theme
   ======================================== */
a {
    color: var(--sp-blue-primary);
}

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

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .skillplan-header {
        padding: 10px 15px;
    }

    .skillplan-header-title {
        display: none;
    }

    .skillplan-logo-text {
        font-size: 1rem;
    }

    body {
        padding-top: 55px !important;
    }

    .wy-nav-side {
        top: 55px !important;
        height: calc(100% - 55px) !important;
    }
}

/* ========================================
   PDF Save Button - Styled like Next button
   ======================================== */
.pdf-button-container {
    float: right;
    margin: 0 0 20px 20px;
}

.pdf-save-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #f3f4f6;
    color: #404040;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.pdf-save-button:hover {
    background-color: #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.pdf-save-button:active {
    background-color: #d1d5db;
}

.pdf-save-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pdf-save-button svg {
    width: 14px;
    height: 14px;
}

.pdf-spinner {
    animation: spin 1s linear infinite;
}

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

/* Responsive adjustments for PDF button */
@media (max-width: 768px) {
    .pdf-button-container {
        float: none;
        margin: 0 0 15px 0;
    }

    .pdf-save-button {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ========================================
   Hide MkDocs Theme Attribution
   ======================================== */
/* Hide the theme's default footer (not our custom .skillplan-footer) */
footer:not(.skillplan-footer) {
    display: none !important;
}

/* Also hide via role attribute if present */
[role="contentinfo"]:not(.skillplan-footer) {
    display: none !important;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .skillplan-header,
    .skillplan-footer,
    .wy-nav-side,
    .rst-versions,
    .pdf-button-container {
        display: none !important;
    }

    body {
        padding-top: 0 !important;
    }

    .wy-nav-content-wrap {
        margin-left: 0;
    }

    pre {
        white-space: pre-wrap;
        word-wrap: break-word;
    }
}
