src/homepage.scss
// Homepage-specific styles
@use 'sass:color';

$neutral-50: #fafafa;
$neutral-100: #f5f5f5;
$neutral-150: #ededed;
$neutral-200: #e5e5e5;
$neutral-300: #d4d4d4;
$neutral-400: #a3a3a3;
$neutral-500: #737373;
$neutral-600: #525252;
$neutral-700: #404040;
$neutral-750: #333333;
$neutral-800: #262626;
$neutral-900: #171717;
$neutral-950: #0a0a0a;

// Variables
$primary-color: rgb(227, 42, 109);
$primary-dark: color.adjust($primary-color, $lightness: -10%);

$error-color: $primary-color;

// Base styles
html {
  font-size: 20px;
  height: 100%;

  @media only screen and (max-width: 768px) {
    font-size: 18px;
  }
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: $neutral-900;
  background-color: $neutral-100;
  height: 100%;
  min-height: 100vh;
  transition: background-color 0.3s ease;

  html.dark & {
    background-color: $neutral-900;
    color: $neutral-200;
  }
}

a {
  color: $neutral-900;

  html.dark & {
    color: $neutral-300;
  }
}

// App container
#app {
  box-sizing: border-box;
  margin: 0 auto;

  @media only screen and (max-width: 768px) {
    width: 100%;
    padding: 0;
    max-width: unset;
  }
}

// Generic form elements
input,
select {
  padding: 0.7rem;
  border: 1px solid $neutral-300;
  border-radius: 4px;
  font-size: 1rem;
  background-color: white;

  &:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 4px $neutral-100;
  }

  html.dark & {
    background-color: $neutral-750;
    border-color: $neutral-700;
    color: white;

    &:focus-visible {
      box-shadow: inset 0 0 0 4px $neutral-700;
    }
  }

  &.error {
    border-color: $error-color;
  }
}

// Buttons
button {
  border-radius: 4px;
  font-size: 1rem;
  padding: 0.8rem 1.5rem;
  background-color: $primary-color;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;

  &:hover {
    background-color: $primary-dark;
  }

  &:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 4px rgba($neutral-900, 0.2);
  }

  &:disabled {
    background-color: rgb(120, 120, 120);
    cursor: not-allowed;
  }
}

// Remove button (x)
.remove-button {
  background: none;
  border: none;
  color: $neutral-500;
  font-size: 1.2rem;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;

  &:hover {
    color: $error-color;
    background-color: transparent;
  }
}

// Error and notification styles
.error-message,
.input-error {
  color: $primary-color;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: rgba($primary-color, 0.1);
  border-radius: 4px;
  border-left: 3px solid $primary-color;
}

.hint,
.topics-hint,
.blocks-hint {
  font-size: 0.9rem;
  color: $neutral-600;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  font-style: italic;

  html.dark & {
    color: $neutral-400;
  }
}

.note,
.input-note {
  padding: 0.5rem;
  background-color: $neutral-150;
  border-radius: 4px;
  font-size: 0.9rem;
  color: $neutral-600;
  margin-top: 0.5rem;

  html.dark & {
    background-color: $neutral-750;
    color: $neutral-400;
  }
}

.input-help {
  font-size: 0.8rem;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  font-style: italic;
  color: $neutral-600;

  html.dark & {
    color: $neutral-400;
  }

  .relay-info {
    display: block;
    margin-top: 0.3rem;
    color: $neutral-500;
    font-size: 0.75rem;
  }
}

// Homepage container
.homepage {
  box-sizing: border-box;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background-color 0.5s ease;

  .homepage-body {
    box-sizing: border-box;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    width: 80%;
    max-width: 800px;
    min-height: 100vh;
    margin: 0 auto;

    @media only screen and (max-width: 768px) {
      padding-left: 0;
      padding-right: 0;
      width: 100%;
    }
  }

  &.initial-state {
    &::before,
    &::after {
      content: '';
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100vw;
      height: 100vh;
      z-index: -1;
    }

    &::before {
      background-image: url('../static/images/bg.jpg');
      background-size: cover;
      background-position: center;
      background-attachment: fixed;
      opacity: 1;
      transition: opacity 1s ease;

      html.dark & {
        opacity: 0.3;
      }
    }

    &::after {
      background-color: rgba(0, 0, 0, 0.2);
    }

    header {
      margin-top: 2rem;

      h1 {
        svg {
          max-width: 500px;
        }
      }
    }

    header {
      color: white;
      p {
        display: block;
        color: white;
        html.dark & {
          color: $neutral-300;
        }
      }
    }

    section {
      position: relative;
      margin-bottom: 0;

      background: none;
      box-shadow: none;

      html.dark & {
        background: none;
      }

      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba($neutral-900, 0.7);
        filter: blur(40px);
        z-index: -1;
        transition: all 1s ease;

        html.dark & {
          background-color: rgba($neutral-900, 0.9);
        }
      }

      h2 {
        font-size: 1.2rem;
        text-align: center;
        text-transform: uppercase;
      }

      input {
        &:focus-visible {
          outline: none;
          box-shadow: none;
        }
      }
    }

    .intro-help {
      display: block;
      text-align: center;
      margin-top: 1rem;
      padding-top: 0;
      padding-bottom: 0;

      &::before {
        background-color: rgba($neutral-900, 0.8);
      }

      p {
        line-height: 1.3rem;
        color: $neutral-200;

        html.dark & {
          color: $neutral-400;
        }

        a {
          color: $neutral-200;

          html.dark & {
            color: $neutral-400;
          }
        }
      }
    }

    footer {
      p {
        color: $neutral-300;

        html.dark & {
          color: $neutral-500;
        }
      }

      a {
        color: $neutral-300;
        html.dark & {
          color: $neutral-500;
        }
      }
    }
  }
}

// Theme switch
.theme-switch {
  position: absolute;
  top: 0rem;
  right: 0rem;
  z-index: 5;

  .initial-state & {
    filter: brightness(100%);
    html.dark & {
      filter: brightness(200%);
    }
  }
}

// Header
header {
  text-align: center;
  margin-bottom: 2rem;

  @media only screen and (max-width: 768px) {
    padding: 0 2rem;
  }

  h1 {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 3rem;
    line-height: 0.9;
    margin-top: 0;

    svg {
      max-width: 300px;

      @media only screen and (max-width: 768px) {
        max-width: 60%;
      }
    }

    @media only screen and (max-width: 768px) {
      font-size: 2rem;
    }
  }

  p {
    display: none;
    color: $neutral-700;
    font-size: 1.2rem;

    html.dark & {
      color: $neutral-400;
    }
  }
}

// Section (common)
section {
  margin-bottom: 3rem;
  padding: 2rem;
  border-radius: 12px;
  background-color: $neutral-50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);

  &.intro-help {
    display: none;
  }

  html.dark & {
    background-color: $neutral-800;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }

  h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    color: $primary-color;
  }

  h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
  }

  p {
    margin-top: 0;
    color: $neutral-600;
    margin-bottom: 1rem;

    html.dark & {
      color: $neutral-400;
    }
  }
}

// Option
.option {
  margin-bottom: 2rem;

  &:last-child {
    margin-bottom: 0;
  }

  input,
  select {
    width: 100%;
  }
}

// Input group
.input-group {
  display: flex;
  margin-bottom: 1rem;

  input {
    flex: 1;
    min-width: 0;
    border-radius: 4px 0 0 4px;
  }

  button {
    border-radius: 0 4px 4px 0;
    flex-shrink: 0;
  }
}

// User Info
.user-info {
  position: relative;
  display: flex;
  align-items: center;
  padding: 1rem;
  background-color: $neutral-150;
  border-radius: 8px;

  html.dark & {
    background-color: $neutral-750;
  }

  .loading-picture,
  .loading-text {
    background-color: $neutral-200;

    html.dark & {
      background-color: $neutral-700;
    }
  }

  .loading-picture {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .loading-text {
    height: 1.2rem;
    width: 80%;
    border-radius: 4px;
    margin-bottom: 0.5rem;

    &.small {
      width: 50%;
      height: 0.8rem;
    }
  }

  .user-picture {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 1rem;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .default-avatar {
      width: 100%;
      height: 100%;
      background-color: $neutral-150;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }

  .user-name {
    flex: 1;

    h3 {
      margin: 0;
      font-size: 1.2rem;
    }

    .user-id {
      display: block;
      font-size: 0.8rem;
      color: $neutral-500;
      margin-top: 0.3rem;
      overflow-wrap: anywhere;
    }
  }

  .remove-button {
    position: absolute;
    top: 5px;
    right: 5px;
  }
}

// Topics list
.topics-list {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  position: relative;

  @media (max-width: 576px) {
    display: block;
  }

  .wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

// Topic tag
.topic-tag {
  display: flex;
  align-items: center;
  background-color: $neutral-150;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: grab;
  transition: all 0.2s ease;

  html.dark & {
    background-color: $neutral-750;
  }

  &.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  }

  &.drop-target {
    border: 2px dashed $primary-color;
    background-color: rgba($primary-color, 0.1);

    html.dark & {
      background-color: rgba($primary-color, 0.15);
    }
  }

  .drag-handle {
    margin-right: 0.5rem;
    color: $neutral-400;
    cursor: grab;
    display: flex;
    align-items: center;

    html.dark & {
      color: $neutral-500;
    }

    svg {
      fill: currentColor;
    }
  }

  .topic-text {
    margin-right: 0.5rem;
  }

  .remove-button {
    width: 1.2rem;
    height: 1.2rem;
  }
}

/* Switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;

  input {
    opacity: 0;
    width: 0;
    height: 0;
  }

  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: $neutral-150;
    transition: 0.4s;
    border-radius: 34px;

    html.dark & {
      background-color: $neutral-500;
    }

    &:before {
      position: absolute;
      content: '';
      height: 26px;
      width: 26px;
      left: 4px;
      bottom: 4px;
      background-color: white;
      transition: 0.4s;
      border-radius: 50%;
    }
  }

  input:checked + .slider {
    background-color: $primary-color;
  }

  input:checked + .slider:before {
    transform: translateX(26px);
  }
}

// Blocks list
.blocks-list {
  h3 .hint {
    font-size: 0.8rem;
    font-weight: normal;
  }
}

// Block item
.block-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background-color: $neutral-150;
  border-radius: 6px;
  margin-bottom: 0.8rem;
  cursor: grab;
  transition: all 0.2s ease;

  html.dark & {
    background-color: $neutral-750;
  }

  &.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  }

  &.drop-target {
    border: 2px dashed $primary-color;
    background-color: rgba($primary-color, 0.1);

    html.dark & {
      background-color: rgba($primary-color, 0.15);
    }
  }

  .drag-handle {
    margin-right: 0.5rem;
    color: $neutral-400;
    cursor: grab;
    display: flex;
    align-items: center;

    html.dark & {
      color: $neutral-500;
    }

    svg {
      fill: currentColor;
    }
  }

  .block-type {
    font-weight: bold;
    margin-right: 1rem;
    text-transform: capitalize;
    min-width: 80px;
  }

  .block-details {
    flex: 1;
    color: $neutral-600;
    font-size: 0.9rem;

    html.dark & {
      color: $neutral-400;
    }

    .pinned-badge {
      display: inline-block;
      background-color: $primary-color;
      color: $neutral-50;
      font-size: 0.75rem;
      padding: 0.2rem 0.5rem;
      border-radius: 4px;
      font-weight: bold;
    }

    .event-id-preview {
      font-family: monospace;
      font-size: 0.8rem;
      color: $neutral-800;
      margin-left: 0.3rem;

      html.dark & {
        color: $neutral-400;
      }
    }
  }
}

// Add block
.add-block {
  margin-top: 2rem;

  h3 {
    border-bottom: 4px solid $neutral-150;
    padding-bottom: 0.5rem;

    html.dark & {
      border-bottom: 4px solid $neutral-750;
    }
  }

  .block-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;

    .common-options-row,
    .auto-select-row {
      display: grid;
      gap: 1rem;
      width: 100%;
    }

    .common-options-row {
      grid-template-columns: 1fr 1fr;

      @media (max-width: 576px) {
        grid-template-columns: 1fr;
      }
    }

    .auto-select-row {
      grid-template-columns: repeat(3, 1fr);

      @media (max-width: 992px) {
        grid-template-columns: repeat(2, 1fr);
      }

      @media (max-width: 576px) {
        grid-template-columns: 1fr;
      }
    }
  }

  .option-group {
    display: flex;
    flex-direction: column;

    label {
      margin-bottom: 0.5rem;
      font-size: 0.9rem;
      font-weight: bold;
    }
  }

  .pinned-ids-container {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 1rem;
  }

  .add-block-button {
    width: 100%;
  }
}

// Pinned events list
.pinned-events-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  width: 100%;
}

// Pinned event item
.pinned-event-item {
  display: flex;
  flex-direction: column;
  background-color: white;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid $neutral-300;

  html.dark & {
    background-color: $neutral-750;
    border-color: $neutral-700;
  }

  &.type-mismatch {
    border: 1px solid $primary-color;
    box-shadow: 0 0 3px rgba($primary-color, 0.5);

    .type-mismatch-indicator {
      background-color: rgba($primary-color, 0.1);
      color: $primary-color;
      padding: 4px 8px;
      font-size: 0.8rem;
      margin-top: 8px;
      border-radius: 4px;
      display: inline-block;
      font-weight: bold;
    }
  }
}

// Pinned preview container
.pinned-preview-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;

  &.image-preview {
    height: 150px;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  &.articles {
    .pinned-preview {
      padding: 15px;
    }
  }

  &.notes,
  &.images {
    .pinned-preview {
      padding: 15px;
      background-color: $neutral-50;
      font-style: italic;

      html.dark & {
        background-color: $neutral-800;
      }
    }
  }

  &.notes .pinned-preview {
    white-space: pre-line;
  }

  &.images .pinned-preview {
    text-align: center;
  }

  .pinned-preview.loading {
    color: $neutral-400;
    position: relative;

    &:after {
      content: '';
      display: inline-block;
      width: 12px;
      height: 12px;
      border: 2px solid $neutral-400;
      border-radius: 50%;
      border-top-color: transparent;
      animation: spin 1s linear infinite;
      margin-left: 10px;
      vertical-align: middle;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }
  }

  .remove-button {
    padding-right: 1rem;
  }
}

// Preview section
.preview-section {
  .wait {
    text-align: center;
  }

  .domain-preview {
    background-color: $neutral-150;
    border-radius: 8px;
    overflow-x: auto;

    html.dark & {
      background-color: $neutral-750;
    }

    code {
      font-family: monospace;
      font-size: 1rem;
      word-break: break-all;
    }
  }
}

// Action buttons
.action-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;

  .primary-button {
    display: inline-block;
    background-color: $primary-color;
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: bold;
    border: none;
    cursor: pointer;

    &:hover {
      background-color: $primary-dark;
    }
  }

  .secondary-button {
    display: inline-block;
    background-color: transparent;
    color: $primary-color;
    text-decoration: underline;
    cursor: pointer;

    &:hover {
      background-color: rgba($primary-color, 0.1);
    }

    html.dark & {
      color: white;

      &:hover {
        background-color: rgba(255, 255, 255, 0.1);
      }
    }
  }
}

// Extra options
.extra-options {
  margin-top: 2rem;
  border-top: 1px solid #eee;
  padding-top: 2rem;

  html.dark & {
    border-top-color: $neutral-700;
  }

  .download-option {
    margin-bottom: 2rem;
  }

  .domain-input {
    margin-bottom: 2rem;

    input {
      box-sizing: border-box;
      width: 100%;
    }
  }

  .dns-instructions {
    background-color: $neutral-150;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid $primary-color;

    html.dark & {
      background-color: $neutral-750;
    }

    p {
      margin-top: 0;
      margin-bottom: 0.5rem;
      font-weight: bold;
      font-size: 0.9rem;
    }

    .dns-code {
      position: relative;
      display: flex;
    }

    pre {
      margin: 0;
      padding: 0.8rem;
      background-color: white;
      border-radius: 4px;
      overflow-x: auto;
      font-family: monospace;
      font-size: 0.9rem;
      flex: 1;

      html.dark & {
        background-color: #222;
        color: #ddd;
      }
    }

    .copy-button {
      position: absolute;
      height: 100%;
      width: auto;
      right: 0px;
      top: 0px;
      background-color: transparent;
      border: none;
      padding: 0 1rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      color: $neutral-700;
      background: $neutral-200;

      &:hover {
        color: $primary-color;
        background-color: $neutral-300;
      }

      html.dark & {
        color: $neutral-400;
        background-color: $neutral-600;

        &:hover {
          color: $primary-color;
          background-color: $neutral-700;
        }
      }
    }
  }

  .dns-error {
    background-color: #fff4f7;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid $error-color;

    html.dark & {
      background-color: rgba($primary-color, 0.15);
      border-left-color: $primary-color;
    }

    p {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: $primary-color;
      font-size: 0.9rem;

      html.dark & {
        color: $primary-color;
      }

      &:last-child {
        margin-bottom: 0;
      }
    }
  }
}

// Footer
footer {
  margin-top: auto;
  text-align: center;
  padding-top: 2rem;

  p {
    color: $neutral-400;
    font-size: 0.9rem;

    html.dark & {
      color: $neutral-700;
    }
  }

  a {
    color: $neutral-400;

    html.dark & {
      color: $neutral-700;
    }
  }
}
