:root {
  --bg: #b1b8c9; /*MainMenu*/
  --text: #6e737f;
  --border:1px solid #48526e;
  --headercolor: #b1b8c9;
}
/* Base */
* {
  box-sizing: border-box;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

/* Header */
.topbar {
  height: 66px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: #b1b8c9;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  border-width: 1px;
  border-style: solid;
}

.brand {
  min-width: 180px;
  color: #8828d2;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 2px;
}

.search {
  flex: 1;
  display: flex;
  justify-content: center;
}
.search input {
  width: min(720px, 100%);
  height: 34px;
  border-radius: 18px 0 0 18px;
  background: #ffffff;
  color: #000000;
  padding: 0 14px;
  outline: none;
  border-width: 1px;
  border-style: solid;
  box-shadow: inset 1px 2px 4px rgba(0, 0, 0, 0.3);
}
.search input::placeholder {
  color: #686868;
}

.search button {
  height: 34px;
  padding: 0 16px;
  border-radius: 0 18px 18px 0;
  background: #d8d7de;
  color: #000000;
  cursor: pointer;
  letter-spacing: 2px;
  border-width: 1px;
  border-style: solid;
}
.search button:hover {
  background-color: #7285a1;
  color: #ffffff;
}

.top-actions {
  min-width: 60px;
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}

.navbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 66px;
  padding: 0 12px;
  background: transparent;
  color: #000000;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.navbtn:hover {
  background: #7285a1;
} 
/*logout button*/
.logout-btn {
 border: none;
 cursor: pointer;
 font: inherit;
}

.logout-btn:hover {
 background: #8b3a3a;
 color: #ffffff;
}

/* App Layout */
.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 56px);
}

/* Sidebar (FIX) */
.sidebar {
  position: sticky;
  top: 56px; /* unter Header */
  height: calc(100vh - 56px);
  overflow-y: auto;
  background: rgba(114, 133, 161, 0.55);
  padding: 1px 1px;
  border-width: 1px;
  border-style: solid;
}


/* Sidebartittel CATEGORIES (FIX)  */
.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 10px 4px 10px;
  color: #000000;
  font-weight: 700;
  letter-spacing: 0.8px;
  
}

/* Dropdowns */
details {
  background: #b1b8c9;
  color: #000000;
  margin: 2px 0;
  overflow: hidden;
  
}
/*Uberschriften All3d Environment CAD*/
summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #000000;
  font-weight: 600;
}
/*Zahlen der Dropdown menu*/
.count {
  color: #000000;
  font-size: 14px;
  padding: 2px 12px;
  border-radius: 999px;
  background: #7285a1;
}
/*Unterkategorien bsp rocks*/
.side-links {
  padding: 4px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #000000;
  font-size: 16px;
}

.side-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 10px;
  border-radius: 2px;
}
/*Hover von untermenus wie Props Guns usw. */
.side-links a:hover {
  background: #7285a1;
  color: #000000;
}
.side-links a.active {
  background-color: #7285a1;
  color: #ffffff;
  font-weight: 700;
}

.right {
  float: right;
  opacity: 0.8;
} /* sichtbarkeit der zahlen*/

/* Main Wo die thumbnails sind*/
.main {
  padding: 16px;
  overflow: auto; /* wichtig: main scrollt */
  background: #e3e3e3;
  height: calc(100vh - 56px);
}

/* Thumbnails grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,290px);
  gap: 8px;
  justify-content: start;
}
/* textbereich */
.card {
  width: 290px;
  background: #ced3de; /* Untererteil von thumbnail*/
  border-radius: 8px;
  border-width: 1px;
  border-style: solid;
  overflow: hidden;
  transition: transform 0.20s ease, box-shadow 0.20s ease;
}
.card:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 16px  rgba(54, 109, 154, 0.87);;
  z-index: 5;
  
}

.thumb {
  width: 100%;
  height: 290px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  
}
.thumb:hover {
  background-color: #8c13f4;
}
/* Thumbnail Textbereich also Tittel von thumbs*/
.meta {
  padding: 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: #121538;
}

.meta span:first-child{
  white-space: pre-line;
  word-break: break-word;
}

.star {
  font-size: 16px;
  user-select: none;
  color: #ffea4c;
}


/* ===== FAQ PAGE ===== */
.page {
  padding: 48px 24px;
  background: #ffffff;
  color: #333;
  min-height: calc(100vh - 66px);
}

.faq {
  max-width: 860px;
  margin: 0 auto;
}

.faq-title {
  font-size: 54px;
  font-weight: 600;
  color: #8f31c8; 
  letter-spacing: 0.3px;
  margin: 10px 0 38px;
}

.faq-item {
  padding: 18px 0 10px;
}

.faq-item h2 {
  font-size: 22px;
  font-weight: 700;
  color: #2b2b2b;
  margin: 0 0 10px;
}

.faq-item p {
  margin: 0;
  line-height: 1.45;
  font-size: 16px;
  color: #5f5e64; /* grauer Fließtext */
  max-width: 760px;
}

.faq-item a {
  color: #5aa6b5;
  text-decoration: none;
}

.faq-item a:hover {
  text-decoration: underline;
}

/* ===== TERMS PAGE ===== */
.terms {
  max-width: 860px;
  margin: 0 auto;
}

.terms-title {
  font-size: 54px;
  font-weight: 600;
  color: #8f31c8;
  letter-spacing: 0.3px;
  margin: 10px 0 10px;
}

.terms-lead {
  margin: 0 0 28px;
  line-height: 1.75;
  font-size: 15px;
  color: #2b2b2b;
  max-width: 760px;
}

.terms-block {
  padding: 18px 0 10px;
}

.terms-block h2 {
  font-size: 20px;
  font-weight: 700;
  color: #2b2b2b;
  margin: 0 0 10px;
}

.terms-block p {
  margin: 0;
  line-height: 1.75;
  font-size: 15px;
  color: #2b2b2b;
  max-width: 760px;
}

.terms-list {
  margin: 12px 0 0 18px;
  color: #2b2b2b;
  line-height: 1.75;
  font-size: 15px;
}

.terms-list li {
  margin: 6px 0;
}

.terms a {
  color: #8f31c8;
  text-decoration: none;
}

.terms a:hover {
  text-decoration: underline;
}

.terms-foot {
  margin-top: 26px;
  color: #2b2b2b;
  font-size: 13px;
}

/* ===== Thumbnails wie Screenshot ===== */
.asset-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #9d94c5;
  min-height: 260px;
}

.img-texture {
  height: 220px;
  background: #b9b1db;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.texture-name {
  display: block;
  padding: 10px 12px;
  cursor: pointer;
  color: #1b1b1b;
  font-weight: 600;
}

.texture-title {
  display: block;
}

.texture-star {
  position: absolute;
  right: 10px;
  bottom: 12px;
  font-size: 16px;
  color: #e6e62f;
  cursor: pointer;
  user-select: none;
}



/* ===== MODAL BASIS ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.modal.open {
  display: block;
}

/* Hintergrund */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

/* Modal Box */
.modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1200px;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);

  display: flex;
  flex-direction: column;
}

/* Close Button */
.modal-close {
  position: absolute;
  color: #2c2832;
  top: 2px;
  right: 14px;
  background: transparent;
  border: none;
  font-size:36px;      /* etwas größer */
  font-weight: 600;     /* richtig fett */
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  
}
.modal-close:hover {
  color: #f62c2c;
  transform: scale(1.1);
}

/* Modal Bild grose vorschau / Preview  */
.modal-preview {
  width: 100%;
  height: 800px;           /* Feste Bildhöhe */
  background-color: #ced3de;
  background-size: contain; /* KEIN Strecken */
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;          /* Darf nicht schrumpfen */
}

/* Modal unterer Textbereich */
.modal-body {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap:1px;
  background-color: #ced3de;
  max-height: 250px;
  overflow-y: auto;
}

.modal-body h2 {
  margin: 0 0 2px;
  font-size: 20px;
  color: #3a395c;
}

.modal-body p {
  margin: 0 0 4px;
  color: #000000;
  white-space: pre-line; /* Enter/Zeilenumbrüche anzeigen */
}

/* Download Buttons */
.modal-body a {
  display: inline-block;
  padding: 6px 32px;
  background: #7285a1;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 22px;
  font-weight: 600;
  align-self: flex-end;
}
.modal-body a:hover {
  background: #91a5c2;
  color: #000000;
}

/* ===== UPLOAD PAGE ===== */
.upload {
  max-width: 920px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 12px;
  padding: 26px 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.upload-title {
  margin: 0 0 10px;
  font-size: 42px;
  font-weight: 700;
  color: #8f31c8;
  letter-spacing: 0.3px;
}

.upload-lead {
  margin: 0 0 22px;
  color: #666;
  line-height: 1.5;
}

.upload-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.label {
  font-weight: 700;
  color: #2b2b2b;
}

.field input,
.field textarea,
.field select {
  height: 42px;
  border-radius: 10px;
  border: 1px solid #d7d7de;
  padding: 0 12px;
  outline: none;
  background: #fbfbfd;
}

.field input:focus,
.field select:focus {
  border-color: #7285a1;
  box-shadow: 0 0 0 3px rgba(114, 133, 161, 0.18);
}

.hint {
  color: #7a7a7a;
  font-size: 13px;
  line-height: 1.4;
}

.tag-preview {
  margin-top: 10px;
}

.tag-preview-title {
  font-size: 12px;
  color: #777;
  display: inline-block;
  margin-bottom: 6px;
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: #e4e9f3;
  color: #111;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.upload-files {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.filebox {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed #cfd6e4;
  border-radius: 12px;
  background: #fbfbfd;
}

.filebox input[type="file"] {
  height: auto;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #d7d7de;
  background: #fff;
}

.img-preview-wrap {
  margin-top: 10px;
}

.img-preview-title {
  font-size: 12px;
  color: #777;
  margin-bottom: 6px;
}

.img-preview {
  display: none;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e2e2ea;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: #7285a1;
  color: #fff;
}

.btn-primary:hover {
  background: #5e6f88;
}

.btn-ghost {
  background: transparent;
  border-color: #cfd6e4;
  color: #333;
}

.btn-ghost:hover {
  background: #f3f6fb;
}

.mini-note {
  margin: 6px 0 0;
  color: #888;
  font-size: 12px;
}

@media (max-width: 860px) {
  .upload-files {
    grid-template-columns: 1fr;
  }
}

.empty-state{
  margin: 18px 0 0;
  color: #666;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .brand {
    display: none;
  }

  .top-actions {
    min-width: auto;
  }

  .main {
    height: auto;
  }
}

/* ===== ADMIN ASSET LIST ===== */

.admin-divider {
 margin: 26px 0;
 border: none;
 border-top: 1px solid #d7d7de;
}

.admin-assets-title {
 margin: 0 0 8px;
 font-size: 28px;
 color: #3a395c;
}

.admin-asset-list {
 display: grid;
 gap: 8px;
 margin-top: 14px;
}

.admin-asset-row {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 12px;
 padding: 10px 12px;
 background: #f3f6fb;
 border: 1px solid #d7d7de;
 border-radius: 10px;
}

.admin-asset-info {
 display: grid;
 gap: 3px;
}

.admin-asset-title {
 font-weight: 700;
 color: #222;
}

.admin-asset-meta {
 font-size: 12px;
 color: #666;
}

.admin-delete-btn {
 background: #b94a4a;
 color: #ffffff;
 border: none;
 border-radius: 8px;
 padding: 8px 12px;
 font-weight: 700;
 cursor: pointer;
}

.admin-delete-btn:hover {
 background: #8f2f2f;
}


/* ===== MOBILE MODAL FIX ===== */

@media (max-width: 860px) {
  .modal-card {
    width: calc(100vw - 20px);
    max-width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 10px;
  }

  .modal-preview {
    height: 55vh;
    min-height: 260px;
    max-height: 520px;
  }

  .modal-body {
    max-height: 35vh;
    padding: 10px 12px;
  }

  .modal-body h2 {
    font-size: 18px;
  }

  .modal-body p {
    font-size: 14px;
  }

  .modal-body a {
    font-size: 18px;
    padding: 8px 22px;
    align-self: stretch;
    text-align: center;
  }

  .modal-close {
    top: 6px;
    right: 10px;
    font-size: 34px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    width: 42px;
    height: 42px;
  }
}

/* ===== MOBILE CATEGORY BAR ===== */

@media (max-width: 860px) {
  .app {
    display: block;
  }

  .sidebar {
    display: block;
    position: sticky;
    top: 66px;
    z-index: 40;
    height: auto;
    max-height: 210px;
    overflow-y: auto;
    background: #b1b8c9;
    border-width: 1px;
    border-style: solid;
  }

  .sidebar-title {
    margin: 8px 10px 4px;
    font-size: 14px;
  }

  .sidebar-box details {
    margin: 0;
  }

  .sidebar-box summary {
    padding: 8px 10px;
  }

  .side-links {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 8px 10px 12px;
  }

  .side-links a {
    flex: 0 0 auto;
    white-space: nowrap;
    background: #ced3de;
    border: 1px solid #7285a1;
    border-radius: 999px;
    padding: 8px 12px;
    color: #000000;
  }

  .side-links a.active {
    background: #7285a1;
    color: #ffffff;
  }

  .side-links .right {
    margin-left: 6px;
  }

  .main {
    height: auto;
    min-height: calc(100vh - 66px);
    padding: 12px;
  }
}