/* Self-hosted IBM Plex Sans (WOFF2) */
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-Thin.woff2") format("woff2"); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-ThinItalic.woff2") format("woff2"); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-ExtraLight.woff2") format("woff2"); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-ExtraLightItalic.woff2") format("woff2"); font-weight: 200; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-LightItalic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-Text.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-TextItalic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-MediumItalic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-SemiBoldItalic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("./IBMPlexSans-BoldItalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
    --uf-blue: #002657;
    --uf-orange: #ff4616;
    --uf-white: #ffffff;
    --uf-bg-gray: #f4f4f9;
    --text-dark: #333;
    --text-light: #666;
    --sidebar-width: 280px;
}

body {
    font-family: "IBM Plex Sans", Helvetica, Arial, sans-serif;
    background-color: var(--uf-bg-gray);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

.uf-header {
    background-color: var(--uf-blue);
    color: var(--uf-white);
    padding: 0;
    display: flex;
    align-items: center;
    height: 60px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.uf-logo-container {
    height: 100%;
    padding: 0 20px 0 0;
    display: flex;
    align-items: center;
}

.uf-logo-img {
    height: 100%;
    width: auto;
    display: block;
}

.uf-header-title {
    font-weight: 600;
    font-size: 18px;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 20px;
}

.main-container {
    max-width: 1400px;
    margin: 30px auto;
    display: flex;
    gap: 40px;
    padding: 0 20px;
}

.sidebar {
    flex: 0 0 var(--sidebar-width);
    background: var(--uf-white);
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: fit-content;
    max-height: 80vh;
    overflow-y: auto;
}

.sidebar h3 {
    color: var(--uf-blue);
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--uf-orange);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

ul.tree-list, ul.tree-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.tree-list ul {
    padding-left: 15px;
    display: none;
    border-left: 1px solid #eee;
}

li.open > ul { display: block; }

.tree-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    align-items: center;
    color: var(--uf-blue);
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    text-align: left;
    font-family: "IBM Plex Sans", sans-serif;
    border-radius: 2px;
}

.tree-btn:focus {
    outline: 2px solid var(--uf-orange);
    outline-offset: 2px;
}

.tree-btn:hover {
    color: var(--uf-blue);
    background-color: #f0f4f8;
}

.tree-btn.active-filter {
    font-weight: 700;
    color: var(--uf-blue);
    border-left: 3px solid var(--uf-orange);
    padding-left: 8px;
    background-color: #f0f4f8;
}

.arrow {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    transition: transform 0.2s;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    color: #999;
}

.tree-btn.has-children .arrow::before { content: "▶"; }
li.open > .tree-btn.has-children .arrow { transform: rotate(90deg); }

.content-area { flex: 1; }

.search-container { margin-bottom: 25px; }
.search-wrapper { position: relative; width: 100%; }

#searchInput {
    width: 100%;
    padding: 15px;
    padding-right: 40px;
    font-size: 16px;
    font-family: "IBM Plex Sans", sans-serif;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#searchInput:focus {
    outline: none;
    border-color: var(--uf-blue);
    box-shadow: 0 0 5px rgba(0,38,87,0.2);
}

#clearSearchBtn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    display: none;
    padding: 5px;
}

#clearSearchBtn:hover { color: var(--uf-orange); }

#activeFilterDisplay {
    margin-bottom: 15px;
    color: var(--uf-blue);
    font-weight: 600;
    display: none;
    background: var(--uf-white);
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid var(--uf-orange);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.result-card {
    background: var(--uf-white);
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-top: 3px solid var(--uf-orange);
}

.result-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--uf-blue);
}

.result-title a { color: inherit; text-decoration: none; }
.result-title a:hover { text-decoration: underline; }

.result-snippet {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 15px;
}

mark {
    background-color: #fff4e6;
    color: var(--uf-blue);
    font-weight: 700;
    padding: 0 2px;
    border-radius: 2px;
}

.location-dropdown {
    margin-top: auto;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.location-dropdown summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--uf-blue);
    list-style: none;
}

.location-dropdown summary:focus {
    outline: 2px solid var(--uf-orange);
    border-radius: 2px;
}

.location-dropdown summary::-webkit-details-marker { display: none; }

.location-dropdown summary::after {
    content: " ▼";
    font-size: 10px;
    color: var(--uf-orange);
}

.location-dropdown[open] summary::after { content: " ▲"; }

.location-list {
    margin-top: 5px;
    padding-left: 0;
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}

.location-list li {
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px dotted #eee;
}

.location-list a {
    color: var(--text-light);
    text-decoration: none;
    display: block;
}

.location-list a:hover {
    color: var(--uf-blue);
    text-decoration: underline;
}

#loadingState { color: var(--text-light); font-style: italic; }
#errorState { color: #cc0000; background: #ffe6e6; padding: 15px; border-radius: 4px; display: none; }

.welcome-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.welcome-message h2 {
    color: var(--uf-blue);
    margin-bottom: 15px;
}