/* --- Color palette --- */
:root {
  --grey-bg: #2e2e2e;
  --red-bg: #3d2323;
  --green-bg: #253a32;
  --blue-bg: #232c39;
  --red-border: #6b1616;
  --green-border: #136132;
  --blue-border: #11386b;
  --placeholder: #b0b0b0;
}

/* --- Body background: dark, less red, more professional --- */
body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', 'Roboto', 'Arial', sans-serif;
  background:
    linear-gradient(135deg, #18141a 0%, #232027 100%),
    url('data:image/svg+xml;utf8,<svg width="100%25" height="100%25" xmlns="http://www.w3.org/2000/svg"><filter id="n" x="0" y="0"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" seed="7"/></filter><rect width="100%25" height="100%25" filter="url(%23n)" opacity="0.06"/></svg>');
  background-blend-mode: multiply;
  color: #fff;
}

html, body {
  background: #18141a;
  min-height: 100vh;
}

.topbar {
  background: #232027;
  box-shadow: none;
  border-bottom: 0px solid #d18033;
  height: 45px;
}
.topbar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}
.tabs {
  display: flex;
  align-items: flex-end;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0;
  background: #232027;
  height: 45px;
}
.topbar-actions {
  display: flex;
  gap: 1em;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.topbar-link {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.2s, color 0.2s;
  padding: 0.2em 0.7em;
  border-radius: 2px;
  height: 100%;
}
.topbar-link:hover {
  opacity: 1;
  color: #a83232;
  background: #18141a;
}
.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.2rem;
  background: #2a232d;
  border: 0px solid #636264;
  text-decoration: none;
  color: #9cc5fa;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  box-shadow: none;
  border-radius: 0;
  position: relative;
  user-select: none;
  height: calc(100% - 5px);
}
.tab.active {
  border-bottom: none;
  background: #2d2a36;
  color: #9cf0c1;
  border-top: 5px solid #22ec7a;
}
.tab:hover:not(.active) {
  background: #28242c;
  color: #fff;
}

main {
  max-width: 900px;
  margin: 2rem auto;
  background: #232027ee;
  border-radius: 4px;
  box-shadow: 0 4px 24px #000a;
  padding: 2rem;
  border: 2px solid #35303a;
}
h1, h2, h3 {
  font-family: inherit;
  color: #fff;
  margin-top: 0;
  text-shadow: none;
}
.showcase {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* --- Button base --- */
.btn {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  background: var(--grey-bg);
  color: #fff;
  font-weight: bold;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 6px #0006;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.1s, border 0.2s;
  border: 2px solid var(--red-border);
  position: relative;
  overflow: hidden;
}
.btn.red { background: var(--red-bg); border-color: var(--red-border); }
.btn.green { background: var(--green-bg); border-color: var(--green-border); }
.btn.blue { background: var(--blue-bg); border-color: var(--blue-border); }
.btn:disabled, .btn.disabled {
  background: #23202788;
  color: #888;
  border-color: #35303a;
  cursor: not-allowed;
  box-shadow: none;
}
.btn:hover:not(:disabled) {
  filter: brightness(1.02) drop-shadow(0 0 8px #fff2);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 16px #fff2, 0 0 0 2px #fff2 inset;
  z-index: 2;
}
.btn:active:not(:disabled) {
  filter: brightness(1);
  transform: translateY(1px) scale(0.99);
}

/* --- Input base --- */
.input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  background: var(--grey-bg);
  color: #fff;
  margin-bottom: 0.5rem;
  margin-right: 0.5rem;
  box-shadow: 0 1px 2px #23202780;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
  border: 2px solid var(--red-border);
  position: relative;
  z-index: 1;
}
.input.red, select.red, textarea.red { background: var(--red-bg); border-color: var(--red-border); }
.input.green, select.green, textarea.green { background: var(--green-bg); border-color: var(--green-border); }
.input.blue, select.blue, textarea.blue { background: var(--blue-bg); border-color: var(--blue-border); }
.input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px #fff2;
}
.input::placeholder, textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}
select, select option {
  color: #fff;
  background: var(--grey-bg);
}
select.red, select.red option { background: var(--red-bg); }
select.green, select.green option { background: var(--green-bg); }
select.blue, select.blue option { background: var(--blue-bg); }

/* --- Card base --- */
.card {
  background: #1a1a1a;
  border: 2px solid var(--red-border);
  border-radius: 4px;
  /* Remove box-shadow for a flat look */
  box-shadow: none;
  /*padding: 1.2rem 1.5rem;*/
  /*margin-bottom: 0.15em !important;*/
  color: #fff;
}
.card.red { border-color: var(--red-border); }
.card.green { border-color: var(--green-border); }
.card.blue { border-color: var(--blue-border); }
.card h2 {
  display: block;
  width: 100%;
  text-align: center;
  background: #232c39;
  color: #fff;
  border-radius: 4px 4px 0 0;
  padding: 0.7em 0;
  margin: 0 0 0.7em 0;
  box-shadow: none;
  /* Remove left/right margin and padding for flush look */
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}
.card.red h2 { background: var(--red-bg); }
.card.green h2 { background: var(--green-bg); }
.card.blue h2 { background: var(--blue-bg); }


/* --- Notification base --- */
.notification {
  background: var(--grey-bg);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 4px;
  font-weight: bold;
  box-shadow: 0 2px 8px #0004;
  border: 2px solid var(--red-border);
  max-width: 350px;
  position: relative;
  overflow: hidden;
}
.notification.red { background: var(--red-bg); border-color: var(--red-border); }
.notification.green { background: var(--green-bg); border-color: var(--green-border); }
.notification.blue { background: var(--blue-bg); border-color: var(--blue-border); }

/* --- Avatar --- */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--grey-bg);
  border: 2px solid var(--red-border);
  border-radius: 50%;
  font-size: 1.3rem;
  color: #fff;
  font-weight: bold;
  box-shadow: 0 2px 8px #0004;
  margin: 0.5rem 0;
}
.avatar.red { background: var(--red-bg); border-color: var(--red-border); }
.avatar.green { background: var(--green-bg); border-color: var(--green-border); }
.avatar.blue { background: var(--blue-bg); border-color: var(--blue-border); }

/* --- Slider --- */
.slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}
input[type="range"] {
  width: 200px;
  background: var(--grey-bg);
  height: 4px;
  border-radius: 2px;
  accent-color: var(--red-border);
}
input[type="range"].red { background: var(--red-bg); accent-color: var(--red-border); }
input[type="range"].green { background: var(--green-bg); accent-color: var(--green-border); }
input[type="range"].blue { background: var(--blue-bg); accent-color: var(--blue-border); }
input[type="range"]::-webkit-slider-thumb {
  background: var(--red-border);
  border: 2px solid #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  box-shadow: 0 2px 6px #0004;
}
input[type="range"].green::-webkit-slider-thumb {
  background: var(--green-border); }
input[type="range"].blue::-webkit-slider-thumb {
  background: var(--blue-border); }
input[type="range"]::-webkit-slider-runnable-track {
  background: #35303a;
  height: 4px;
  border-radius: 2px;
}

/* --- Table --- */
.table-container {
  background: none;
  padding: 0.5em 0;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #18141a;
  color: #fff;
  font-size: 1rem;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: none;
}
th, td {
  padding: 0.7em 1.2em;
  text-align: left;
  border: none;
}
th {
  background: #232c39;
  color: #fff;
  font-weight: bold;
  border-bottom: 2px solid #35303a;
}
tbody tr {
  background: #232027;
  transition: background 0.2s;
}
tbody tr:nth-child(even) {
  background: #1a1a1a;
}
tbody tr:hover {
  background: #2a3e57;
}
td {
  border-bottom: 1px solid #35303a;
}
::-webkit-scrollbar {
  width: 10px;
  background: #2a232d;
}
::-webkit-scrollbar-thumb {
  background: #a83232;
  border-radius: 8px;
} 

/* --- Modal Title margin --- */
.modal-content h3 {
  margin-top: 1.2em;
  margin-bottom: 1.2em;
  padding-left: 1.2em;
  padding-right: 1.2em;
}

.card h2 {
  padding-top: 0.1em;
  padding-bottom: 0.1em;
}

.card p {
  margin: 0.2em 0 0.7em 0;
  padding: 0.3em 0.8em;
  border-radius: 4px;
}

/* --- Checkbox and Radio --- */
.checkbox, .radio {
  font-size: 1rem;
  color: #fff;
  margin-right: 1.5rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.checkbox input[type="checkbox"], .radio input[type="radio"] {
  accent-color: var(--red-border);
  background: var(--grey-bg);
  border: 2px solid var(--red-border);
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.3em;
}
.checkbox.red input[type="checkbox"], .radio.red input[type="radio"] {
  accent-color: var(--red-border);
  border-color: var(--red-border);
  background: var(--red-bg);
}
.checkbox.green input[type="checkbox"], .radio.green input[type="radio"] {
  accent-color: var(--green-border);
  border-color: var(--green-border);
  background: var(--green-bg);
}
.checkbox.blue input[type="checkbox"], .radio.blue input[type="radio"] {
  accent-color: var(--blue-border);
  border-color: var(--blue-border);
  background: var(--blue-bg);
} 

/* --- Modal base --- */
.modal-content {
  background: var(--grey-bg);
  border: 2px solid var(--red-border);
  border-radius: 4px;
  box-shadow: 0 4px 16px #232027cc;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.modal-content.red { background: var(--red-bg); border-color: var(--red-border); }
.modal-content.green { background: var(--green-bg); border-color: var(--green-border); }
.modal-content.blue { background: var(--blue-bg); border-color: var(--blue-border); }
.modal-content > * {
  padding-left: 1.2em;
  padding-right: 1.2em;
  margin-top: 0;
  margin-bottom: 0;
} 

.btn, .input, select, textarea, .card, .modal-content, .notification, .tab, .card h2, .modal-content > *, .table-container, table, th, td {
  border-radius: 0;
  border-width: 1px;
}

.avatar, .avatar.red, .avatar.green, .avatar.blue {
  border-radius: 50%;
} 

.modal-content button {
  margin-left: 0.5em;
  margin-right: 0.5em;
} 

.modal-content > *,
.modal-content button,
.card,
.notification,
.input,
select,
textarea,
.btn,

.showcase > * {
  margin-top: 0.15em !important;
  margin-bottom: 0.15em !important;
}

/* Remove box-shadow from other elements for a flat look */
.notification, .modal-content, .btn, .card h2 {
  box-shadow: none !important;
} 

/* --- Layout for sidebar and main content --- */
.layout-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.collections-bar {
  background: #232027;
  width: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 2px solid #35303a;
  z-index: 2;
  box-sizing: border-box;
}

.collections-logo {
  width: 250px;
  margin: 0 0 0 0;
  display: block;
}

.collections-divider {
  width: 80%;
  height: 1px;
  background: #35303a;
  margin: 0.5em 0 0.5em 0;
  align-self: center;
}

.collections-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
  margin-bottom: 0;
  background: #232027;
  border: 1px solid #35303a;
  border-radius: 0;
  padding: 0.3em 0.2em 0.2em 0.2em;
  box-sizing: border-box;
}

.collections-title {
  font-size: clamp(1rem, 2.5vw, 1.45rem);
  font-weight: 900;
  color: #fff;
  margin: 0 0 0.1em 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px #0008, 0 0 2px #a83232;
  padding: 0.1em 0.2em;
  border-radius: 0;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  text-align: center;
}

.collections-breaker {
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, #a83232 0%, #35303a 100%);
  margin: 0.3em 0 0.3em 0;
  border-radius: 2px;
}

.collections-toggle {
  margin: 0.1em 0 0 0;
  background: #18141a;
  color: #fff;
  border: 1px solid #35303a;
  border-radius: 4px;
  padding: 0.15em 0.8em;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  display: block;
}
.collections-toggle:hover {
  background: #232c39;
  color: #a83232;
  border-color: #a83232;
}

.collections-list-container {
  width: 100%;
  flex: 1;
  background: #18141a;
  border: 1.5px solid #35303a;
  border-radius: 0;
  box-shadow: 0 2px 12px #0004;
  padding: 0.7em 0.7em 0.7em 0.7em;
  margin-top: 0.2em;
  margin-bottom: 0.5em;
  padding: 0em;
  margin: 0em;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  box-sizing: border-box;
}

.collections-list {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, 120px);
  padding: 0em;
  margin: 0em;
  align-content: flex-start;
  /* transition: grid-template-columns 0.2s; */
  justify-items: start;
  box-sizing: border-box;
}

/* Grid view: fixed size items */
.collections-list .collection-project {
  width: 120px;
  height: 120px;
  box-sizing: border-box;
}

.collections-list.list-view {
  display: flex;
  flex-direction: column;
  padding: 0em;
  margin: 0em;
  gap: 0em;
  align-items: stretch;
}

/* List view: smaller items */
.collections-list.list-view .collection-project {
  flex-direction: row;
  align-items: center;
  gap: 0.3em;
  width: 100%; 
  height: 48px;
}
.collections-list.list-view .collection-project-image {
  width: 32px;
  height: 32px;
  margin-bottom: 0;
}
.collections-list.list-view .collection-project-name {
  font-size: 0.98rem;
  text-align: center;
  margin-top: 0;
}

.collection-project {
  background: #18141a;
  border: 1px solid #35303a;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5em 0.3em 0.3em 0.3em;
  cursor: pointer;
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 2px 8px #0002;
  margin: 0;
  position: relative;
}

.project-options-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: #888;
  font-size: 1.3em;
  cursor: pointer;
  opacity: 0.6;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
  z-index: 2;
}
.project-options-btn:hover {
  background: #232c39;
  color: #fff;
  opacity: 1;
}
.collection-project:hover {
  border-color: #a83232;
  background: #232c39;
}
.collection-project-image {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.5em;
  background: #35303a;
  border: 1px solid #232027;
  transition: width 0.2s, height 0.2s, margin 0.2s;
}
.collection-project-name {
  font-size: 1rem;
  color: #fff;
  text-align: center;
  margin-top: 0.2em;
  word-break: break-word;
  transition: font-size 0.2s, margin 0.2s;
}

.project-options-menu {
  position: absolute;
  top: 28px;
  right: 4px;
  width: max-content;
  background: #232027;
  border: 1px solid #35303a;
  box-shadow: 0 4px 16px #000a;
  border-radius: 6px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.2em 0;
  white-space: nowrap;
}
.project-options-menu-item {
  background: none;
  border: none;
  color: #fff;
  text-align: left;
  padding: 0.5em 1em;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  outline: none;
  width: 100%;
  white-space: nowrap;
  box-sizing: border-box;
  display: block;
}
.project-options-menu-item:hover, .project-options-menu-item:focus {
  background: #a83232;
  color: #fff;
}

.sidebar-resizer {
  width: 6px;
  cursor: ew-resize;
  background: #35303a;
  z-index: 10;
  transition: background 0.2s;
}
.sidebar-resizer:hover, .sidebar-resizer.active {
  background: #a83232;
}

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: auto;
  background: none;
}

.topbar {
  position: relative;
  z-index: 1;
} 

.tab-pane { display: none; }
.tab-pane.active { display: block; } 

.frontpage-stat-number {
  display: inline-block;
  min-width: 3.5em;
  position: relative;
  height: 3.2rem;
  line-height: 3.2rem;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  overflow-y: hidden;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}
.frontpage-stat-number span {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  transition: none;
}
.number-animate-out {
  animation: numberOut 0.45s cubic-bezier(.4,1.6,.6,1) forwards;
  z-index: 1;
}
.number-animate-in {
  animation: numberIn 0.45s cubic-bezier(.4,1.6,.6,1) forwards;
  z-index: 2;
}
@keyframes numberOut {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-100%); }
}
@keyframes numberIn {
  0% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(0); }
}

.frontpage-ticker {
  /* Remove position: fixed and width: 100vw */
  position: static;
  height: 3.5rem;
  background: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  overflow: visible;
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 2.2rem;
  margin-top: 0.5rem;
}
.frontpage-ticker-phrase {
  display: inline-block;
  min-width: 20em;
  position: relative;
  height: 3.5rem;
  line-height: 3.5rem;
  vertical-align: middle;
  color: #aaa;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  opacity: 0.88;
  overflow: hidden;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 8px #0008;
}
.frontpage-ticker-phrase span {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  transition: none;
} 

.new-collection-btn {
  width: 100%;
  margin: 0;
  padding: 1em 0;
  background: #232027;
  color: #fff;
  font-size: 1.1rem;
  font-weight: bold;
  border: 2px solid #a83232;
  border-radius: 0;
  box-shadow: 0 -2px 12px #000a;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
  letter-spacing: 0.04em;
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 20;
}
.new-collection-btn:hover {
  background: #a83232;
  color: #fff;
  border-color: #fff;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: rgba(24, 20, 26, 0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.new-collection-modal-content {
  background: #232027;
  border: 2px solid #a83232;
  border-radius: 0;
  box-shadow: 0 8px 32px #000c;
  padding: 1.2em 1.2em 1em 1.2em;
  min-width: 260px;
  max-width: 95vw;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.new-collection-modal-content h3 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0 0 1.2em 0;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.new-collection-modal-content label {
  color: #aaa;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.1em;
  margin-top: 0.4em;
}

.new-collection-modal-content input,
.new-collection-modal-content textarea,
.new-collection-modal-content select {
  width: 100%;
  font-size: 1.05rem;
  padding: 0.5em 0.7em;
  margin-bottom: 0.1em;
  border-radius: 0;
  border: 2px solid #35303a;
  background: #18141a;
  color: #fff;
  box-sizing: border-box;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

.new-collection-modal-content input:focus,
.new-collection-modal-content textarea:focus,
.new-collection-modal-content select:focus {
  border-color: #a83232;
  box-shadow: 0 0 0 2px #a8323240;
}

#collection-style {
  position: relative;
  z-index: 1;
}
.style-select-wrap {
  position: relative;
  width: 100%;
}
#collection-style-custom {
  position: static;
  left: unset; right: unset; top: unset;
  z-index: 2;
  display: none;
  background: #18141a;
  border: 2px solid #35303a;
  color: #fff;
  font-size: 1.05rem;
  padding: 0.5em 0.7em;
  margin-top: 0.3em;
  margin-bottom: 0.1em;
  box-sizing: border-box;
  outline: none;
  width: 100%;
}

.new-collection-modal-content .modal-error {
  margin: 0.4em 0 0 0;
  font-size: 0.98rem;
} 