@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lexend Light', 'Lexend', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.4;
    background-color: white;
    /* background-color: #f8f9fa; */
}

/* Bold elements use Lexend SemiBold */
h1, h2, h3, h4, h5, h6,
strong, b,
.section-title,
.subsection h3,
.data-table th,
.copy-btn,
.language,
.section-title:after,
.subsection li:before {
    font-family: 'Lexend SemiBold', 'Lexend', sans-serif;
    font-weight: 600;
}

header {
    background: white;
    color: #1285ac;
    padding: 1em 1.25em; /* 16px 20px scaled to em */
    border-bottom: 3px solid #1285ac;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 0px;
}

.header-content h1 {
    font-size: 32px;
    font-weight: bold;
    flex: 1 1 auto;
    min-width: 300px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.download-btn,
.download-btn-syside {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 300;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.download-btn {
    background: #1285ac;
}

.download-btn-syside {
    background: #0197cd;
}

.download-btn:hover {
    background: #0f6b87;
    /* transform: translateY(-1px); */
    box-shadow: 0 4px 8px rgba(18, 133, 172, 0.3);
}

.download-btn svg {
    flex-shrink: 0;
}

.syside-logo-header {
    background: transparent;
}

.syside-logo-header img {
    height: 5em;
    max-height: 80px;
    background: transparent !important;
    object-fit: contain;
}

.top-level-content {
    max-width: 1400px;
    margin: 1.25em auto; /* 20px scaled to em */
    padding: 0 1.25em; /* 0 20px scaled to em */
}

.diagram-container {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.diagram {
    max-width: 70%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section.sysml-v2-overview .diagram {
    border-radius: 0;
    box-shadow: none;
}

.structure .section-title {
    background: #e3f2fd;
    color: white;
    border-bottom-color: #1976d2;
}

.structure .section-title:hover {
    background: #bbdefb;
}

.search-container {
    max-width: 400px;
}

#searchBox {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    outline: none;
}

.cheatsheet-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1em; /* 16px scaled to em */
    padding: 1.25em; /* 20px scaled to em */
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    min-width: 0;
}

.section {
    background: transparent;
    border-radius: 8px;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
    overflow: auto;
    /* transition: transform 0.2s ease; */
    position: relative;
}

.column-bracket {
    position: absolute;
    left: -0.625em; /* -10px scaled to em units */
    z-index: 10;
    pointer-events: none;
    width: 0.9375em; /* 15px scaled to em units */
    /* Height set by JavaScript */
}

/* Vertical line of bracket */
.column-bracket::after {
    content: '';
    position: absolute;
    left: 0.3125em; /* 5px scaled to em */
    top: 0;
    width: 0.1875em; /* 3px scaled to em */
    height: 100%;
    background-color: var(--bracket-color);
    border-radius: 0 2px 2px 0;
}

/* Top horizontal line */
.column-bracket::before {
    content: '';
    position: absolute;
    left: 0.3125em; /* 5px scaled to em */
    top: 0;
    width: 0.625em; /* 10px scaled to em */
    height: 0.1875em; /* 3px scaled to em */
    background-color: var(--bracket-color);
    /* border-radius: 2px 2px 0 0; */
    z-index: 11;
    /* Add bottom horizontal line using box-shadow */
    /* box-shadow: 0 calc(100% - 3px) 0 0 var(--bracket-color); */
}

/* Bottom horizontal line */
.column-bracket .bottom-line {
    position: absolute;
    left: 0.3125em; /* 5px scaled to em */
    bottom: 0;
    width: 0.625em; /* 10px scaled to em */
    height: 0.1875em; /* 3px scaled to em */
    background-color: var(--bracket-color);
    z-index: 11;
}

.section.sysml-v2-overview {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

/* .section:hover {
    transform: translateY(0px);
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); */
/* } */

.section.sysml-v2-overview:hover {
    transform: none;
    box-shadow: none;
}

.section-title {
    background: transparent;
    color: #1285ac;
    padding: 0px 15px;
    font-size: 24px;
    font-weight: bold;
    /* border-bottom: 2px solid #1285ac; */
    margin: 0;
    position: relative;
    user-select: text;
}

.section-title:hover {
    background: #ffffff43;
}

/* All section titles use the same color scheme */

.content {
    padding: 15px 15px 0px 15px;
}

.content.image-only {
    padding: 0;
}

.subsection {
    margin-bottom: 15px;
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection h3 {
    font-size: 16px;
    font-weight: bold;
    color: black;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: #f2f2f2;
    /* border-left: 3px solid #1285ac; */
    border-radius: 3px;
}

.subsection ul {
    list-style: none;
    padding-left: 10px;
}

.subsection li {
    margin-bottom: 3px;
    position: relative;
}

.subsection li:before {
    content: "•";
    color: #1285ac;
    font-weight: bold;
    position: absolute;
    left: -10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    margin-bottom: 10px;
}

.data-table th {
    background: #f0f0f0;
    padding: 10px 12px;
    font-weight: bold;
    border-bottom: 2px solid #ddd;
    font-size: 16px;
    color: #333;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    line-height: 1;
}

/* Hardcoded table alignments */
.keywords--shorthand-notation .data-table th:first-child,
.keywords--shorthand-notation .data-table td:first-child {
    text-align: right !important;
}

.constructs--expressions .data-table th:first-child,
.constructs--expressions .data-table td:first-child {
    text-align: right !important;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table code {
    background: transparent;
    padding: 2px 4px;
    border-radius: 2px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #1285ac;
    font-weight: bold;
}

.code-example {
    background: #f8f9fa;
    /* border: 1px solid #e9ecef; */
    border-radius: 4px;
    position: relative;
    font-family: "Courier New", monospace;
    font-size: 16px;
    line-height: 1.4;
}

.copy-btn {
    position: absolute;
    top: 0.25em; /* 4px scaled to em */
    right: 0.25em; /* 4px scaled to em */
    background: rgba(255, 255, 255, 0);
    color: #666;
    border: 1px solid rgba(0, 0, 0, 0);
    padding: 0px 0.25em; /* 4px scaled to em */
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    z-index: 1;
}

.copy-btn:hover {
    background: #f2f2f2;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
}

.code-example pre {
    margin: 0;
    padding: 12px;
    padding-top: 6px;
    padding-bottom: 6px;
    overflow-x: auto;
}

.code-example code {
    color: #495057;
    white-space: pre;
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #1285ac;
    padding: 10px 20px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.mobile-nav.visible {
    transform: translateY(0);
}

/* Add padding to body when mobile nav becomes visible */
@media (max-width: 768px) {
    .mobile-nav {
        padding: 10px;
    }
    
    body.mobile-nav-visible {
        padding-top: 3.125em; /* 50px scaled to em */
    }
    
    /* Add scroll margin to sections when mobile nav is visible */
    body.mobile-nav-visible .section {
        scroll-margin-top: 4.375em; /* 70px scaled to em */
    }
}

.section-select {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid #1285ac;
    border-radius: 6px;
    background: white;
    color: #1285ac;
    font-family: 'Lexend Light', 'Lexend', sans-serif;
    font-size: 16px;
    font-weight: 300;
    outline: none;
    transition: all 0.2s ease;
}

.section-select:hover {
    box-shadow: 0 4px 8px rgba(18, 133, 172, 0.3);
}

.section-select option {
    color: #1285ac;
    background: white;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.jump-to-top-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1285ac;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    outline: none;
    transition: all 0.2s ease;
}

.jump-to-top-btn:hover {
    background: #0f6b87;
    box-shadow: 0 4px 8px rgba(18, 133, 172, 0.3);
}

footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 15px 20px;
    margin-top: 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    font-size: 16px;
    color: #666;
}

.disclaimer {
    font-size: 12px;
    line-height: 1.3;
    max-width: 100%;
    /* margin-top: 5px; */
}

.brought-by {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    font-size: 16px;
    color: black;
}


.member-of {
    display: flex;
    align-items: stretch;
    gap: 10px;
    font-size: 16px;
}

.member-of .child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.member-of .child p {
    margin: 0;
    white-space: nowrap;
    font-size: 16px;
}

.brought-by img {
    height: 4em;
    max-width: 20em;
    object-fit: contain;
}

.member-of img {
    height: 4em;
    max-width: 12em;
    object-fit: contain;
}

.brought-by p {
    margin: 0;
    white-space: nowrap;
}


.member-of p {
    margin: 0;
    white-space: nowrap;
}

.section.collapsed .content {
    display: none;
}

/* Collapse toggle button */
.collapse-toggle {
    position: absolute;
    right: 0.9375em; /* 15px scaled to em */
    top: 50%;
    transform: translateY(-50%);
    width: 1.5em; /* 24px scaled to em */
    height: 1.5em; /* 24px scaled to em */
    background: rgba(248, 248, 248, 0.8);
    border: 0.5px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s ease;
    user-select: none;
}

.collapse-toggle:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.collapse-toggle:before {
    content: "−";
}

.section.collapsed .collapse-toggle:before {
    content: "+";
}

.section-notes {
    font-size: 12px;
    color: #777;
    font-style: italic;
    margin-top: 8px;
    text-align: right;
    line-height: 1.2;
}

/* .highlight {
    background-color: transparent !important;
    animation: highlightFade 2s ease-out;
} */

.custom-column {
    padding: 0;
}

.logo-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 15px;
}

.divider {
  width: 2px;
  background: #ccc;
  align-self: stretch;
}


@keyframes highlightFade {
    0% { background-color: #ffeb3b; }
    100% { background-color: transparent; }
}


/* Show/hide based on screen size */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 1200px) {
    .cheatsheet-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .desktop-only {
        display: block;
    }
    
    .mobile-only {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    body, html {
        overflow-x: auto;
        width: 100%;
    }
    
    .cheatsheet-container {
        grid-template-columns: 1fr;
        padding: 0.625em; /* 10px scaled to em */
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    header {
        padding: 0.625em; /* 10px scaled to em */
    }
    
    .top-level-content {
        padding: 0 0.625em; /* 0 10px scaled to em */
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    .desktop-only {
        display: none; /* Hide middle custom column in 1-column mode */
    }
    
    .mobile-only {
        display: block; /* Show end custom column in 1-column mode */
        margin-top: 0; /* Remove extra top margin */
    }
    
    .mobile-only .logo-box {
        padding-top: 0; /* Reduce top padding to match normal sections */
    }
    
    /* Mobile adjustments for header */
    .header-content h1 {
        font-size: 1em;
        text-align: center;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        line-height: 1.2;
    }

    .header-content {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5em;
        margin-bottom: 0px;
    }
    
    .syside-logo-header img {
        height: 2.5em;
        max-height: 2.5em;
    }
    
    /* Mobile button adjustments */
    .download-btn,
    .download-btn-syside {
        font-size: clamp(0.75rem, 2vw, 0.875rem);
        padding: 0.375em 0.5em;
        flex-shrink: 1;
    }
    
    /* Reduce fonts on mobile */
    .data-table,
    .data-table code,
    .footer-content,
    .subsection h3 {
        font-size: 0.875em;
    }

    .section-title  {
        font-size: 1.25em;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.375em 0.25em;
        word-wrap: break-word;
        max-width: 0;
    }
    
    /* Make code blocks wrap */
    .code-example pre {
        white-space: pre-wrap;
        word-wrap: break-word;
        font-size: 0.875em;
    }
    
    .code-example code {
        white-space: pre-wrap;
        word-break: break-word;
    }
    
    /* Ensure diagrams fit */
    .diagram {
        max-width: 100%;
        width: 100%;
    }
}