/* Fontet */

@font-face {
  font-family: "Comfortaa";
  src: url("fonts/Comfortaa-Regular.woff") format("woff");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Comfortaa";
  src: url("fonts/Comfortaa-Bold.woff") format("woff");
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

/* Ngjyrat */

:root {
  --primary: #4a5281;
  --primary-dark: #394168;
  --primary-light: #e9ecf5;
  --primary-light-hover: #dde2ef;

  --page-bg: #f2f2f2;
  --surface: #ffffff;

  --text: #382e40;
  --muted: #707585;
  --label: #535d70;
  --header-text: #012877;

  --border: #d5dbe5;
  --section-border: #dfe3eb;
  --row-border: #e8ebf1;

  --table-header: #e9edf4;
  --focus: #7b87b2;
  --focus-ring: #b4bfdc;
}

/* Rregullat bazë */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Comfortaa", sans-serif;
  font-optical-sizing: auto;
  color: var(--text);
  background: var(--page-bg);
}

.comfortaa-400 {
  font-family: "Comfortaa", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

/* Koka e faqes */

header {
  padding: 38px 24px 32px;
  background: var(--page-bg);
  color: var(--header-text);
  text-align: center;
}

header .inner,
main {
  max-width: 1260px;
  margin: auto;
}

.institution-university {
  letter-spacing: 1px;
  line-height: 1.5;
}

.institution-faculty {
  line-height: 1.5;
}

.institution-department {
  letter-spacing: 0.4px;
  line-height: 1.7;
}

.header-divider {
  width: 80px;
  height: 3px;
  margin: 22px auto;
  background: var(--focus-ring);
  border-radius: 3px;
}

h1 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 600;
}

header p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

/* Përmbajtja */

main {
  padding: 26px 16px;
}

section {
  margin-bottom: 22px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--section-border);
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(40, 55, 85, 0.04);
}

h2 {
  margin: 0 0 20px;
  color: var(--primary);
  font-size: 19px;
}

/* 01 · Të dhënat e evidencës */

#metadata {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px 28px;
  align-items: start;
}

#metadata > .metadata-half {
  grid-column: span 6;
}

#metadata > .metadata-quarter {
  grid-column: span 3;
}

label,
.cycle-field {
  display: block;
  min-width: 0;
  color: var(--label);
  font-size: 13px;
}

#metadata > label,
#metadata > .cycle-field {
  font-weight: 600;
}

/* Fushat e formularit */

input,
textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

#metadata input:not([type="radio"]):not([type="hidden"]) {
  height: 46px;
  margin-top: 8px;
  padding: 11px 13px;
  font-size: 14px;
  font-weight: normal;
}

textarea {
  min-height: 64px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}

/* Datat — kalendari i shfletuesit */

input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  color-scheme: light;

  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-inline-size: 0;

  height: 46px;
  min-height: 46px;
  font-size: 16px;
  line-height: normal;
}

#metadata input[type="date"] {
  font-size: 16px;
}

input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
  margin: 0;
  padding: 0;
  text-align: left;
}

/* Përzgjedhja e ciklit */

.cycle-options {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  min-height: 46px;
}

.cycle-options label {
  white-space: nowrap;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;

  background: #f8f9fc;
  font-size: 14px;
  font-weight: normal;
  cursor: pointer;
}

.cycle-options label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.cycle-options input[type="radio"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

/* Tabelat */

.scroll {
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  padding: 12px 8px;
  background: var(--table-header);
  color: var(--primary-dark);
  text-align: left;
  vertical-align: middle;
}

td {
  padding: 8px;
  border-bottom: 1px solid var(--row-border);
}

td input,
td textarea {
  margin: 0;
}

/* 02 · Kreditet dhe ngarkesa */

#credits input {
  max-width: 130px;
}

/* 02 dhe 04 · Tituj të shkurtër në celular */

.label-short {
  display: none;
}

/* 03 · Regjistrimet e mësimit */

#lessons {
  min-width: 1120px;
}

#lessons.no-practice {
  min-width: 1040px;
}

#lessons th {
  white-space: nowrap;
}

#lessons input {
  width: 74px;
  padding: 8px;
}

#lessons th:nth-child(2),
#lessons td:nth-child(2) {
  width: 161px;
  min-width: 161px;
}

/* Lartësi e njëjtë për datën dhe fushat numerike */

#lessons input[type="number"],
#lessons input[data-k="date"] {
  height: 36px;
  min-height: 36px;
  padding: 8px;
  font-size: 13px;
  line-height: normal;
}

#lessons input[data-k="date"] {
  width: 145px;
  min-width: 145px;
  max-width: 145px;
}

#lessons textarea {
  min-width: 230px;
}

#lessons input[type="checkbox"] {
  width: 18px;
  accent-color: var(--primary);
}

#lessons [data-total] {
  text-align: center;
  font-weight: bold;
  color: var(--primary);
}

/* Butonat */

button,
.download,
.button-link {
  display: inline-block;
  padding: 12px 18px;
  border: 0;
  border-radius: 9px;

  background: var(--primary);
  color: white;

  font: inherit;
  font-size: 14px;
  text-decoration: none;

  cursor: pointer;
  box-shadow: 0 2px 5px rgba(40, 55, 85, 0.12);
  transition: background-color 0.2s, box-shadow 0.2s;
}

button:not(:disabled):hover,
.download:hover,
.button-link:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 10px rgba(40, 55, 85, 0.18);
}

button:focus-visible,
.download:focus-visible,
.button-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

button.secondary,
.button-link.secondary {
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: none;
}

button.secondary:not(:disabled):hover,
.button-link.secondary:hover {
  background: var(--primary-light-hover);
  box-shadow: none;
}

button.remove {
  padding: 8px;
  background: #f5eaf0;
  color: #934b6c;
  box-shadow: none;
}

button.remove:not(:disabled):hover {
  background: #ecd7e2;
  box-shadow: none;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* 04 · Butonat e verifikimit dhe përmbledhjes */

.verification-actions {
  gap: 29px 24px;
}

.verification-buttons {
  flex: 1 0 auto;
  min-width: 0;
  max-width: 100%;
}

.button-link.summary-action {
  flex: 0 1 auto;
  margin: 0;
  max-width: 100%;
  text-align: center;
  background-color: #FEFDFC;
  color: var(--primary);
}

/* Udhëzuesi pas tekstit për ruajtjen e draftit */

.muted .readme-link {
  color: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.muted .readme-link:hover {
  color: var(--primary);
}

.muted .readme-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 3px;
}

/* Tekstet ndihmëse dhe mesazhet */

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* Hapësira mes butonave dhe udhëzimit për draftin */
.draft-help {
  margin-top: 31px;
}

.status {
  min-width: 0;
  max-width: 100%;

  margin: 16px 0;
  padding: 16px;
  border-radius: 8px;

  background: var(--primary-light);
  color: var(--primary-dark);

  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: normal;

  font-size: 14px;
  line-height: 1.5;
}

.status.error {
  background: #fff0ed;
  color: #943c2d;
}

.status.success {
  background: #e5f4eb;
  color: #1e6040;
}

.bad {
  color: #b34b32;
  font-weight: bold;
}

/* Fundi i faqes */

footer {
  padding: 12px 0 28px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Hapësira e ciklit në tablet */

@media (min-width: 761px) and (max-width: 1000px) {
  #metadata .cycle-options {
    gap: 8px;
  }

  #metadata .cycle-options label {
    gap: 6px;
    padding: 9px 6px;
    font-size: 13px;
  }
}

/* Paraqitja në ekranet e vogla */

@media (max-width: 760px) {
  #metadata {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  #metadata > .metadata-half,
  #metadata > .metadata-quarter {
    grid-column: 1 / -1;
  }

  section {
    padding: 17px;
  }

  header {
    padding: 28px 18px;
  }

  .institution-university {
    font-size: 18px;
  }

  .institution-faculty {
    font-size: 13px;
  }

  .institution-department {
    font-size: 11px;
  }

  h1 {
    font-size: 23px;
  }

  /* 02 · "Orë"; 04 · "+ / −" */
  .label-full {
    display: none;
  }

  .label-short {
    display: inline;
  }
}
