:root {
  --accent-color-start: #1994ad;
  --bg-color: #0d1015;
  --border-color: #4b5563;
  --card-bg-color: #1f2328;
  --text-color: #f3f4f6;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --link-text-color: #9ca3af;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;

  a {
    color: var(--link-text-color);
    text-decoration: none;
    transition: color 0.2s ease;
  }

  a:hover {
    color: var(--text-color);
    text-decoration: none;
  }

  form label { display: block; }

  form input[type="text"],
  form input[type="url"],
  form input[type="email"],
  form input[type="password"],
  form textarea,
  .ts-wrapper.single.input-active .ts-control {
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem;
    width: 100%;
  }

  form input:focus {
    outline: none;
    border-color: var(--border-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
  }

  form input:placeholder {
    color: #6b7280;
  }

  form input[type="submit"],
  .cta-button {
    background-color: var(--accent-color-start);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
  }

  form input[type="submit"]:hover,
  .cta-button:hover {
    opacity: 0.9;
  }

  form input[type="email"]:focus,
  form input[type="password"]:focus {
    border-color: var(--accent-color-start);
    box-shadow: 0 0 0 2px var(--accent-color-start);
    outline: none;
  }

  .form-field { margin-bottom: 1.5rem; }

  .form-actions {
    margin-top: 2rem;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 1rem;

    .link-secondary {
      color: var(--accent-color-start);
      display: inline-block;
      padding-top: 0.25rem;
    }
  }
}

.container {
  margin: 0 auto;
  max-width: 960px;
  padding: 2rem 1rem;
  position: relative;
}

.header {
  margin-bottom: 4rem;
  text-align: center;

  h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
  }

  p {
    color: #9ca3af;
    font-size: 1.125rem;
    margin-bottom: 2rem;
  }
}

.flash-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 500px;
  width: 90%;

  .flash {
    border-radius: var(--radius-md);
    padding: 1rem 3rem 1rem 1rem;
    text-align: left;
    box-shadow: var(--card-shadow);
    position: relative;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
  }

  .flash.flash-enter {
    transform: translateY(0);
    opacity: 1;
  }

  .flash.flash-exit {
    transform: translateY(100px);
    opacity: 0;
  }

  .flash-notice {
    background-color: #22c55e;
    color: white;
  }

  .flash-alert {
    background-color: #ef4444;
    color: white;
  }

  .flash-close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .flash-close:hover {
    opacity: 1;
  }
}

.main-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.nav-spacer {
  flex: 1;
}

.nav-link {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.nav-link:hover {
  color: var(--text-color);
}

.nav-link.active {
  color: var(--text-color);
  border-bottom: 2px solid var(--accent-color-start);
  background: none;
}

.nav-search-button {
  background: none !important;
  border: none !important;
  color: var(--link-text-color) !important;
  padding: 0.25rem 0.5rem !important;
  cursor: pointer;
}

.nav-search-button:hover {
  color: var(--text-color) !important;
}

.bookmarks-list {
  .bookmark-item {
    display: block;
    padding: 1.25rem 1rem 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-bg-color);
    transition: background-color 0.2s ease;

    .bookmark-text-content {
      margin-bottom: 0.75rem;

      h3 {
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.5rem;
        margin: 0 0 0.5rem 0;

        a {color: #81bfcb; }
      }

      p {
        margin: 0 0 0.5rem 0;
        color: #94a5bc;
        font-size: 0.875rem;
        line-height: 1.2;
      }
    }
  }

  .bookmark-item-archived {
    opacity: 0.9;

    .bookmark-text-content {
      h3 {
        a { color: var(--link-text-color); }
      }
    }
  }

  .bookmark-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .action-links-left {
    display: flex;
    gap: 1rem;
    align-items: center;
  }

  .action-link {
    background: none;
    border: none;
    color: var(--link-text-color);
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
  }

  .action-link:hover {
    color: var(--text-color);
    text-decoration: none;
  }

  .action-link-danger:hover {
    color: #ef4444;
  }
}

.auth-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;

  a {
    background-color: var(--accent-color-start);
    border-radius: var(--radius-md);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
  }

  a:hover {
    opacity: 0.9;
    text-decoration: none;
  }

  .register-button {
    background-color: #31824f;
  }

  .register-button:hover {
    background-color: #15803d;
    opacity: 1;
  }
}

.edit-button {
  color: var(--text-color);
  opacity: 0.7;
}

.edit-button:hover {
  color: var(--accent-color-start);
  opacity: 1;
}

.bookmark-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.bookmark-domain {
  color: #94a5bc;
  line-height: 1.2;
}

.bookmark-tags {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.25rem 0.25rem;
  text-decoration: none;
}

/* Tom Select */
.ts-wrapper {
  padding: 0.25rem;

  .ts-dropdown {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);

    .ts-dropdown-content {
      .ts-option {
        &.active {
          background-color: var(--bg-color);
          color: var(--text-color);
        }
      }
    }

    .active {
      background-color: var(--bg-color);
      color: var(--text-color);
    }
  }
  .ts-control {
    background-color: var(--bg-color);
    color: var(--text-color);

    input {
      color: var(--text-color);
    }

    .item {
      border-radius: 0.3rem;
    }
  }
}

.quick-search-form.hidden {
  display: none;
}

/* Navbar Search Mode */
.quick-search-form.navbar-search-active {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--bg-color);
  margin: 0;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;

  .ts-wrapper {
    width: 100%;
    max-width: 600px;
  }

  .ts-wrapper {
    &.single .ts-control {
      background-color: var(--card-bg-color);
      color: var(--text-color);
      box-shadow: var(--card-shadow);
      min-height: auto;

      &:focus {
        border-color: var(--accent-color-start);
        box-shadow: 0 0 0 3px rgba(25, 148, 173, 0.2);
        outline: none;
      }

      input {
        background: transparent;
        border: none;
        color: var(--text-color);
        font-size: 0.875rem;
        outline: none;
        padding: 0;
        margin: 0;
        width: 100%;

        &::placeholder { color: var(--link-text-color); }
      }
    }
  }

  .ts-dropdown {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    max-height: 400px;
    overflow: hidden;

    .option {
      background-color: var(--card-bg-color);
      border-bottom: 1px solid var(--border-color);
      color: var(--text-color);
      padding: 1rem;

      &:last-child {
        border-bottom: none;
      }

      &:hover,
      &.active {
        background-color: var(--bg-color);
        color: var(--text-color);
      }
    }
  }
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;

  th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
  }

  thead th {
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
  }

  tbody tr:last-child th,
  tbody tr:last-child td {
    border-bottom: none;
  }
}

/* Sortable Table */
.table thead th a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;

  thead th a:hover {
    color: var(--accent-color-start);
  }

  thead th.sorted-asc a,
  thead th.sorted-desc a {
    color: var(--accent-color-start);
  }
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.card {
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-color);
  display: block;
  padding: 1.5rem;
  text-decoration: none;
  transition: all 0.2s ease;

  h3 {
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
  }

  &.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
  }

  .card.card-center {
    text-align: center;
    padding: 2rem;
  }

  .card-content { flex: 1; }
  .card-actions { flex-shrink: 0; }
}

.feature-cards .feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.mb-1 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 5rem; }

.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mt-5 { margin-top: 5rem; }

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