* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #0a89ff;
  --bg-dark: #121212;
  --bg-darker: #1a1a1a;
  --text-light: #f5f5f5;
  --nav-bg: rgba(0, 0, 0, 0.87);
  --card-bg: #1a1a1a;
  --overlay-gradient: linear-gradient(
    to right,
    rgba(2, 2, 2, 0.747) 0%,
    rgba(0, 0, 0, 0.205) 60%
  );
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1980px;
  margin: 0 auto;
  width: 100%;
  padding: 0 24px;
}

.nav-center ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 24px;
}

.nav-center ul li a {
  text-decoration: none;
  color: white;
  font-size: 18px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-center ul li a:hover {
  color: var(--primary-color);
}

.nav-center a {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 10px;
  position: relative;
}

.nav-center a.active {
  color: var(--text-light);
  font-weight: 600;
  background-color: black;
}

.nav-center a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
  transition: transform 0.3s ease;
  transform: scaleX(0);
  transform-origin: left;
}

.nav-center a.active::after {
  transform: scaleX(1);
  box-shadow: 0 0 8px var(--primary-color);
}

.nav-center a:hover::after {
  transform: scaleX(1);
  box-shadow: 0 0 8px var(--primary-color);
}

.nav-left a {
  text-decoration: none;
  color: white;
  font-size: 24px;
  font-weight: bold;
  transition: color 0.3s ease;
}

.nav-left a:hover {
  color: var(--primary-color);
}

.logo-img {
  height: 130px;
  width: auto;
  display: block;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .logo-img {
  }
}

.nav-right {
  display: flex;
  align-items: center;
}

.search-form {
  display: flex;
  align-items: center;
  border-radius: 20px;
  border: 1px solid rgba(153, 12, 12, 0.15);
  background: linear-gradient(
    135deg,
    rgba(40, 40, 45, 0.6) 0%,
    rgba(28, 28, 30, 0.5) 100%
  );
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(75, 66, 66, 0.1), 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.search-form:focus-within {
  border-color: rgba(10, 137, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 0 3px rgba(10, 137, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-right input {
  background-color: transparent;
  color: rgb(255, 255, 255);
  border: none;
  width: 220px;
  max-width: 28vh;
  padding: 10px 14px;
  font-size: 14px;
}

.nav-right input::placeholder {
  color: rgba(255, 255, 255, 0.226);
  font-size: 14px;
}

.nav-right input:focus {
  outline: none;
}

.nav-right button {
  text-decoration: none;
  padding: 6px 12px;
  background-color: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-right button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.nav {
  display: flex;
  background-color: var(--nav-bg);
  height: 64px;
  align-items: center;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
}

.hero-overlay {
  position: absolute;
  top: 70%;
  left: 0;
  right: -35%;
  bottom: 0;
  background-image: linear-gradient(50deg, rgba(3, 3, 3, 0) 38%, #fffbfb00 0%);
}

.hero {
  height: 60vh;
  background-color: black;
  background: linear-gradient(0deg, #000000 0%, #1a1a1a 100%);
  background-image: url("art/anime-website-art.jpg");
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  color: white;
}

.hero a::before {
  content: "";
}

.hero-content {
  max-width: 600px;
  padding: 24px;
  z-index: 1;
}

.scroll-button-left {
  position: relative;
  background-color: tomato;
}

.scroll-button-right {
  position: relative;
  background-color: tomato;
}

.row-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-behavior: smooth;
  padding: 16px 0;
  scrollbar-width: none; /* Firefox */
}

.row-viewport::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.row-track {
  display: flex;
  gap: 16px;
  white-space: nowrap;
  flex-wrap: nowrap;
  padding-bottom: 8px;
  padding-left: 24px;
  padding-top: 12px;
}

.anime-card {
  width: 260px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 8px;
  flex: 0 0 auto;
  transition: transform 0.3s ease;
  will-change: transform;
  scroll-snap-align: start;
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-darker);
  cursor: pointer;
}
.anime-card:hover {
  transform: scale(1.08);
  z-index: 10;
  box-shadow: #1a1a1a 0px 0px 6px;
}

.anime-card:hover .overlay {
  opacity: 1;
  background-image: var(--overlay-gradient);
  transition: opacity 0.4s ease, background-image 0.4s ease;
}

.anime-card:hover .card-title-action {
  opacity: 1;
  transition: opacity 0.8s ease;
}

.primary-button {
  background-color: var(--bg-darker);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-right: 24px;
}

.overlay {
  position: absolute;
  transition: opacity 0.3s ease;
  opacity: 0;
  overflow: hidden;
  will-change: transform;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.card-title-action {
  position: absolute;
  bottom: 16px;
  left: 16px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  z-index: 1;
}

.card-action-button {
  background-color: var(--bg-darker);
  color: white;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, opacity 0.8s ease;
}

.card-action-button:hover {
  background-color: var(--primary-color);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  text-shadow: #000000 0px 0px 4px;
}

.primary-button:hover {
  background-color: var(--primary-color);
}
.primary-button:active {
  background-color: var(--primary-color);
}

.secondary-button {
  background-color: var(--text-light);
  color: black;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.secondary-button:hover {
  background-color: var(--primary-color);
  color: white;
}

body {
  background-color: var(--bg-dark);
  color: white;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  overflow-x: hidden;
}

h1 {
  margin: 24px 0;
  font-weight: 700;
  -webkit-text-stroke: var(--bg-dark) 1.5px;
  color: var(--text-light);
  text-shadow: 2px 2px 4px rgb(0, 0, 0);
}

.anime-row-title {
  margin: 16px 0;
  padding-left: 24px;
  font-weight: 600;
}

p {
  margin: 24px 0;
  color: var(--text-light);
  font-weight: 600;
  text-shadow: 2px 2px 4px rgb(0, 0, 0);
}

/* Search Results Overlay */
.search-results {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-dark);
  z-index: 99;
  overflow-y: auto;
  padding: 24px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-results.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bg-darker);
}

.search-results-header h2 {
  margin: 0;
  font-size: 24px;
}

#close-search {
  background: none;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
  transition: color 0.3s ease;
}

#close-search:hover {
  color: var(--primary-color);
}

.search-results-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

.search-card {
  background-color: var(--bg-darker);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.search-card-image {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background-color: var(--bg-dark);
}

.search-card-info {
  padding: 12px;
}

.search-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-card-meta {
  font-size: 12px;
  color: #999;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-card-score {
  color: var(--primary-color);
  font-weight: 600;
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-darker) 25%,
    #2a2a2a 50%,
    var(--bg-darker) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .anime-card {
    width: 220px;
  }
}

@media (max-width: 768px) {
  .nav-wrapper {
    flex-direction: column;
    gap: 16px;
    padding: 12px 16px;
  }

  .nav {
    height: auto;
    position: relative;
  }

  .nav-center ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .nav-center ul li a {
    font-size: 16px;
  }

  .nav-right input {
    width: 180px;
  }

  .anime-card {
    width: 150px;
  }

  .search-results-content {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
  }

  .hero {
    height: 40vh;
  }

  .hero-content {
    padding: 16px;
  }

  h1 {
    font-size: 24px;
  }

  p {
    font-size: 14px;
  }

  .primary-button,
  .secondary-button {
    padding: 8px 16px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .anime-card {
    width: 120px;
  }

  .row-track {
    padding-left: 16px;
  }

  .nav-center ul {
    gap: 8px;
  }

  .search-results-content {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
  }
}

/* iOS-Style Floating Island Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 32px);
  max-width: 400px;
  background: rgba(28, 28, 30, 0.75);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 16px;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 0.5px rgba(255, 255, 255, 0.05);
  animation: floatUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 4px;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  flex: 1;
  border-radius: 16px;
}

.mobile-nav-item.active {
  color: white;
  background: rgba(10, 137, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 20px rgba(10, 137, 255, 0.2),
    0 0 20px rgba(10, 137, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(10, 137, 255, 0.3);
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.mobile-nav-icon {
  width: 24px;
  height: 24px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  stroke-width: 2.5;
}

.mobile-nav-item.active .mobile-nav-icon {
  transform: translateY(-2px) scale(1.1);
  filter: drop-shadow(0 0 8px rgba(10, 137, 255, 0.6));
  stroke-width: 3;
}

.mobile-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}

.mobile-nav-item.active .mobile-nav-label {
  font-weight: 700;
  text-shadow: 0 0 10px rgba(10, 137, 255, 0.5);
}

.mobile-nav-indicator {
  display: none;
}

/* Mobile Search Button - Enhanced Liquid Glass */
.mobile-search-btn {
  display: none;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 101;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(40, 40, 45, 0.8) 0%,
    rgba(28, 28, 30, 0.7) 100%
  );
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 0.5px rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-search-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

.mobile-search-btn:active {
  transform: scale(0.92);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Mobile Search Overlay */
.mobile-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.mobile-search-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-search-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1002;
  background: linear-gradient(
    180deg,
    rgba(28, 28, 30, 0.98) 0%,
    rgba(28, 28, 30, 0.95) 100%
  );
  backdrop-filter: blur(50px) saturate(200%);
  -webkit-backdrop-filter: blur(50px) saturate(200%);
  padding: max(12px, env(safe-area-inset-top)) 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.mobile-search-container.active {
  transform: translateY(0);
}

.mobile-search-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mobile-search-input {
  flex: 1;
  background: linear-gradient(
    135deg,
    rgba(118, 118, 128, 0.3) 0%,
    rgba(118, 118, 128, 0.2) 100%
  );
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 14px 18px;
  color: white;
  font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.mobile-search-input:focus {
  outline: none;
  background: linear-gradient(
    135deg,
    rgba(118, 118, 128, 0.4) 0%,
    rgba(118, 118, 128, 0.3) 100%
  );
  border-color: rgba(10, 137, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 0 3px rgba(10, 137, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mobile-search-cancel {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
}

/* Glassmorphism Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(10, 137, 255, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(138, 43, 226, 0.12) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 20%,
      rgba(255, 0, 150, 0.1) 0%,
      transparent 50%
    );
  z-index: -1;
  animation: liquidMove 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes liquidMove {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(5%, 5%) scale(1.05);
  }
  50% {
    transform: translate(-3%, 3%) scale(0.95);
  }
  75% {
    transform: translate(3%, -5%) scale(1.03);
  }
}

/* Glass Card Effects - Hero overlay for glassmorphism */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 26, 26, 0.6) 0%,
    rgba(18, 18, 18, 0.8) 100%
  );
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

/* Update main content to have padding for bottom nav on mobile */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: block;
  }

  .mobile-search-btn {
    display: flex;
  }

  /* Hide desktop nav center on mobile */
  .nav-center {
    display: none !important;
  }

  /* Hide desktop search on mobile */
  .nav-right {
    display: none !important;
  }

  /* Adjust nav for mobile */
  .nav {
    height: 56px;
    background: rgba(28, 28, 30, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
  }

  .nav-wrapper {
    padding: 0 16px;
  }

  .nav-left .logo {
    font-size: 20px;
    font-weight: 700;
  }

  /* Add padding to main content for bottom nav */
  main {
    padding-bottom: 80px;
  }

  /* Glass effect on cards */
  .anime-card {
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }

  .anime-card:hover {
    box-shadow: 0 12px 40px rgba(10, 137, 255, 0.3);
  }

  /* Search results glass effect */
  .search-results {
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
  }

  .search-card {
    background: rgba(28, 28, 30, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
  }

  /* Section backgrounds */
  section[data-section="anime-row"] {
    background: rgba(18, 18, 18, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 16px 8px;
    padding: 16px 0;
  }

  .anime-row-title {
    padding-left: 16px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
  }
}

html {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}
