/* Motyw interfejsu w stylu Visual Studio Code (Dark Modern) */

:root {
    --vsc-chrome: #181818;          /* title bar, activity bar, sidebar, status bar */
    --vsc-editor: #1f1f1f;
    --vsc-widget: #252526;
    --vsc-quick-input: #222222;
    --vsc-border: #2b2b2b;
    --vsc-fg: #cccccc;
    --vsc-fg-strong: #ffffff;
    --vsc-fg-muted: #9d9d9d;
    --vsc-fg-inactive: #868686;
    --vsc-accent: #0078d4;
    --vsc-accent-hover: #026ec1;
    --vsc-link: #4daafc;
    --vsc-link-hover: #f48771;
    --vsc-hover: #2a2d2e;
    --vsc-selection: #04395e;
    --vsc-input: #313131;
    --vsc-input-border: #3c3c3c;
    --vsc-error: #f85149;
    --vsc-success: #89d185;
    --vsc-table-border: #454545;
    --vsc-table-header: #2d2d2d;
    --vsc-file-html: #e37933;
    --vsc-font-ui: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", system-ui, "Ubuntu", "Droid Sans", sans-serif;
    --vsc-font-mono: Consolas, "Courier New", monospace;
}

* {
    box-sizing: border-box;
}

a {
    color: inherit;
    text-decoration: none;
}

body {
    margin: 0;
    font-family: var(--vsc-font-ui);
    font-size: 13px;
    background: var(--vsc-editor);
    color: var(--vsc-fg);
}

::selection {
    background: #264f78;
}

/* Paski przewijania jak w edytorze */
* {
    scrollbar-color: rgba(121, 121, 121, 0.4) transparent;
}
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(121, 121, 121, 0.4);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 100, 100, 0.7);
}

:focus-visible {
    outline: 1px solid var(--vsc-accent);
    outline-offset: -1px;
}

/* ---------- Workbench ---------- */

body.workbench {
    display: grid;
    grid-template-rows: 35px minmax(0, 1fr) 22px;
    grid-template-columns: minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.titlebar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vsc-chrome);
    border-bottom: 1px solid var(--vsc-border);
    user-select: none;
}

.titlebar-brand {
    position: absolute;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.titlebar-brand .codicon {
    color: var(--vsc-accent);
}

.command-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: min(38vw, 600px);
    height: 24px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: var(--vsc-fg-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.command-center .codicon {
    font-size: 14px;
}

/* pasek u góry otwiera wyszukiwanie (prawy panel) */
button.command-center {
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

button.command-center:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--vsc-fg);
}

/* ---------- Prawy panel: wyszukiwanie w stylu czatu VS Code (karta, okno wpisywania na dole) ---------- */

/* wysuwanie: rośnie szerokość panelu, karta wjeżdża z prawej i pojawia się; przy zamykaniu odwrotnie */
.auxbar {
    flex: none;
    width: 0;
    min-height: 0;
    overflow: hidden;
    visibility: hidden;
    background: var(--vsc-chrome);
    transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.28s;
}

.auxbar.open {
    width: 348px;
    visibility: visible;
    transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}

.auxbar-card {
    display: flex;
    flex-direction: column;
    width: 336px;
    height: calc(100% - 12px);
    margin: 6px;
    background: var(--vsc-widget);
    border: 1px solid var(--vsc-border);
    border-radius: 8px;
    opacity: 0;
    transform: translateX(28px);
    transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auxbar.open .auxbar-card {
    opacity: 1;
    transform: none;
    transition-delay: 0.04s;
}

.auxbar-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    padding: 0 6px 0 8px;
}

.auxbar-chip {
    padding: 4px 10px;
    background: var(--vsc-input);
    border-radius: 6px;
    color: var(--vsc-fg);
    font-size: 13px;
    user-select: none;
}

.auxbar-spacer {
    flex: 1;
}

.auxbar-action {
    display: flex;
    padding: 4px;
    background: none;
    border: 0;
    border-radius: 4px;
    color: var(--vsc-fg);
    cursor: pointer;
}

.auxbar-action .codicon {
    font-size: 16px;
}

.auxbar-action:hover {
    background: rgba(90, 93, 94, 0.31);
}

.auxbar-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* ekran powitalny (puste pole) */
.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 100%;
    padding: 16px;
    text-align: center;
}

.search-empty[hidden] {
    display: none;
}

.search-empty h2 {
    margin: 0;
    color: var(--vsc-fg);
    font-size: 15px;
    font-weight: 700;
}

.search-empty p {
    margin: 0 0 8px;
    color: var(--vsc-fg-muted);
    font-size: 13px;
}

.search-suggestion {
    width: 100%;
    max-width: 300px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--vsc-input-border);
    border-radius: 4px;
    color: var(--vsc-fg);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.search-suggestion:hover {
    background: var(--vsc-hover);
}

/* wyniki */
.search-results {
    padding: 4px 0 8px;
}

.search-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 22px;
    margin-top: 4px;
    padding: 0 10px 0 12px;
    color: var(--vsc-fg);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.search-count {
    min-width: 18px;
    padding: 0 6px;
    background: #616161;
    border-radius: 11px;
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    line-height: 18px;
    text-align: center;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    margin: 0 4px;
    padding: 0 8px 0 14px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.search-item:hover {
    background: var(--vsc-hover);
}

.search-item.active {
    background: var(--vsc-selection);
    outline: 1px solid var(--vsc-accent);
    outline-offset: -1px;
    color: var(--vsc-fg-strong);
}

.search-item .codicon {
    flex: none;
    font-size: 16px;
}

.search-text {
    display: flex;
    gap: 8px;
    min-width: 0;
}

.search-label,
.search-detail {
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-label {
    flex: none;
    max-width: 100%;
}

.search-detail {
    min-width: 0;
    color: var(--vsc-fg-muted);
    font-size: 12px;
}

.search-label mark {
    background: none;
    color: #2aaaff;
    font-weight: 700;
}

/* okno wpisywania na dole */
.search-composer {
    flex: none;
    margin: 8px;
    padding: 10px 10px 8px;
    background: #2b2b2b;
    border: 1px solid var(--vsc-input-border);
    border-radius: 8px;
    transition: border-color 0.15s;
}

.search-composer:focus-within {
    border-color: var(--vsc-accent);
}

.search-composer input[type="text"],
.search-composer input[type="text"]:focus {
    width: 100%;
    height: 26px;
    padding: 0 2px;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--vsc-fg);
    font-size: 14px;
}

.search-composer input[type="text"]::placeholder {
    color: #989898;
}

.search-composer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.search-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 2px 10px;
    border: 1px solid var(--vsc-input-border);
    border-radius: 999px;
    color: var(--vsc-fg-muted);
    font-size: 12px;
    white-space: nowrap;
}

.search-dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6e7681;
}

.search-dot.ready {
    background: #89d185;
}

.search-send {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: var(--vsc-accent);
    border: 0;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
}

.search-send:hover {
    background: var(--vsc-accent-hover);
}

.search-send:disabled {
    opacity: 0.45;
    cursor: default;
}

/* przełączniki grup wyników */
.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--vsc-input-border);
}

.search-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 4px;
    background: transparent;
    border: 1px solid var(--vsc-input-border);
    border-radius: 999px;
    color: var(--vsc-fg-muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.search-filter .switch {
    position: relative;
    width: 26px;
    height: 14px;
    background: #5a5a5a;
    border-radius: 7px;
    transition: background 0.15s;
}

.search-filter .switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    background: #cccccc;
    border-radius: 50%;
    transition: transform 0.15s;
}

.search-filter[aria-pressed="true"] {
    border-color: var(--filter);
    color: var(--filter);
}

.search-filter[aria-pressed="true"] .switch {
    background: var(--filter);
}

.search-filter[aria-pressed="true"] .switch::after {
    background: #1f1f1f;
    transform: translateX(12px);
}

@media (prefers-reduced-motion: reduce) {
    .auxbar,
    .auxbar.open,
    .auxbar-card,
    .auxbar.open .auxbar-card {
        transition: none;
    }
}

.workbench-body {
    position: relative;
    display: flex;
    min-height: 0;
}

.activitybar {
    flex: none;
    width: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--vsc-chrome);
    border-right: 1px solid var(--vsc-border);
}

.activitybar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--vsc-fg-inactive);
    cursor: pointer;
}

.activitybar-item .codicon {
    font-size: 24px;
}

.activitybar-item:hover,
.activitybar-item.active {
    color: #d7d7d7;
}

.activitybar-item.active {
    box-shadow: inset 2px 0 0 var(--vsc-accent);
}

/* eksplorator chowa się i pokazuje płynnie: zwęża się do zera, a zawartość (stała szerokość) gaśnie */
.sidebar {
    flex: none;
    width: 260px;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--vsc-chrome);
    border-right: 1px solid var(--vsc-border);
    user-select: none;
    transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}

.sidebar > * {
    min-width: 259px;
    transition: opacity 0.2s ease;
}

body.sidebar-hidden .sidebar {
    width: 0;
    border-right-width: 0;
    visibility: hidden;
    transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.28s;
}

body.sidebar-hidden .sidebar > * {
    opacity: 0;
}

/* bez animacji przy pierwszym wczytaniu strony i przy ograniczeniu animacji w systemie */
body.preload .sidebar,
body.preload .sidebar > * {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar > *,
    body.sidebar-hidden .sidebar {
        transition: none;
    }
}

.sidebar-title {
    display: flex;
    align-items: center;
    height: 35px;
    padding: 0 20px;
    font-size: 11px;
    text-transform: uppercase;
}

.sidebar summary {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 22px;
    list-style: none;
    cursor: pointer;
}

.sidebar summary::-webkit-details-marker {
    display: none;
}

.sidebar summary .codicon-chevron-right {
    transition: transform 0.1s;
}

.sidebar details[open] > summary > .codicon-chevron-right {
    transform: rotate(90deg);
}

.tree-section > summary {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Wcięcie wiersza drzewa: --depth ustawiane na wierszu; pliki i foldery jednego poziomu w tej samej kolumnie */
.tree a {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding-left: calc(8px + var(--depth, 0) * 16px);
    padding-right: 8px;
    white-space: nowrap;
}

.tree-folder > summary {
    padding-left: calc(8px + var(--depth, 0) * 16px);
    padding-right: 8px;
}

.tree .page-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree a:hover,
.tree summary:hover {
    background: var(--vsc-hover);
}

.tree a.active,
.tree summary.active {
    background: var(--vsc-selection);
    outline: 1px solid var(--vsc-accent);
    outline-offset: -1px;
    color: var(--vsc-fg-strong);
}

.icon-html {
    color: var(--vsc-file-html);
}

.icon-external,
.icon-section {
    color: var(--vsc-link);
}

/* Fragment treści wskazany w eksploratorze */
.outline-flash {
    animation: outline-flash 1.6s ease-out;
}

/* Wiersz harmonogramu (wynik „Tematy zajęć”): tło wiersza zasłaniają komórki, więc mrugają komórki */
tr.outline-flash {
    animation: none;
}

tr.outline-flash > td {
    animation: row-flash 1.6s ease-out;
}

@keyframes row-flash {
    from {
        background-color: rgba(0, 120, 212, 0.3);
    }
}

@keyframes outline-flash {
    from {
        background-color: rgba(0, 120, 212, 0.3);
        box-shadow: 0 0 0 2px var(--vsc-accent);
    }
    to {
        background-color: transparent;
        box-shadow: 0 0 0 2px transparent;
    }
}

.editor {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--vsc-editor);
}

.tabs {
    flex: none;
    display: flex;
    height: 35px;
    background: var(--vsc-chrome);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.tabs::-webkit-scrollbar {
    height: 3px;
}

/* Linia pod nieaktywnymi kartami; aktywna karta ją przerywa */
.tabs::after {
    content: '';
    flex: 1;
    box-shadow: inset 0 -1px 0 var(--vsc-border);
}

.tab {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px 0 12px;
    background: var(--vsc-chrome);
    border-right: 1px solid var(--vsc-border);
    box-shadow: inset 0 -1px 0 var(--vsc-border);
    color: var(--vsc-fg-muted);
    white-space: nowrap;
}

.tab:hover {
    background: var(--vsc-editor);
}

/* Brak miejsca na pasku: nieaktywne przypięte karty pokazują samą ikonę (jak pinnedTabSizing: compact) */
.tabs.compact-pinned .tab-pinned:not(.active) {
    padding: 0 10px;
}

.tabs.compact-pinned .tab-pinned:not(.active) .page-label,
.tabs.compact-pinned .tab-pinned:not(.active) .tab-action:not(.tab-pin-link) {
    display: none;
}

.tab.active {
    background: var(--vsc-editor);
    box-shadow: inset 0 1px 0 var(--vsc-accent);
    color: var(--vsc-fg-strong);
}

.tab-preview .page-label {
    font-style: italic;
}

.tab .tab-action {
    margin-left: 4px;
    padding: 2px;
    border-radius: 4px;
    font-size: 14px;
    color: var(--vsc-fg-inactive);
}

.tab.active .tab-action {
    color: var(--vsc-fg);
}

.tab .tab-close:hover,
.tab .tab-pin-link:hover {
    background: rgba(90, 93, 94, 0.31);
}

/* Pineska karty Live share: przycisk pokazujący link do sesji */
.tab .tab-pin-link {
    color: var(--vsc-link);
    cursor: pointer;
}

.tab .tab-pin-link:hover {
    color: #74bdff;
}

.breadcrumbs {
    flex: none;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 22px;
    padding: 0 12px;
    color: var(--vsc-fg-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.breadcrumbs .codicon {
    font-size: 14px;
}

.progress-bar {
    position: absolute;
    top: 35px;
    left: 0;
    right: 0;
    height: 2px;
    overflow: hidden;
    pointer-events: none;
}

body.loading .progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    background: var(--vsc-accent);
    animation: progress-slide 1s linear infinite;
}

@keyframes progress-slide {
    from { left: -30%; }
    to { left: 100%; }
}

.editor-content {
    flex: 1;
    overflow: auto;
    font-size: 14px;
    line-height: 1.6;
}


.statusbar {
    display: flex;
    justify-content: space-between;
    background: var(--vsc-chrome);
    border-top: 1px solid var(--vsc-border);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.statusbar-group {
    display: flex;
}

.statusbar-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
}

.statusbar-item .codicon {
    font-size: 14px;
}

a.statusbar-item:hover {
    background: rgba(241, 241, 241, 0.2);
}

.statusbar-remote {
    padding: 0 10px;
    background: var(--vsc-accent);
    color: var(--vsc-fg-strong);
}

/* ---------- Treść edytora ---------- */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem 2rem;
}

.section h1,
.section h2 {
    font-weight: 600;
    line-height: 1.25;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--vsc-border);
}

.section h1 {
    font-size: 1.9em;
}

.section h2 {
    font-size: 1.4em;
    margin-top: 1.5em;
}

.section a:not(.btn) {
    color: var(--vsc-link);
}

/* Link pod kursorem: zmiana koloru zamiast podkreślenia (także w podświetlonym wierszu tabeli) */
.section a:not(.btn):hover,
.section tbody tr:hover a:not(.btn):hover {
    color: var(--vsc-link-hover);
}

.section code,
.section pre {
    font-family: var(--vsc-font-mono);
    background: var(--vsc-input);
    color: #d0d0d0;
    border-radius: 3px;
}

.section code {
    padding: 0.1em 0.3em;
}

.section pre {
    padding: 1em;
    overflow-x: auto;
}

.section iframe {
    max-width: 100%;
}

/* Krótka informacja o danych osobowych przy formularzu (np. Raporty) */
.section .privacy-note {
    margin: 0 0 12px;
    padding: 8px 12px;
    background: var(--vsc-widget);
    border-left: 3px solid var(--vsc-accent);
    border-radius: 2px;
    color: var(--vsc-fg-muted);
    font-size: 13px;
}

.section .privacy-note .codicon {
    margin-right: 4px;
    color: #4daafc;
    vertical-align: text-bottom;
}

/* Strona na cały obszar edytora (data-full-page, np. Edytor kodu): bez nagłówka serwisu i marginesów */
.full-page .container {
    max-width: none;
    padding: 0;
}

.full-page .hero {
    display: none;
}

/* Edytor kodu z AI (edytor.html): ramka = obszar pod kartami i ścieżką (35 + 35 + 22 + 22 px pasków) */
.section .editor-frame {
    display: block;
    width: 100%;
    height: calc(100vh - 114px);
    min-height: 360px;
    border: 0;
    background: var(--vsc-editor);
}

/* Laboratorium / poradnik otwarty w karcie (ramka o wysokości treści) */
.section .document-frame {
    display: block;
    width: 100%;
    min-height: 60vh;
    border: 0;
    background: var(--vsc-editor);
}

/* Kolor trybu studiów: h1 sekcji ma go jako wypełnienie, h2.przedmiot jako ramkę */
h1.niestacjonarne,
h2.przedmiot.niestacjonarne {
    --kolor-trybu: #09591a;
}
h1.stacjonarne,
h2.przedmiot.stacjonarne {
    --kolor-trybu: var(--vsc-selection);
}

h1.niestacjonarne,
h1.stacjonarne {
    padding: 0.3em 0.6em;
    border-bottom: 0;
    border-radius: 4px;
    background: var(--kolor-trybu);
}

/* Nagłówek przedmiotu nad tabelą harmonogramu (bez klasy trybu – neutralna ramka) */
h2.przedmiot {
    text-align: center;
    padding: 0.3em 0.6em;
    border: 2px solid var(--kolor-trybu, var(--vsc-table-border));
    border-radius: 4px;
}

.center {
    text-align: center;
    animation: center-reveal 700ms ease-out both;
}

@keyframes center-reveal {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    60% {
        opacity: 0.7;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 0 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--vsc-border);
}

.hero h1 {
    margin: 0 0 0.25rem;
    color: var(--vsc-fg-strong);
    font-size: 2rem;
    font-weight: 400;
}

.hero p {
    margin: 0 0 1rem;
    color: var(--vsc-fg-muted);
}

/* Mini-edytor z pisanym kodem */
.code-tile {
    flex: none;
    width: 340px;
    max-width: 100%;
    margin-left: auto;
    background: var(--vsc-chrome);
    border: 1px solid var(--vsc-border);
    border-radius: 6px;
    overflow: hidden;
    user-select: none;
}

.code-tile-tabs {
    display: flex;
    height: 28px;
}

.code-tile-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    background: var(--vsc-editor);
    border-right: 1px solid var(--vsc-border);
    box-shadow: inset 0 1px 0 var(--vsc-accent);
    color: var(--vsc-fg-strong);
    font-size: 12px;
}

.code-tile-tab .codicon {
    font-size: 14px;
    color: var(--vsc-link);
}

.code-tile-body {
    padding: 8px 0;
    background: var(--vsc-editor);
    border-top: 1px solid var(--vsc-border);
    font-family: var(--vsc-font-mono);
    font-size: 12px;
    line-height: 20px;
    overflow: hidden;
}

.code-tile-body > div {
    padding: 0 12px;
    white-space: pre;
}

.code-tile-active {
    box-shadow: inset 0 0 0 1px #282828;
}

.code-tile-ln {
    display: inline-block;
    width: 2ch;
    margin-right: 2ch;
    text-align: right;
    color: #6e7681;
}

.code-tile-active .code-tile-ln {
    color: var(--vsc-fg);
}

.code-tile-cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    vertical-align: text-bottom;
    background: #aeafad;
    animation: cursor-blink 1s steps(1) infinite;
}

@keyframes cursor-blink {
    50% { opacity: 0; }
}

.tok-kw { color: #569cd6; }
.tok-type { color: #4ec9b0; }
.tok-fn { color: #dcdcaa; }
.tok-var { color: #9cdcfe; }
.tok-str { color: #ce9178; }
.tok-comment { color: #6a9955; }

/* Okno hasła jak Quick Input */
#unlock-section {
    width: min(460px, 90vw);
    background: var(--vsc-quick-input);
    border-color: var(--vsc-input);
    box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.36);
}

#unlock-section[style*="max-height: 0px"] {
    pointer-events: none;
}

/* Okno zmiany linku Live Share – jak Quick Input VS Code, u góry pod paskiem tytułu */
.quick-input {
    width: min(600px, calc(100vw - 32px));
    margin: 44px auto auto;
    padding: 0 6px 6px;
    background: var(--vsc-quick-input);
    border: 1px solid var(--vsc-input);
    border-radius: 6px;
    box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.36);
    color: var(--vsc-fg);
    font-family: var(--vsc-font-ui);
    font-size: 13px;
}

.quick-input::backdrop {
    background: transparent;
}

.quick-input-title {
    padding: 6px 0;
    color: var(--vsc-fg);
    font-size: 13px;
    text-align: center;
}

.quick-input-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.quick-input input {
    flex: 1;
    min-width: 0;
    height: 28px;
    box-sizing: border-box;
}

/* Przycisk kopiowania obok linku */
.quick-input-action {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 4px;
    color: var(--vsc-fg);
    cursor: pointer;
}

.quick-input-action[hidden] {
    display: none;
}

.quick-input-action .codicon {
    font-size: 16px;
}

.quick-input-action:hover:not(:disabled) {
    background: rgba(90, 93, 94, 0.31);
}

.quick-input-action:disabled {
    opacity: 0.4;
    cursor: default;
}

.quick-input-action.copied {
    color: #89d185;
}

.quick-input-message {
    min-height: 18px;
    padding: 6px 2px 0;
    color: var(--vsc-fg-muted);
    font-size: 12px;
}

.quick-input-message.error {
    color: var(--vsc-error);
}

.quick-input-message.success {
    color: #89d185;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: var(--vsc-accent);
    color: var(--vsc-fg-strong);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    font: inherit;
    font-size: 13px;
    line-height: 18px;
    cursor: pointer;
}

.btn:hover {
    background: var(--vsc-accent-hover);
}

.btn.back-link {
    padding: 2px 10px;
    background: var(--vsc-input);
    color: var(--vsc-fg);
    font-size: 12px;
}

.btn.back-link:hover {
    background: var(--vsc-input-border);
    color: var(--vsc-fg-strong);
}

input[type="password"],
input[type="text"] {
    padding: 4px 6px;
    background: var(--vsc-input);
    color: var(--vsc-fg);
    border: 1px solid var(--vsc-input-border);
    border-radius: 2px;
    font: inherit;
}

input[type="password"]:focus,
input[type="text"]:focus {
    outline: 1px solid var(--vsc-accent);
    outline-offset: -1px;
    border-color: var(--vsc-accent);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.przedmioty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.card {
    height: 100%;
    margin: 0;
    padding: 1rem 1.25rem;
    background: var(--vsc-widget);
    border: 1px solid var(--vsc-border);
    border-radius: 6px;
    transition: background 0.1s, border-color 0.1s;
}

.card:hover {
    background: var(--vsc-hover);
    border-color: var(--vsc-accent);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.card h3 {
    margin: 0 0 0.4rem;
    color: var(--vsc-link);
    font-size: 1.05rem;
    font-weight: 600;
}

.card p {
    margin: 0;
    color: var(--vsc-fg-muted);
    line-height: 1.6;
}

/* Nagłówek grupy jak w ustawieniach VS Code */
.hr-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.75rem 0 1rem;
    color: var(--vsc-fg);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hr-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--vsc-border);
}

/* Kontakt: kafelki kanałów kontaktu */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--vsc-widget);
    border: 1px solid var(--vsc-border);
    border-radius: 6px;
    transition: background 0.1s, border-color 0.1s;
}

.contact-card:hover {
    background: var(--vsc-hover);
    border-color: var(--vsc-accent);
}

.contact-card .contact-icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: color-mix(in srgb, currentColor 14%, transparent);
    font-size: 20px;
}

.contact-icon.icon-mail { color: var(--vsc-link); }
.contact-icon.icon-signal { color: #3a76f0; }
.contact-icon.icon-teams { color: #7b83eb; }
.contact-icon.icon-github { color: var(--vsc-fg-strong); }
.contact-icon.icon-orcid { color: #a6ce39; }
.contact-icon.icon-location { color: #f48771; }

.contact-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}

.contact-label {
    color: var(--vsc-fg-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.contact-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-action {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 4px;
    color: var(--vsc-fg-muted);
    cursor: pointer;
}

.contact-action:hover {
    background: rgba(90, 93, 94, 0.31);
    color: var(--vsc-fg-strong);
}

.contact-action.copied {
    color: #89d185;
}

.btn.btn-secondary {
    flex: none;
    padding: 2px 10px;
    background: var(--vsc-input);
    color: var(--vsc-fg);
    font-size: 12px;
}

.btn.btn-secondary:hover {
    background: var(--vsc-input-border);
    color: var(--vsc-fg-strong);
}

table {
    width: 100%;
    margin: 0.5rem 0 1.5rem;
    border-collapse: collapse;
    background: var(--vsc-editor);
    border: 1px solid var(--vsc-table-border);
}

thead th {
    background: var(--vsc-table-header);
    color: var(--vsc-fg);
    font-weight: 600;
    text-align: left;
}

th,
td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--vsc-table-border);
    vertical-align: top;
}

tbody td {
    color: var(--vsc-fg);
    font-size: 13px;
}

/* Wiersz pod kursorem: ramka zamiast rozjaśnionego tła, jaśniejszy tekst i linki.
   Ramka to cienie inset na komórkach – outline na <tr> przy border-collapse nie działa we wszystkich przeglądarkach. */
tbody tr:hover > td {
    color: var(--vsc-fg-strong);
    box-shadow: inset 0 1px 0 var(--vsc-fg), inset 0 -1px 0 var(--vsc-fg);
}

tbody tr:hover > td:first-child {
    box-shadow: inset 1px 0 0 var(--vsc-fg), inset 0 1px 0 var(--vsc-fg), inset 0 -1px 0 var(--vsc-fg);
}

tbody tr:hover > td:last-child {
    box-shadow: inset -1px 0 0 var(--vsc-fg), inset 0 1px 0 var(--vsc-fg), inset 0 -1px 0 var(--vsc-fg);
}

tbody tr:hover > td:only-child {
    box-shadow: inset 0 0 0 1px var(--vsc-fg);
}

.section tbody tr:hover a:not(.btn) {
    color: #8fcaff;
}

table th:nth-child(1),
table td:nth-child(1) {
    width: 12%;
}

table th:nth-child(2),
table td:nth-child(2) {
    width: 8%;
}

table th:nth-child(3),
table td:nth-child(3) {
    width: 6%;
    text-align: center;
}

table th:nth-child(4),
table td:nth-child(4) {
    width: 8%;
    text-align: center;
}

table th:nth-child(5),
table td:nth-child(5) {
    width: 28%;
}

table th:nth-child(6),
table td:nth-child(6) {
    width: 28%;
}

table th:nth-child(7),
table td:nth-child(7) {
    width: 10%;
    text-align: center;
}

.red_point {
    color: rgb(255, 0, 0);
    font-size: 20px;
}
.green_point {
    color: rgb(0, 255, 0);
    font-size: 20px;
}
.grey_point {
    color: rgb(128, 128, 128);
    font-size: 20px;
}

.blink {
    animation: gentle-blink 3s ease-in-out infinite;
}

@keyframes gentle-blink {
    0%, 100% {
        background-color: var(--vsc-editor);
    }
    50% {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

.disabled-table {
    filter: grayscale(100%);
    opacity: 0.2;
    pointer-events: none;
    user-select: none;
}

/* Wyłączona tabela: widoczny tylko wiersz nagłówkowy */
.disabled-table > tbody {
    display: none;
}

/* Harmonogramy (table.schedule): najbliższe i minione zajęcia */
.schedule-next {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin: 0.5rem 0 0;
    padding: 6px 10px;
    background: rgba(0, 120, 212, 0.12);
    border: 1px solid rgba(0, 120, 212, 0.35);
    border-radius: 2px;
    color: var(--vsc-fg);
    font: inherit;
    font-size: 13px;
    text-align: left;
}

button.schedule-next {
    cursor: pointer;
}

button.schedule-next:hover {
    background: rgba(0, 120, 212, 0.2);
}

div.schedule-next {
    background: var(--vsc-widget);
    border-color: var(--vsc-table-border);
    color: var(--vsc-fg-muted);
}

.schedule-next .codicon {
    color: var(--vsc-link);
}

.next-badge {
    display: inline-block;
    padding: 0 7px;
    background: var(--vsc-accent);
    color: var(--vsc-fg-strong);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
}

td > .next-badge {
    margin-top: 4px;
}

tbody tr.row-next {
    background: rgba(0, 120, 212, 0.12);
}

/* Minione zajęcia: przyciemniony cały wiersz (tekst i linki), pod kursorem wraca do normy */
tbody tr.row-past > td {
    color: var(--vsc-fg-inactive);
}

tbody tr.row-past a {
    opacity: 0.6;
}

tbody tr.row-past:hover > td {
    color: var(--vsc-fg);
}

tbody tr.row-past:hover a {
    opacity: 1;
}

/* Fajka przy dacie zajęć, które już się odbyły (klasę row-past nadaje markUpcomingClasses w main.php) */
tbody tr.row-past td:first-child::after {
    content: "\00a0\2713";
    content: "\00a0\2713" / " (odbyte)";
    color: var(--vsc-success);
    font-weight: bold;
}

.section {
    opacity: 1;
}
.section.fade-out {
    opacity: 0;
    transition: opacity 0.35s ease;
}
.section.fade-in {
    opacity: 1;
    transition: opacity 0.35s ease;
}

/* Strona logowania: styles/login.css */

/* ---------- Wąskie ekrany ---------- */

@media (max-width: 768px) {
    .auxbar {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
    }

    .auxbar.open {
        width: min(348px, calc(100vw - 48px));
        box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.36);
    }

    .auxbar-card {
        width: calc(min(348px, 100vw - 48px) - 12px);
    }

    .sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 48px;
        z-index: 20;
        box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.36);
    }

    body.sidebar-hidden .sidebar {
        box-shadow: none;
    }

    .container {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .code-tile {
        margin-left: 0;
    }

    .titlebar-brand-name,
    .statusbar-optional {
        display: none;
    }
}
