: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 {
    color: #9ca3af;
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
  }

  form input[type="text"],
  form input[type="url"],
  form input[type="email"],
  form input[type="password"],
  form input[type="search"],
  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);
    box-sizing: border-box;
    color: var(--text-color);
    padding: 0.625rem 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
  }

  form input[type="text"]:focus,
  form input[type="url"]:focus,
  form input[type="email"]:focus,
  form input[type="password"]:focus,
  form input[type="search"]:focus,
  form textarea:focus {
    border-color: var(--accent-color-start);
    box-shadow: 0 0 0 3px rgba(25, 148, 173, 0.15);
    outline: none;
  }

  form input::placeholder,
  form textarea::placeholder {
    color: #4b5563;
  }

  form input[type="submit"],
  .cta-button {
    background-color: var(--accent-color-start);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    display: inline-block;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    text-decoration: none;
    transition: opacity 0.15s ease;
  }

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

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

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

    .link-secondary {
      color: var(--accent-color-start);
      display: inline-block;
      font-size: 0.875rem;
    }
  }
}

.form-card {
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: 1.5rem auto;
  max-width: 520px;
  padding: 2rem;

  h1, h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.75rem 0;
  }
}

.error-messages {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;

  h2 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
  }

  ul {
    margin: 0;
    padding-left: 1.25rem;

    li {
      font-size: 0.875rem;
    }
  }
}

.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-count {
  color: var(--link-text-color);
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.empty-state {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--link-text-color);
  padding: 3rem 1rem;
  text-align: center;

  p {
    margin: 0;
  }
}

.bookmarks-list {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;

  .bookmark-item {
    border-bottom: 1px solid var(--border-color);
    border-left: 3px solid transparent;
    background-color: var(--card-bg-color);
    padding: 0.875rem 1rem 0.75rem 1.125rem;
    transition: background-color 0.15s ease, border-left-color 0.15s ease;

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

    &:hover {
      background-color: #23292f;
      border-left-color: var(--accent-color-start);
    }

    &:hover .bookmark-actions {
      opacity: 1;
    }

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

      h2 {
        align-items: center;
        display: flex;
        font-size: 0.9375rem;
        font-weight: 500;
        gap: 0.5rem;
        line-height: 1.4;
        margin: 0 0 0.4rem 0;

        a {
          color: #81bfcb;
        }
      }

      .bookmark-notes {
        color: #94a5bc;
        font-size: 0.8125rem;
        line-height: 1.4;
        margin: 0.375rem 0 0 0;
        opacity: 0.85;
      }
    }
  }

  .bookmark-item-archived {
    opacity: 0.75;

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

  .bookmark-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0.35;
    transition: opacity 0.15s ease;
  }

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

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

  .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;
}

.bookmark-favicon {
  border-radius: 2px;
  flex-shrink: 0;
  opacity: 0.8;
}

.tag {
  background-color: rgba(25, 148, 173, 0.1);
  border-radius: 9999px;
  color: var(--accent-color-start);
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  text-decoration: none;
  transition: background-color 0.15s ease;

  &:hover {
    background-color: rgba(25, 148, 173, 0.22);
    color: var(--accent-color-start);
    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;

  input[type="search"] {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow);
    color: var(--text-color);
    font-size: 0.875rem;
    max-width: 600px;
    padding: 0.75rem;
    width: 100%;

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

    &::placeholder {
      color: var(--link-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-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;
}

.stats {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.stat {
  flex: 1;
}

.stat-label {
  color: #9ca3af;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-color);
}

.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;
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
}

.search-form {
  margin-bottom: 1.5rem;

  .search-input {
    font-size: 1.1rem;
  }
}

/* Landing page */

.landing-hero {
  padding: 5rem 1rem 4rem;
  text-align: center;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse at center top, rgba(25, 148, 173, 0.12) 0%, transparent 70%);
    pointer-events: none;
  }
}

.landing-title {
  background: linear-gradient(135deg, #e2e8f0 40%, var(--accent-color-start) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 1rem;
}

.landing-title-accent {
  color: var(--accent-color-start);
  -webkit-text-fill-color: var(--accent-color-start);
}

.landing-tagline {
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
}

.landing-description {
  color: var(--link-text-color);
  font-size: 0.9375rem;
  margin: 0 0 2.5rem;
}

.landing-cta {
  align-items: center;
  display: flex;
  gap: 0.875rem;
  justify-content: center;
}

.cta-button-lg {
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.625rem 1.5rem;
}

.cta-button-outline {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--link-text-color);
  font-size: 0.9375rem;
  padding: 0.625rem 1.5rem;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;

  &:hover {
    border-color: var(--accent-color-start);
    color: var(--text-color);
    text-decoration: none;
  }
}

.landing-features {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 1rem;
  padding-bottom: 3rem;
}

.feature-card {
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  text-align: center;
  transition: border-color 0.2s ease;

  &:hover {
    border-color: rgba(25, 148, 173, 0.4);
  }

  .feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.875rem;
  }

  h3 {
    color: var(--text-color);
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
  }

  p {
    color: var(--link-text-color);
    font-size: 0.875rem;
    line-height: 1.55;
    margin: 0;
  }
}
