:root {
  --bg: #07101f;
  --bg-soft: #0b1629;
  --panel: #101d32;
  --panel-2: #14243d;
  --border: rgba(255, 255, 255, 0.1);

  --text: #f5f7fb;
  --text-soft: #aebbd0;
  --text-muted: #7f8ca2;

  --accent: #7c8cff;
  --accent-hover: #929fff;
  --danger: #ef5d68;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --header-height: 72px;
  --content-width: 1500px;

  --shadow:
    0 18px 50px rgba(0, 0, 0, 0.28);
}


/* =========================================================
   RESET
========================================================= */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;

  background:
    radial-gradient(
      circle at top,
      #10203b 0,
      #07101f 42%,
      #050b15 100%
    );

  color: var(--text);

  font-family:
    Inter,
    "Segoe UI",
    Arial,
    sans-serif;

  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

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

.hidden {
  display: none !important;
}


/* =========================================================
   COMMON
========================================================= */

.view {
  min-height: 100vh;
}

.page {
  width: min(
    calc(100% - 40px),
    var(--content-width)
  );

  margin: 0 auto;
  padding: 42px 0 80px;
}

.content-panel,
.settings-card {
  background: rgba(16, 29, 50, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.content-panel {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px;
}

.settings-card {
  padding: 24px;
}


/* =========================================================
   LOADING
========================================================= */

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: grid;
  place-items: center;

  background: #050b15;
}

.loading-box {
  text-align: center;
}

.loading-box h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 5vw, 56px);
}

.loading-box p {
  margin: 0;
  color: var(--text-soft);
}


/* =========================================================
   BUTTONS
========================================================= */

button {
  border: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  min-height: 42px;
  border-radius: var(--radius-sm);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
}

.primary-button,
.secondary-button,
.danger-button {
  padding: 10px 18px;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.danger-button {
  background: rgba(239, 93, 104, 0.14);
  border: 1px solid rgba(239, 93, 104, 0.35);
  color: #ff8992;
}

.danger-button:hover {
  background: rgba(239, 93, 104, 0.22);
}

.text-button {
  padding: 6px 4px;
  background: transparent;
  color: var(--text-soft);
}

.text-button:hover {
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
}


/* =========================================================
   FORMS
========================================================= */

label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-soft);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  outline: none;

  background: rgba(3, 10, 20, 0.72);
  color: var(--text);

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

input,
select {
  min-height: 44px;
  padding: 0 13px;
}

textarea {
  padding: 12px 13px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 140, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.13);
}

.form-error {
  margin: 14px 0 0;
  color: #ff8992;
}

.form-message {
  margin: 14px 0 0;
  color: #9ee7ba;
}


/* =========================================================
   TESTING BANNER
========================================================= */

.testing-banner {
  position: relative;
  z-index: 90;

  padding: 9px 18px;

  background: #b7791f;
  color: #fff;

  text-align: center;
  font-size: 13px;
  font-weight: 700;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;

  min-height: var(--header-height);

  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;

  padding: 0 max(24px, calc((100vw - var(--content-width)) / 2));

  background: rgba(5, 11, 21, 0.86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.brand {
  white-space: nowrap;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.main-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.nav-button {
  min-height: 40px;
  padding: 8px 13px;

  background: transparent;
  border-radius: var(--radius-sm);

  color: var(--text-soft);
  font-weight: 600;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.account-area {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* =========================================================
   HERO
========================================================= */

.hero {
  min-height: 390px;

  display: grid;
  place-items: center;

  background:
    linear-gradient(
      180deg,
      rgba(5, 11, 21, 0.22),
      rgba(5, 11, 21, 0.88)
    ),
    radial-gradient(
      circle at 50% 15%,
      #354267,
      #101a2d 48%,
      #07101f 100%
    );

  background-position: center;
  background-size: cover;
}

.hero-overlay {
  width: min(calc(100% - 40px), 1000px);
  padding: 72px 0 62px;
  text-align: center;
}

.hero h1 {
  margin: 0;

  font-size: clamp(44px, 7vw, 86px);
  line-height: 1;
  letter-spacing: -2px;

  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.42);
}

#hero-image-count,
#categories-image-count {
  color: var(--text-soft);
}

#hero-image-count {
  margin: 18px 0 28px;
  font-size: 17px;
}


/* =========================================================
   SEARCH
========================================================= */

.search-form {
  width: min(100%, 680px);
  margin: 0 auto;

  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;

  padding: 7px;

  background: rgba(4, 10, 19, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  backdrop-filter: blur(12px);
}

.search-form input {
  border: 0;
  background: transparent;
}

.search-form input:focus {
  box-shadow: none;
}

.search-form button {
  min-width: 90px;
  border-radius: 9px;
  background: var(--accent);
  font-weight: 700;
}

.category-quick-links {
  margin-top: 18px;

  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}


/* =========================================================
   SECTION HEADERS
========================================================= */

.section-header {
  min-height: 60px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;

  margin-bottom: 25px;
}

.section-header.centered {
  display: block;
  text-align: center;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(27px, 4vw, 38px);
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-actions select {
  width: auto;
  min-width: 145px;
}

.category-check-control {
  margin: 0;
}

.category-check-control label,
label.category-check-control {
  margin: 0;

  display: flex;
  align-items: center;
  gap: 9px;

  white-space: nowrap;
}

.category-check-control input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
}


/* =========================================================
   FEEDBACK
========================================================= */

#feedback-form {
  display: grid;
  gap: 13px;
}

#feedback-form .primary-button {
  margin-top: 8px;
}


/* =========================================================
   ACCOUNT SIDE PANEL
========================================================= */

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 300;

  width: min(430px, 100%);

  padding: 24px;

  overflow-y: auto;

  background: #0b1629;
  border-left: 1px solid var(--border);
  box-shadow: -25px 0 60px rgba(0, 0, 0, 0.4);
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 25px;
}

.side-panel-header h2 {
  margin: 0;
}

.side-panel-header button {
  width: 42px;
  height: 42px;

  background: transparent;
  color: var(--text-soft);

  font-size: 30px;
}

.side-panel > button {
  width: 100%;
  margin-top: 10px;
}


/* =========================================================
   MODAL
========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 500;

  display: grid;
  place-items: center;

  padding: 24px;

  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
}

.image-modal-content {
  position: relative;

  width: min(96vw, 1500px);
  max-height: 94vh;

  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 60px;
  align-items: center;

  padding: 22px;

  background: #08111f;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.image-preview-area {
  min-width: 0;
  text-align: center;
}

.image-preview-area img {
  max-width: 100%;
  max-height: 72vh;
  margin: 0 auto;

  object-fit: contain;
  border-radius: var(--radius);
}

.image-preview-area h2 {
  margin: 17px 0 12px;
}

.image-preview-area .primary-button {
  margin-top: 15px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 3;

  width: 42px;
  height: 42px;

  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;

  font-size: 30px;
}

.modal-navigation {
  width: 52px;
  height: 70px;

  background: transparent;
  border-radius: 12px;

  color: #fff;
  font-size: 48px;
}

.modal-navigation:hover {
  background: rgba(255, 255, 255, 0.08);
}


/* =========================================================
   CONFIRM DIALOG
========================================================= */

.confirm-dialog {
  width: min(520px, 100%);
  padding: 28px;

  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.confirm-dialog h2 {
  margin-top: 0;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;

  margin-top: 24px;
}


/* =========================================================
   MAINTENANCE
========================================================= */

.maintenance-container {
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  padding: 30px;

  text-align: center;

  background:
    radial-gradient(
      circle at center,
      #172744,
      #07101f 58%,
      #050b15
    );
}

.maintenance-container h1 {
  margin: 0 0 40px;
  font-size: clamp(38px, 7vw, 76px);
}

.maintenance-container h2 {
  margin: 0 0 14px;
  font-size: 30px;
}

.maintenance-container p {
  max-width: 600px;
  margin: 6px auto;
  color: var(--text-soft);
}


/* =========================================================
   SCROLLBAR
========================================================= */

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: #050b15;
}

::-webkit-scrollbar-thumb {
  background: #263650;
  border: 3px solid #050b15;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #354865;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1050px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 10px;

    padding: 13px 18px;
  }

  .main-navigation {
    grid-column: 1 / -1;
    grid-row: 2;

    justify-content: flex-start;
    overflow-x: auto;

    padding-bottom: 3px;
  }

  .nav-button {
    flex: 0 0 auto;
  }

  .hero {
    min-height: 330px;
  }
}


@media (max-width: 700px) {
  .page {
    width: min(calc(100% - 24px), var(--content-width));
    padding-top: 28px;
  }

  .site-header {
    position: relative;
  }

  .brand {
    font-size: 18px;
  }

  .account-area .secondary-button {
    padding: 8px 11px;
  }

  .hero {
    min-height: 300px;
  }

  .hero-overlay {
    width: calc(100% - 24px);
    padding: 55px 0;
  }

  .hero h1 {
    font-size: clamp(38px, 13vw, 58px);
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-form button {
    min-height: 42px;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .section-actions select {
    width: 100%;
  }

  .image-modal-content {
    width: 100%;
    max-height: 96vh;

    grid-template-columns: 42px minmax(0, 1fr) 42px;

    padding: 12px;
  }

  .modal {
    padding: 8px;
  }

  .modal-navigation {
    width: 40px;
    height: 58px;
    font-size: 38px;
  }

  .image-preview-area img {
    max-height: 65vh;
  }

  .content-panel {
    padding: 22px 17px;
  }
}
