* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: #ffffff;
  color: #222222;
}

body {
  min-height: 100vh;
}

/* =========================
   TOP BAR
========================= */

.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 24px;

  background: #07366b;
  color: white;

  border-top: 3px solid #ffffff;
}

.app-title {
  font-size: 20px;
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input {
  width: 320px;
  height: 36px;

  padding: 0 12px;

  border: 1px solid #cccccc;
  border-radius: 4px;

  font-size: 14px;
  outline: none;
}

.search-input:focus {
  border-color: #168bd2;
}

/* =========================
   MAIN
========================= */

#app {
  width: 100%;
  min-height: calc(100vh - 60px);
}

/* =========================
   NAVIGATION
========================= */

.navigation-view {
  padding: 32px;
}

.navigation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 30px;
}

.navigation-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.navigation-header p {
  margin: 0;
  color: #666666;
}

.category-columns {
  display: flex;
  align-items: flex-start;

  gap: 8px;

  overflow-x: auto;
  padding-bottom: 12px;
}

/* Ovo ćemo koristiti za svaki stupac kategorija */

.category-column {
  width: 240px;
  min-width: 240px;

  display: flex;
  flex-direction: column;

  gap: 4px;
}

.category-item {
  min-height: 42px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 10px 12px;

  background: #eeeeee;

  cursor: pointer;

  border-left: 4px solid transparent;

  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.category-item:hover,
.category-item.active {
  background: #dddddd;
  border-left-color: #168bd2;
}

.category-arrow {
  color: #777777;
  font-size: 18px;
}

/* =========================
   ARTICLE
========================= */

.article-view {
  max-width: 1200px;

  margin: 0 auto;
  padding: 32px;
}

.breadcrumbs {
  margin-bottom: 24px;

  color: #777777;
  font-size: 14px;
}

.article-content {
  line-height: 1.6;
}

.article-content h1 {
  margin-top: 0;
}

/* =========================
   ARTICLE NAVIGATION
========================= */

.back-button {
  margin-bottom: 20px;
  padding: 0;

  border: none;
  background: none;

  color: #1268a8;
  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
}

.back-button:hover {
  text-decoration: underline;
}

.article-content h1 {
  margin-bottom: 24px;

  font-size: 32px;
  line-height: 1.2;
}

.article-content h2 {
  margin-top: 32px;
  margin-bottom: 12px;

  font-size: 22px;
}

.article-content p {
  margin: 0 0 16px;
}

.article-content ul,
.article-content ol {
  margin-bottom: 20px;
}

.article-content img {
  max-width: 100%;
  height: auto;
}

/* =========================
   TABLES
========================= */

.table-wrapper {
  width: 100%;
  overflow-x: auto;

  margin: 20px 0 28px;
}

.article-table {
  width: 100%;

  border-collapse: collapse;

  font-size: 14px;
}

.article-table th,
.article-table td {
  padding: 10px 12px;

  border: 1px solid #cccccc;

  text-align: left;
  vertical-align: top;
}

.article-table th {
  background: #eeeeee;

  font-weight: 700;
}

.article-table tbody tr:hover {
  background: #f8f8f8;
}

/* =========================
   COLLAPSIBLE
========================= */

.collapsible {
  margin: 20px 0;

  border: 1px solid #cccccc;
  border-radius: 4px;

  background: #ffffff;
}

.collapsible summary {
  padding: 12px 16px;

  background: #eeeeee;

  font-weight: 600;

  cursor: pointer;

  user-select: none;
}

.collapsible summary:hover {
  background: #e5e5e5;
}

.collapsible-content {
  padding: 18px 20px;
}

.collapsible-content > :first-child {
  margin-top: 0;
}

.collapsible-content > :last-child {
  margin-bottom: 0;
}

/* =========================
   IMAGES
========================= */

.article-image {
  margin: 24px 0;

  text-align: center;
}

.article-image img {
  display: block;

  max-width: 100%;
  height: auto;

  margin: 0 auto;

  border: 1px solid #dddddd;
  border-radius: 4px;
}

.article-image figcaption {
  margin-top: 8px;

  color: #777777;
  font-size: 13px;

  text-align: center;
}

/* =========================
   ARTICLE TOOLBAR
========================= */

.article-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  margin-bottom: 20px;
}

.article-toolbar .back-button {
  margin-bottom: 0;
}

.admin-controls {
  display: flex;
  align-items: center;

  gap: 8px;
}

.primary-button,
.secondary-button {
  min-height: 36px;

  padding: 7px 14px;

  border-radius: 4px;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
}

.primary-button {
  border: 1px solid #1268a8;

  background: #1268a8;
  color: #ffffff;
}

.primary-button:hover {
  background: #0e568b;
}

.secondary-button {
  border: 1px solid #cccccc;

  background: #ffffff;
  color: #333333;
}

.secondary-button:hover {
  background: #f2f2f2;
}


/* =========================
   EDIT MODE
========================= */

.edit-field {
  border-radius: 3px;

  background: #fffbea;

  outline: 1px dashed #c9b96e;

  transition:
    outline 0.15s ease,
    background 0.15s ease;
}

.edit-field:hover {
  outline: 1px solid #168bd2;
}

.edit-field:focus {
  background: #ffffff;

  outline: 2px solid #168bd2;
}

/* =========================
   BLOCK TOOLBAR
========================= */

.block-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 8px;

  margin-top: 32px;
  padding-top: 20px;

  border-top: 1px solid #dddddd;
}

.block-toolbar-label {
  margin-right: 4px;

  color: #666666;
  font-size: 14px;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

/* =========================
   EDITABLE BLOCKS
========================= */

.editable-block {
  position: relative;

  margin: 10px 0;
  padding: 34px 10px 10px;

  border: 1px dashed #cccccc;
  border-radius: 4px;

  background: #ffffff;
}

.editable-block:hover {
  border-color: #168bd2;
}

.block-controls {
  position: absolute;

  top: 5px;
  right: 6px;

  display: flex;
  align-items: center;

  gap: 4px;
}

.block-control-button {
  min-width: 28px;
  height: 25px;

  padding: 2px 7px;

  border: 1px solid #cccccc;
  border-radius: 3px;

  background: #ffffff;
  color: #444444;

  font-size: 12px;

  cursor: pointer;
}

.block-control-button:hover:not(:disabled) {
  background: #eeeeee;
}

.block-control-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.delete-block-button {
  margin-left: 4px;
}

.delete-block-button:hover {
  border-color: #b94a48;

  background: #fff2f2;
  color: #a12622;
}


/*
  Malo uredimo margine elemenata
  kad su unutar edit wrappera.
*/

.editable-block > p:first-of-type,
.editable-block > h2:first-of-type,
.editable-block > h3:first-of-type,
.editable-block > ul:first-of-type,
.editable-block > ol:first-of-type,
.editable-block > figure:first-of-type,
.editable-block > .table-wrapper:first-of-type,
.editable-block > details:first-of-type {
  margin-top: 0;
}

.editable-block > p:last-child,
.editable-block > ul:last-child,
.editable-block > ol:last-child,
.editable-block > figure:last-child,
.editable-block > .table-wrapper:last-child,
.editable-block > details:last-child {
  margin-bottom: 0;
}

/* =========================
   INSERT BLOCK MENU
========================= */

.insert-block-menu {
  position: absolute;

  top: 34px;
  right: 6px;

  display: flex;
  align-items: center;

  gap: 4px;

  padding: 6px;

  border: 1px solid #cccccc;
  border-radius: 4px;

  background: #ffffff;

  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);

  z-index: 20;
}

.insert-block-option {
  padding: 5px 8px;

  border: 1px solid #cccccc;
  border-radius: 3px;

  background: #ffffff;
  color: #333333;

  font-size: 12px;

  cursor: pointer;

  white-space: nowrap;
}

.insert-block-option:hover {
  background: #eeeeee;
}

/* =========================
   COLLAPSIBLE EDIT OPTIONS
========================= */

.default-open-control {
  display: flex;
  align-items: center;

  gap: 5px;

  margin: 0 5px;

  color: #555555;
  font-size: 12px;

  cursor: pointer;

  white-space: nowrap;
}

.default-open-control input {
  margin: 0;

  cursor: pointer;
}

/* =========================
   TABLE EDIT CONTROLS
========================= */

.table-edit-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 5px;

  margin-bottom: 8px;
}

.table-edit-button {
  min-height: 28px;

  padding: 4px 9px;

  border: 1px solid #cccccc;
  border-radius: 3px;

  background: #ffffff;
  color: #444444;

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;
}

.table-edit-button:hover:not(:disabled) {
  border-color: #168bd2;

  background: #f2f8fc;
}

.table-edit-button:disabled {
  opacity: 0.35;

  cursor: default;
}

/* =========================
   TABLE ROW / COLUMN DELETE
========================= */

.table-header-editor {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 8px;
}

.table-header-text {
  flex: 1;

  min-width: 40px;
}

.table-delete-button {
  width: 24px;
  height: 24px;

  flex-shrink: 0;

  padding: 0;

  border: 1px solid #cccccc;
  border-radius: 3px;

  background: #ffffff;
  color: #777777;

  font-size: 16px;
  line-height: 20px;

  cursor: pointer;
}

.table-delete-button:hover:not(:disabled) {
  border-color: #b94a48;

  background: #fff2f2;
  color: #a12622;
}

.table-delete-button:disabled {
  opacity: 0.3;

  cursor: default;
}

.table-action-header,
.table-row-action {
  width: 38px;

  padding: 5px !important;

  text-align: center !important;
}

.table-row-action {
  background: #fafafa;
}

/* =========================
   LIST EDIT CONTROLS
========================= */

.list-edit-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 5px;

  margin-bottom: 8px;
}

.list-edit-button {
  min-height: 28px;

  padding: 4px 9px;

  border: 1px solid #cccccc;
  border-radius: 3px;

  background: #ffffff;
  color: #444444;

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;
}

.list-edit-button:hover:not(:disabled) {
  border-color: #168bd2;

  background: #f2f8fc;
}

.list-edit-button:disabled {
  opacity: 0.35;

  cursor: default;
}

/* =========================
   RICH TEXT TOOLBAR
========================= */

.rich-text-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 6px;

  margin-bottom: 18px;
  padding: 8px;

  border: 1px solid #dddddd;
  border-radius: 4px;

  background: #f8f8f8;
}

.rich-text-button {
  min-width: 34px;
  height: 32px;

  padding: 4px 9px;

  border: 1px solid #cccccc;
  border-radius: 3px;

  background: #ffffff;
  color: #333333;

  cursor: pointer;
}

.rich-text-button:hover {
  border-color: #168bd2;
  background: #f2f8fc;
}

.rich-text-separator {
  width: 1px;
  height: 24px;

  margin: 0 4px;

  background: #cccccc;
}

.article-link-select {
  min-width: 260px;
  height: 32px;

  padding: 4px 7px;

  border: 1px solid #cccccc;
  border-radius: 3px;

  background: #ffffff;
}

.link-button {
  min-width: auto;
}


/*
  LINKOVI UNUTAR ČLANKA
*/

.article-content a {
  color: #1268a8;
  text-decoration: underline;

  cursor: pointer;
}

.article-content a:hover {
  color: #0b4d7d;
}

/* =========================
   IMAGE EDIT CONTROLS
========================= */

.image-edit-controls {
  display: inline-flex;
  align-items: center;

  gap: 5px;

  margin: 0 0 10px 8px;
}

.article-image > span {
  color: #666666;

  font-size: 12px;
  font-weight: 600;
}

.image-size-button {
  min-width: 42px;
  height: 28px;

  padding: 3px 7px;

  border: 1px solid #cccccc;
  border-radius: 3px;

  background: #ffffff;
  color: #444444;

  font-size: 12px;

  cursor: pointer;
}

.image-size-button:hover {
  border-color: #168bd2;

  background: #f2f8fc;
}

.image-size-button.active {
  border-color: #1268a8;

  background: #1268a8;
  color: #ffffff;
}

/* =========================
   TWO COLUMN LAYOUT
========================= */

.column-layout {
  width: 100%;

  margin: 22px 0;
}

.column-layout-columns {
  display: grid;

  gap: 24px;

  align-items: start;
}


/*
  OMJERI
*/

.column-layout[data-ratio="50-50"]
.column-layout-columns {
  grid-template-columns: 1fr 1fr;
}

.column-layout[data-ratio="33-67"]
.column-layout-columns {
  grid-template-columns: 1fr 2fr;
}

.column-layout[data-ratio="67-33"]
.column-layout-columns {
  grid-template-columns: 2fr 1fr;
}


/*
  EDIT MODE
*/

.column-layout-wrapper {
  display: flex;
  align-items: center;

  gap: 8px;

  margin-bottom: 10px;

  color: #666666;
  font-size: 12px;
  font-weight: 600;
}

.column-layout-controls {
  display: flex;

  gap: 5px;
}

.column-ratio-button {
  min-height: 28px;

  padding: 4px 9px;

  border: 1px solid #cccccc;
  border-radius: 3px;

  background: #ffffff;
  color: #444444;

  font-size: 12px;

  cursor: pointer;
}

.column-ratio-button:hover {
  border-color: #168bd2;

  background: #f2f8fc;
}

.column-ratio-button.active {
  border-color: #1268a8;

  background: #1268a8;
  color: #ffffff;
}

.column-layout-column {
  min-width: 0;
}


/*
  Dok uređujemo, vizualno pokažemo
  granice pojedinog stupca.
*/

.editable-block .column-layout-column {
  min-height: 80px;

  padding: 8px;

  border: 1px dashed #cccccc;
  border-radius: 4px;
}


/*
  Na manjim ekranima stupce složimo
  jedan ispod drugoga.
*/

@media (max-width: 700px) {
  .column-layout-columns {
    grid-template-columns: 1fr !important;
  }
}

/* =========================
   CATEGORY ADMIN
========================= */

.category-admin-view {
  max-width: 1100px;

  margin: 0 auto;
  padding: 32px;
}

.category-admin-toolbar {
  margin-bottom: 20px;
}

.category-admin-toolbar .back-button {
  margin-bottom: 0;
}

.category-admin-header {
  margin-bottom: 28px;
}

.category-admin-header h1 {
  margin: 0 0 8px;

  font-size: 28px;
}

.category-admin-header p {
  margin: 0;

  color: #666666;
}


/* =========================
   CATEGORY TREE
========================= */

.category-admin-tree {
  display: flex;
  flex-direction: column;

  gap: 5px;
}

.category-admin-item {
  position: relative;
}

.category-admin-row {
  display: flex;
  align-items: center;

  min-height: 42px;

  padding: 8px 12px;

  border: 1px solid #dddddd;
  border-radius: 4px;

  background: #ffffff;
}

.category-admin-row:hover {
  border-color: #168bd2;
}

.category-admin-name {
  font-weight: 600;
}

.category-admin-children {
  display: flex;
  flex-direction: column;

  gap: 5px;

  margin-top: 5px;
  margin-left: 28px;
}

.category-admin-empty {
  padding: 20px;

  border: 1px dashed #cccccc;
  border-radius: 4px;

  color: #777777;

  text-align: center;
}

/* =========================
   CATEGORY ADMIN CONTROLS
========================= */

.category-admin-row {
  justify-content: space-between;

  gap: 12px;
}

.category-admin-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 5px;
}

.category-admin-button {
  min-height: 28px;

  padding: 4px 9px;

  border: 1px solid #cccccc;
  border-radius: 3px;

  background: #ffffff;
  color: #444444;

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;
}

.category-admin-button:hover:not(:disabled) {
  border-color: #168bd2;

  background: #f2f8fc;
}

.category-admin-button:disabled {
  opacity: 0.35;

  cursor: default;
}

.category-admin-footer {
  margin-top: 24px;
  padding-top: 18px;

  border-top: 1px solid #dddddd;
}

/* =========================
   CATEGORY MOVE
========================= */

.category-move-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 8px;

  margin-top: 5px;
  padding: 10px 12px;

  border: 1px solid #c9dceb;
  border-radius: 4px;

  background: #f5faff;

  font-size: 13px;
}

.category-move-panel > span {
  font-weight: 600;

  color: #555555;
}

.category-move-select {
  flex: 1;

  min-width: 280px;
  height: 34px;

  padding: 4px 8px;

  border: 1px solid #cccccc;
  border-radius: 3px;

  background: #ffffff;
}

.category-move-button {
  min-height: 34px;
}


/* =========================
   CATEGORY DELETE
========================= */

.category-delete-button:hover {
  border-color: #b94a48;

  background: #fff2f2;
  color: #a12622;
}

@media (max-width: 700px) {
  .category-move-select {
    width: 100%;
    min-width: 0;
  }
}

/* =========================
   ARTICLE ADMIN
========================= */

.article-admin-item {
  position: relative;
}

.article-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  min-height: 38px;

  padding: 7px 10px;

  border: 1px solid #e2e2e2;
  border-radius: 4px;

  background: #fafafa;
}

.article-admin-row:hover {
  border-color: #168bd2;

  background: #f7fbfe;
}

.article-admin-name-container {
  display: flex;
  align-items: center;

  gap: 7px;

  min-width: 0;
}

.article-admin-icon {
  flex-shrink: 0;

  font-size: 14px;
}

.article-admin-name {
  color: #444444;
  font-size: 14px;
}

.article-admin-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 5px;
}


/* =========================
   ARTICLE MOVE
========================= */

.article-move-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 8px;

  margin-top: 5px;
  padding: 10px 12px;

  border: 1px solid #c9dceb;
  border-radius: 4px;

  background: #f5faff;

  font-size: 13px;
}

.article-move-panel > span {
  font-weight: 600;

  color: #555555;
}

/* =========================
   LOGIN
========================= */

.login-view {
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: #f4f6f8;
}

.login-card {
  width: 100%;
  max-width: 380px;

  padding: 28px;

  border: 1px solid #dddddd;
  border-radius: 6px;

  background: #ffffff;
}

.login-card h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

.login-description {
  margin-top: 0;
  margin-bottom: 24px;

  color: #666666;
}

.login-card form {
  display: flex;
  flex-direction: column;

  gap: 8px;
}

.login-card label {
  margin-top: 8px;

  font-size: 14px;
  font-weight: 600;
}

.login-card input {
  height: 40px;

  padding: 8px 10px;

  border: 1px solid #cccccc;
  border-radius: 4px;

  font: inherit;
}

.login-button {
  margin-top: 16px;

  min-height: 40px;
}

.login-error {
  margin-top: 10px;

  color: #b42318;
  font-size: 14px;
}

.article-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.article-title-row h1 {
  margin: 0;
}

.article-pin-button {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.article-pin-button.active {
  font-weight: 600;
}

.article-pin-button:disabled {
  opacity: 0.6;
  cursor: default;
}