:root {
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-backdrop: blur(12px);
}

html[data-theme="dark"] {
  --glass-bg: rgba(20, 20, 30, 0.8);
}

* {
  scroll-behavior: smooth;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

html::-webkit-scrollbar {
  width: 8px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted);
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.04em;
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1.25rem;
}

h3 {
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  margin-bottom: 1rem;
}

p {
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

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

.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: var(--glass-backdrop);
  background-color: var(--glass-bg);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s var(--transition-smooth);
}

.hero-shell {
  position: relative;
  padding: 6rem 2rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero-shell {
    padding: 8rem 3rem;
    min-height: 600px;
    display: flex;
    align-items: center;
  }
}

.hero-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(89, 166, 255, 0.03) 50%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 150% 100% at 50% 0%, rgba(89, 166, 255, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

html[data-theme="light"] .hero-shell::before {
  background: linear-gradient(135deg, transparent 0%, rgba(9, 105, 218, 0.04) 50%, transparent 100%);
}

html[data-theme="light"] .hero-shell::after {
  background: radial-gradient(ellipse 150% 100% at 50% 0%, rgba(9, 105, 218, 0.05) 0%, transparent 70%);
}

.btHeroGrid {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .btHeroGrid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

.btHeroLeft {
  animation: fadeUpIn 0.8s var(--transition-smooth) 0.1s both;
}

.btHeroRight {
  animation: fadeUpIn 0.8s var(--transition-smooth) 0.3s both;
}

.btHeroRight > * {
  animation: float 3s ease-in-out infinite;
}

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}

.form-control, .form-select {
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--text);
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  transition: all 0.3s var(--transition-smooth);
}

.form-control:focus, .form-select:focus {
  border-color: var(--shape1-color);
  box-shadow: 0 0 0 3px rgba(89, 166, 255, 0.1);
  background-color: var(--bg);
  color: var(--text);
}

html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .form-select:focus {
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.input-group {
  position: relative;
}

.input-group .form-control {
  border-radius: 12px;
  backdrop-filter: var(--glass-backdrop);
  background-color: var(--glass-bg);
}

.input-group .btn {
  border-radius: 12px;
  margin-left: 0.5rem;
}

@media (max-width: 767px) {
  .input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .input-group .form-control {
    width: 100%;
  }

  .input-group .btn {
    width: 100%;
    margin-left: 0;
  }
}

.btn {
  border-radius: 10px;
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  transition: all 0.3s var(--transition-smooth);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.btn:active:not(:disabled) {
  transform: translateY(0px);
}

.btn:focus-visible {
  outline: 2px solid var(--shape1-color);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--shape1-color), var(--shape2-color, var(--shape1-color)));
  color: white;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 32px rgba(89, 166, 255, 0.25);
}

html[data-theme="light"] .btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 32px rgba(9, 105, 218, 0.2);
}

.btn-secondary {
  background-color: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--border);
  border-color: var(--border);
}

.btn-outline-primary {
  color: var(--shape1-color);
  border: 1.5px solid var(--shape1-color);
  background-color: transparent;
}

.btn-outline-primary:hover:not(:disabled) {
  background-color: rgba(89, 166, 255, 0.1);
  border-color: var(--shape1-color);
}

html[data-theme="light"] .btn-outline-primary:hover:not(:disabled) {
  background-color: rgba(9, 105, 218, 0.08);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background-color: var(--card-bg);
  transition: all 0.3s var(--transition-smooth);
  overflow: hidden;
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--shape1-color);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.card-body {
  padding: 2rem;
}

@media (max-width: 576px) {
  .card-body {
    padding: 1.5rem;
  }
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.card-text {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.card-text:last-child {
  margin-bottom: 0;
}

section {
  padding: 4rem 2rem;
}

@media (min-width: 768px) {
  section {
    padding: 6rem 3rem;
  }
}

section:nth-child(even) {
  background-color: var(--card-bg);
}

.home-most-used, #tool-categories, #saas-products, #instant-tools {
  animation: fadeUpIn 0.8s var(--transition-smooth) 0s both;
}

section:nth-child(n+3) {
  animation: fadeUpIn 0.8s var(--transition-smooth) 0s both;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1.5rem;
}

.section-title h2 {
  margin-bottom: 0.75rem;
  color: var(--text);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--shape1-color), transparent);
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 0;
}

.row {
  gap: 2rem;
}

@media (min-width: 768px) {
  .row {
    gap: 3rem;
  }
}

.col-md-6, .col-lg-4, .col-lg-3 {
  animation: fadeUpIn 0.6s var(--transition-smooth) forwards;
  opacity: 0;
}

.col-md-6:nth-child(1) { animation-delay: 0.1s; }
.col-md-6:nth-child(2) { animation-delay: 0.2s; }
.col-lg-4:nth-child(1) { animation-delay: 0.1s; }
.col-lg-4:nth-child(2) { animation-delay: 0.2s; }
.col-lg-4:nth-child(3) { animation-delay: 0.3s; }
.col-lg-3:nth-child(1) { animation-delay: 0.1s; }
.col-lg-3:nth-child(2) { animation-delay: 0.2s; }
.col-lg-3:nth-child(3) { animation-delay: 0.3s; }
.col-lg-3:nth-child(4) { animation-delay: 0.4s; }

.badge {
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  animation: gentle-pulse 2s ease-in-out infinite;
}

@keyframes gentle-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.badge-primary {
  background-color: var(--shape1-color);
  color: white;
}

.badge-secondary {
  background-color: var(--border);
  color: var(--text);
}

.footer {
  padding: 4rem 2rem 2rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

@media (min-width: 768px) {
  .footer {
    padding: 6rem 3rem 3rem;
    margin-top: 6rem;
  }
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.footer-section h6 {
  color: var(--text);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-section a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s var(--transition-smooth);
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.footer-section a:hover {
  color: var(--shape1-color);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 576px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

.social-links {
  display: flex;
  gap: 1.5rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--card-bg);
  color: var(--text-muted);
  transition: all 0.3s var(--transition-smooth);
}

.social-links a:hover {
  background-color: var(--shape1-color);
  color: white;
  transform: translateY(-3px);
}

.grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .grid {
    gap: 3rem;
  }
}

.grid-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-4 {
  grid-template-columns: 1fr;
}

@media (min-width: 576px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

a {
  color: var(--shape1-color);
  text-decoration: none;
  transition: color 0.3s var(--transition-smooth);
}

a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.list-group-item {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 1.25rem 1.5rem;
  transition: all 0.3s var(--transition-smooth);
}

.list-group-item:hover {
  background-color: var(--bg);
  transform: translateX(4px);
}

.list-group-item:first-child {
  border-radius: 12px 12px 0 0;
}

.list-group-item:last-child {
  border-radius: 0 0 12px 12px;
}

.list-group-item.active {
  background-color: var(--shape1-color);
  border-color: var(--shape1-color);
  color: white;
}

.nav-tabs {
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}

.nav-link {
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  padding: 1rem 1.5rem;
  transition: all 0.3s var(--transition-smooth);
}

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

.nav-link.active {
  color: var(--shape1-color);
  border-bottom-color: var(--shape1-color);
  background-color: transparent;
}

.modal-content {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 2rem;
}

.modal-title {
  color: var(--text);
  font-weight: 600;
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
}

.btn-close {
  filter: invert(var(--text));
  opacity: 0.5;
  transition: opacity 0.3s var(--transition-smooth);
}

.btn-close:hover, .btn-close:focus {
  opacity: 1;
}

.alert {
  border-radius: 12px;
  border: 1px solid;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background-color: rgba(26, 127, 55, 0.1);
  border-color: rgba(26, 127, 55, 0.3);
  color: var(--text);
}

.alert-warning {
  background-color: rgba(187, 128, 9, 0.1);
  border-color: rgba(187, 128, 9, 0.3);
  color: var(--text);
}

.alert-danger {
  background-color: rgba(218, 54, 38, 0.1);
  border-color: rgba(218, 54, 38, 0.3);
  color: var(--text);
}

.alert-info {
  background-color: rgba(9, 105, 218, 0.1);
  border-color: rgba(9, 105, 218, 0.3);
  color: var(--text);
}

.spinner-border {
  border-color: var(--border);
  border-right-color: var(--shape1-color);
}

.progress {
  background-color: var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: 6px;
}

.progress-bar {
  background: linear-gradient(90deg, var(--shape1-color), var(--shape2-color, var(--shape1-color)));
  transition: width 0.6s var(--transition-smooth);
}

.pagination {
  gap: 0.25rem;
}

.page-link {
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--shape1-color);
  background-color: var(--card-bg);
  transition: all 0.3s var(--transition-smooth);
  padding: 0.5rem 0.75rem;
}

.page-link:hover {
  background-color: var(--shape1-color);
  color: white;
  border-color: var(--shape1-color);
}

.page-item.active .page-link {
  background-color: var(--shape1-color);
  border-color: var(--shape1-color);
}

.page-item.disabled .page-link {
  color: var(--text-muted);
  background-color: var(--card-bg);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 0.5;
}

.dropdown-menu {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.5rem 0;
}

.dropdown-item {
  color: var(--text);
  padding: 0.75rem 1.25rem;
  transition: all 0.2s var(--transition-smooth);
}

.dropdown-item:hover {
  background-color: var(--bg);
  color: var(--shape1-color);
}

.dropdown-item.active {
  background-color: var(--shape1-color);
  color: white;
}

.dropdown-divider {
  background-color: var(--border);
  margin: 0.5rem 0;
}

.table {
  color: var(--text);
  border-color: var(--border);
}

.table thead th {
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1rem;
}

.table tbody td {
  border-color: var(--border);
  padding: 1rem;
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color 0.3s var(--transition-smooth);
}

.table tbody tr:hover {
  background-color: var(--bg);
}

.badge-info {
  background-color: rgba(9, 105, 218, 0.15);
  color: var(--shape1-color);
}

.badge-success {
  background-color: rgba(26, 127, 55, 0.15);
  color: #1a7f37;
}

.badge-warning {
  background-color: rgba(187, 128, 9, 0.15);
  color: #bb8009;
}

.badge-danger {
  background-color: rgba(218, 54, 38, 0.15);
  color: #da3622;
}

@media (max-width: 576px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  section {
    padding: 3rem 1.5rem;
  }

  .hero-shell {
    padding: 3rem 1.5rem;
    min-height: auto;
  }

  .section-title {
    margin-bottom: 2rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .footer {
    padding: 2rem 1.5rem 1rem;
  }

  .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
  }

  .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}