@font-face {
    font-family: "bootstrap-icons";
    src: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/fonts/bootstrap-icons.woff2") format("woff2"),
         url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/fonts/bootstrap-icons.woff") format("woff");
    font-display: block;
}

/* Fallback for icons before font is ready */
.bi::before { display: inline-block; }
.bi.bi-list::before { background: url('/img/icons/list.svg') no-repeat center / contain; width: 1em; height: 1em; content: ''; }
.bi.bi-journal-text::before { background: url('/img/icons/journal-text.svg') no-repeat center / contain; width: 1em; height: 1em; content: ''; }
.bi.bi-gear::before { background: url('/img/icons/gear.svg') no-repeat center / contain; width: 0.9em; height: 0.9em; content: ''; opacity: 0.4; }
.bi.bi-box-arrow-right::before { background: url('/img/icons/box-arrow-right.svg') no-repeat center / contain; width: 1em; height: 1em; content: ''; }

main > .container {
    padding: 70px 15px 20px;
}

.footer {
    background-color: #f5f5f5;
    font-size: .9em;
    height: 60px;
}

.footer > .container {
    padding-right: 15px;
    padding-left: 15px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
    padding-top: 7px;
    color: rgba(255, 255, 255, 0.5);
}

@media(max-width:767px) {
    .nav li > form > button.logout {
        display:block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }
}

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
}

.nav > li > form > button.logout:focus {
    outline: none;
}

.form-group {
    margin-bottom: 1rem;
}

/* Login page glassmorphism */
.login-page-bg {
    position: relative;
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 10% 20%, rgba(255,0,128,0.15), transparent 60%),
                radial-gradient(1000px 800px at 90% 10%, rgba(0,200,255,0.15), transparent 60%),
                radial-gradient(800px 800px at 30% 80%, rgba(0,255,170,0.12), transparent 60%),
                linear-gradient(180deg, #0f0f12 0%, #15161a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
}

.login-blobs::before, .login-blobs::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.25;
    z-index: 0;
}
.login-blobs::before {
    background: #ff2a6d;
    top: -150px;
    left: -150px;
}
.login-blobs::after {
    background: #00e0ff;
    bottom: -200px;
    right: -100px;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 0;
}

.glass {
    padding: 24px;
    color: #e6e6e6;
}

.login-brand {
    font-weight: 700;
    font-size: 28px;
    text-align: center;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
    color: #fff;
}

.login-form .form-label {
    color: #cfcfcf;
}

.login-input {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
}
.login-input::placeholder {
    color: rgba(255,255,255,0.6);
}
.login-input:focus {
    background: rgba(255,255,255,0.12);
    border-color: rgba(0,224,255,0.6);
    box-shadow: none;
}

.login-submit {
    background: rgba(0,0,0,0.8);
    color: #fff;
    border: 1px solid rgba(0,0,0,0.8);
    transition: background-color .15s ease, border-color .15s ease;
    padding: 12px;
}
.login-submit:hover,
.login-submit:active {
    background: rgba(0,0,0,1);
    border-color: rgba(0,0,0,1);
    color: #fff;
}
.btn.login-submit:focus,
.btn.login-submit:focus-visible,
.btn.login-submit:active,
.login-submit:focus {
    outline: none;
    box-shadow: none;
}

@media (max-width: 576px) {
    .login-page-bg {
        padding: 12px;
    }
    .glass {
        border-radius: 12px;
        padding: 20px;
    }
}

/* Prevent rubber-band and layout shift on scroll extremes */
html, body {
    height: 100%;
    overscroll-behavior: none;
    scrollbar-gutter: stable both-edges;
    overflow-x: hidden;
    min-width: 930px;
}

/* Also disable overscroll within full-screen sections */
.login-page-bg, #main {
    overscroll-behavior: none;
}

/* Floating labels - dark theme tweaks and hover raise */
.form-floating > .form-control, .form-floating > .form-control:focus {
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
}

.login-form .form-control, .login-form .form-control:focus {
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 12px;
}

.login-form .form-control:focus { border-color: rgba(0,224,255,0.6); box-shadow: none; }
.login-form .form-control::placeholder { color: rgba(255,255,255,0.6); }
.form-floating > label {
    color: rgba(255,255,255,0.7);
}
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.7rem) translateX(0.15rem);
    opacity: 0.95;
    background-color: transparent;
    padding: 0 .25rem;
    border: none;
    z-index: 2;
}
/* Floating label cut-out via pseudo-element */
.form-floating > label {
    position: absolute;
    pointer-events: none;
}
.form-floating > label::before {
    content: '';
    position: absolute;
    left: -0.35rem;
    right: -0.35rem;
    top: 50%;
    height: 0.9rem;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.06);
    z-index: -1;
    border-radius: .25rem;
    display: none;
}
.form-floating > .form-control:focus ~ label::before,
.form-floating > .form-control:not(:placeholder-shown) ~ label::before {
    display: block;
}
.form-floating > .form-control::placeholder { opacity: 0; }
.form-floating > .form-control:focus { border-color: rgba(0,224,255,0.6); }

/* Force transparent background and light text on browser autofill */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px transparent inset;
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
    transition: background-color 9999s ease-in-out 0s;
}

/* Sidebar layout */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 96px;
    background: #fff;
    color: #000;
    border-right: 1px solid #e5e7eb; /* тонкая серая линия */
    padding: 16px 12px;
    z-index: 1020;
}
.sidebar-brand {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 16px;
    padding: 4px 8px;
    text-align: center;
}
.sidebar-logo {
    display: inline-block;
    max-width: 56px;
    width: 56px;
    height: auto;
}
.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar-item {
    margin-bottom: 8px;
}
.sidebar-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    color: #111;
    text-decoration: none;
    border-radius: 8px;
    font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.sidebar-link i {
    font-size: 24px; /* чуть крупнее, визуально жирнее */
    color: #111;
    text-shadow: 0 0 1px rgba(0,0,0,0.25); /* лёгкое утолщение */
}
.sidebar-link span {
    font-size: 12px; /* подпись под иконкой */
}
.sidebar-item.active .sidebar-link,
.sidebar-link:hover {
    background: #f3f4f6;
}
/* Logout link lighter text */
.sidebar-footer .sidebar-link {
    color: rgba(17, 17, 17, 0.6);
}
.sidebar-footer .sidebar-link i {
    color: rgba(17, 17, 17, 0.6);
}
.sidebar-footer .sidebar-link:hover {
    color: #111;
}
.sidebar-footer .sidebar-link:hover i {
    color: #111;
}
.sidebar-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    padding: 0 12px;
}

/* Main offset when sidebar visible */
#main.with-sidebar > .container {
    padding-top: 20px;
}
#main.with-sidebar {
    margin-left: 96px; /* отступ от сайдбара */
}

@media (max-width: 992px) {
    .sidebar {
        width: 96px;
    }
    #main.with-sidebar {
        margin-left: 96px;
    }
}

/* Skills list */
.skills-header h1 {
    font-size: 24px;
    font-weight: 700;
}
.new-skill-btn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    color: rgba(0,0,0,0.7);
    text-decoration: none;
    border: 1px solid transparent;
}
.new-skill-btn:hover {
    background: #f3f4f6;
    color: #111;
}
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.skill-card {
    display: block;
    width: 100%;
    border: 1px solid #e5e7eb; /* светло-серая рамка */
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: background-color .15s ease;
}
.skill-card:hover {
    background: #f9fafb; /* лёгкое изменение фона */
}
.skill-card-title { font-size: 16px; }
.skill-card-sub { font-size: 13px; }

/* Feed layout: left lists fixed, right pane scrolls */
.site-feed .row { height: calc(100vh - 140px); }
.site-feed .col-3 {
    overflow: auto;
    padding: 10px;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}
.site-feed .col-9 {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
#feedList { flex: 1 1 auto; overflow: auto; }

/* Left lists like Slack: single line with ellipsis, no borders */
.site-feed .col-3 .list-group-item {
    border: none;
    background: transparent;
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.site-feed .col-3 .list-group-item:hover {
    background: rgba(255,255,255,0.25);
}

/* Feed items as separate cards */
#feedList .list-group-item {
    border: 0px solid #e5e7eb !important;
    border-radius: 10px;
    margin-bottom: 12x;
    margin-top: 12px;

}

.list-group {
    margin-bottom: 24px !important;
}

#feedList .list-group-item + .list-group-item { border-top: 1px solid #e5e7eb; }

/* New feed grid with independent scrolls and no gap next to sidebar */
 .feed-grid {
     display: grid;
     grid-template-columns: 280px 1fr; /* меню-ленты слева, контент справа */
     gap: 0px;
     height: 100%;
     min-height: 0; /* позволяет внутренним областям скроллиться */
     margin-left: -15px; /* сдвиг к сайдбару, убираем зазор контейнера */
 }
 .feed-left {
    overflow: auto;
    padding: 24px 22px 10px 22px;
    background: #f3f4f6;
    border: none;
}
.feed-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border: none;
    border-radius: 10px;
    padding: 0;
    overflow: hidden; /* не скроллим контейнер, скролл только у #feedList */
}
.feed-content #feedList {
    overflow: auto;
}

/* Tighten main to sidebar; remove extra top padding inside container */
#main.with-sidebar {
    margin-left: 96px;
}
#main.with-sidebar > .container {
    padding-top: 12px;
}
#main.with-sidebar > .container-fluid {
    padding-top: 0px;
    height: calc(100vh - 0px);
    overflow: hidden;
    padding-right: 0px;
}

/* List styling inside new left column */
.feed-left .list-group-item {
    border: none;
    background: transparent;
    padding: 6px 0px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
}
.feed-left .list-group-item:hover {
    background: rgba(0, 0, 0, 0);
}
/* Active state override for left menu */
.feed-left .list-group-item-action.active,
.feed-left .list-group-item-action.active:focus,
.feed-left .list-group-item-action.active:hover,
.feed-left .list-group-item.active,
.feed-left .list-group-item.active:focus,
.feed-left .list-group-item.active:hover {
    background: transparent !important;
    color: #000 !important;
    border-color: transparent !important;
}

/* Sticky header inside feed-content */
.feed-content > .mb-3 {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    padding: 24px 12px 24px 24px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0 !important;
}
.feed-content #feedList {
    padding: 12px 24px;
}
.feed-content nav {
    padding: 0 12px 12px 12px;
}

/* Thin scrollbars (WebKit) */
.feed-left::-webkit-scrollbar, .feed-content #feedList::-webkit-scrollbar {
    width: 8px;
}
.feed-left::-webkit-scrollbar-track, .feed-content #feedList::-webkit-scrollbar-track {
    background: transparent;
}
.feed-left::-webkit-scrollbar-thumb, .feed-content #feedList::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

/* Firefox */
.feed-left, .feed-content #feedList {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.3) transparent;
}

/* Ensure feed page layout fills available height and only inner panes scroll */
.site-feed {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.site-feed > h1 {
    flex: 0 0 auto;
}
.site-feed .feed-grid {
    flex: 1 1 auto;
}

/* Feed add button: icon-only gray plus, turns black on hover */
.feed-left .feed-add-btn {
    border: none;
    background: transparent;
    padding: 4px;
    margin: 0;
    color: #9aa0a6; /* серый */
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color .2s ease;
}
.feed-left .feed-add-btn i {
    font-size: 1rem;
    transition: color .2s ease;
}
.feed-left .feed-add-btn:hover,
.feed-left .feed-add-btn:focus {
    color: #000;
    outline: none;
    box-shadow: none;
}

/* Smooth hover transitions for list items */
.feed-left .list-group-item {
    transition: background-color .2s ease, color .2s ease;
}
.site-feed .col-3 .list-group-item {
    transition: background-color .2s ease, color .2s ease;
}
#feedList .list-group-item {
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

/* Gray underlined link for "show all" */
.feed-left .feed-link {
    display: inline-block;
    color: #6b7280; /* серый */
    text-decoration: underline;
    background: transparent;
    border: none;
    padding: 4px 0;
    transition: color .2s ease;
}
.feed-left .feed-link:hover,
.feed-left .feed-link:focus {
    color: #000;
    text-decoration: underline;
    outline: none;
}

.media-wrap { position: relative; display: inline-block; overflow: hidden; }
.media-wrap .media-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.1); opacity: 1; transition: opacity .3s ease-in-out; pointer-events: none; }
.media-wrap.ready .media-overlay { opacity: 0; }
.media-wrap .media-spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; display: none; }
.media-wrap:not(.ready) .media-spinner { display: block; }
.media-wrap img, .media-wrap video { display: block; opacity: 0; transition: opacity .3s ease-in-out; }
.media-wrap.ready img, .media-wrap.ready video { opacity: 1; }