* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --danger-color: #e74c3c;
  --dark-bg: #1a1a1a;
  --header-bg: #1a1a1a;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --border-color: #e0e0e0;
  --bg-light: #f8f9fa;
  --white: #ffffff;
  --main-bg: #ffffff;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--main-bg);
  line-height: 1.6;
  /* Prevent font loading shifts */
  font-display: swap;
}

/* Header Styles */
.header {
  background-color: var(--header-bg);
  color: var(--white);
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}

.header-container {
  width: 100%;
  max-width: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: nowrap;
  position: relative;
  box-sizing: border-box;
  overflow: visible;
}

.header-search {
  flex: 1;
  min-width: 200px;
}

.header-search .search-wrapper {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
}

.header-search .search-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  outline: none;
  font-size: 0.9rem;
  background: transparent;
  color: var(--white);
}

.header-search .search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.header-search .search-button {
  background-color: transparent;
  color: var(--white);
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.header-search .search-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.logo {
  flex-shrink: 0;
  min-width: 0;
}

.logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 2px;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.nav-link {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.dropdown {
  cursor: pointer;
  position: relative; /* Required for absolute positioning of dropdown */
  z-index: 10000;
  /* Prevent layout shifts */
  contain: layout style paint;
}

.nav-link.dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.5rem;
  background: transparent;
  z-index: 10001;
}

.dropdown-menu {
  position: absolute; /* Changed from fixed to absolute - doesn't affect layout */
  top: 100%;
  left: 0;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  max-width: 320px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: visible;
  z-index: 99999;
  display: none !important; /* Force hidden to prevent CLS */
  padding: 0.5rem 0;
  pointer-events: none;
  white-space: nowrap;
  /* Prevent layout shifts - completely remove from layout flow */
  visibility: hidden;
  opacity: 0;
  contain: layout style paint;
  margin-top: 8px; /* Space from dropdown trigger */
}

/* Only show when explicitly active - prevent hover from causing CLS */
.dropdown.active .dropdown-menu {
  display: block !important;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Remove hover completely to prevent accidental showing */
.dropdown:hover .dropdown-menu {
  /* Don't show on hover - only on active class to prevent CLS */
}

.dropdown-item-wrapper {
  position: relative;
  z-index: 10004;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

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

.dropdown-item .dropdown-arrow {
  margin-left: auto;
  opacity: 0.6;
}

.dropdown-submenu {
  display: none !important; /* Force hidden to prevent CLS */
  position: fixed;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  max-width: 280px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: visible;
  z-index: 99999;
  margin-left: 0.5rem;
  padding: 0.5rem 0;
  white-space: nowrap;
  /* Prevent layout shifts */
  visibility: hidden;
  opacity: 0;
  contain: layout style paint;
}

.dropdown-item-wrapper:hover .dropdown-submenu {
  display: block !important;
  visibility: visible;
  opacity: 1;
}

.submenu-item {
  padding-left: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.submenu-item:hover {
  background-color: var(--bg-light);
  color: var(--text-primary);
}

.new-badge {
  background-color: var(--danger-color);
  color: var(--white);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 4px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.guest-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-login {
  background-color: #0D4A6B;
  color: var(--white);
}

.btn-login:hover {
  background-color: #0A3A55;
}

.btn-signup {
  background-color: var(--white);
  color: var(--header-bg);
}

.btn-signup:hover {
  background-color: #ecf0f1;
}

.btn-upload {
  background-color: #8B1A1A;
  color: var(--white);
}

.btn-upload:hover {
  background-color: #6B1414;
}

/* Mobile Header Styles */
.mobile-header-actions {
  display: none !important; /* Force hidden on desktop to prevent CLS */
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  min-width: 0;
  /* Prevent layout shifts */
  contain: layout style paint;
}

.mobile-search-btn,
.mobile-menu-btn {
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.mobile-search-btn:hover,
.mobile-menu-btn:hover {
  opacity: 0.8;
}

.mobile-menu-btn svg {
  transition: transform 0.3s ease;
}

/* Mobile Menu Overlay - Hidden by default to prevent CLS */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--header-bg);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  overflow-y: auto;
  display: none; /* Completely hidden to prevent layout shifts */
  opacity: 0;
  pointer-events: none; /* Prevent interaction when hidden */
}

.mobile-menu-overlay.active {
  display: block; /* Show when active */
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto; /* Enable interaction when active */
}

.mobile-menu-content {
  padding: 2rem 1.5rem;
  max-width: 100%;
}

/* Mobile Menu Header with Close Button */
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.05em;
}

.mobile-menu-close-btn {
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  width: 40px;
  height: 40px;
}

.mobile-menu-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-close-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

/* Mobile Search Section */
.mobile-search-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-search-wrapper {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.mobile-search-input {
  flex: 1;
  padding: 0.875rem 1rem;
  border: none;
  outline: none;
  font-size: 1rem;
  background: transparent;
  color: var(--white);
}

.mobile-search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.mobile-search-submit {
  background-color: transparent;
  color: var(--white);
  border: none;
  padding: 0.875rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.mobile-search-submit:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile Navigation */
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.mobile-nav-link {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  padding: 1rem 1rem;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-categories-toggle {
  cursor: pointer;
}

.categories-arrow {
  transition: transform 0.3s ease;
}

.mobile-categories-menu {
  display: none !important; /* Force hidden to prevent CLS */
  flex-direction: column;
  padding-left: 1.5rem;
  gap: 0.5rem;
  margin-top: 0.5rem;
  /* Prevent layout shifts */
  visibility: hidden;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  contain: layout style paint;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.mobile-categories-menu.active {
  display: flex !important;
  visibility: visible;
  opacity: 1;
  max-height: 2000px; /* Large enough for all categories */
}

.mobile-category-link {
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  opacity: 0.9;
}

/* Mobile User Actions */
.mobile-user-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  width: 100%;
}

.mobile-btn-login {
  background-color: #0D4A6B;
  color: var(--white);
}

.mobile-btn-login:hover {
  background-color: #0A3A55;
}

.mobile-btn-signup {
  background-color: var(--white);
  color: var(--header-bg);
}

.mobile-btn-signup:hover {
  background-color: #ecf0f1;
}

.mobile-btn-upload {
  background-color: #8B1A1A;
  color: var(--white);
}

.mobile-btn-upload:hover {
  background-color: #6B1414;
}

.mobile-btn-profile {
  background-color: var(--secondary-color);
  color: var(--white);
}

.mobile-btn-profile:hover {
  background-color: #27ae60;
}

.mobile-btn-logout {
  background-color: var(--danger-color);
  color: var(--white);
  border: none;
  font-family: inherit;
}

.mobile-btn-logout:hover {
  background-color: #c0392b;
}

/* Responsive - Hide desktop elements on mobile */
@media (max-width: 768px) {

  .desktop-nav,
  .desktop-search,
  .desktop-actions {
    display: none !important; /* Completely hide desktop elements on mobile */
  }

  .mobile-header-actions {
    display: flex !important; /* Show mobile elements only on mobile */
  }
  
  /* Ensure desktop dropdown is never visible on mobile */
  .dropdown-menu,
  .dropdown-submenu {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  .header-container {
    padding: 0 1rem;
    gap: 0.75rem;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .logo {
    flex: 0 0 auto;
    min-width: 0;
    overflow: hidden;
    max-width: calc(100% - 100px);
  }

  .logo a {
    font-size: 1.1rem;
    letter-spacing: 1px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-search-btn,
  .mobile-menu-btn {
    flex-shrink: 0;
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0.5rem;
  }

  .main-content {
    padding: 1rem 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    /* Reserve minimum space to prevent layout shifts on mobile */
    min-height: 500px;
  }

  .sounds-section {
    margin: 3rem 0;
    padding: 0;
    /* Reserve space to prevent layout shifts on mobile */
    min-height: 400px;
  }
}

/* Main Content - Reserve space to prevent CLS */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  background-color: var(--main-bg);
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  /* Reserve minimum space to prevent layout shifts */
  min-height: 600px;
  contain: layout style paint;
}


/* Hero Section */
.hero-section {
  text-align: center;
  margin: 1rem 0;
  /* Reserve space to prevent layout shifts */
  min-height: 120px;
  contain: layout style paint;
}

.main-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  /* Fixed line height to prevent font loading shifts */
  line-height: 1.3;
  min-height: 2.6em; /* Reserve space for 2 lines */
}

.main-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 900px;
  margin: 0 auto;
  /* Fixed line height to prevent font loading shifts */
  line-height: 1.6;
  min-height: 4.8em; /* Reserve space for 3 lines */
}

/* Sounds Section */
.sounds-section {
  margin: 4rem 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  /* Reserve space to prevent layout shifts */
  min-height: 500px;
  contain: layout style paint;
}

.section-header {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.section-divider {
  grid-column: 1 / -1;
  width: 100%;
  border: none;
  border-top: 2px solid #333;
  margin: 0 0 1.5rem 0;
}

/* Title spans first 10 columns */
.section-title-wrapper {
  grid-column: 1 / 11;
}

/* "See All" button in the 11th column, aligned to the right */
.section-header .see-all-button {
  grid-column: 11;
  justify-self: end;
}

.section-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.star-icon {
  font-size: 1.5rem;
  color: var(--header-bg);
  line-height: 1;
}

.section-icon {
  color: var(--header-bg);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.see-all-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--white);
  color: #0D4A6B;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border: 1.5px solid #0D4A6B;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.2;
  height: fit-content;
}

.see-all-button:hover {
  background-color: rgba(13, 74, 107, 0.05);
  transform: translateY(-1px);
}

.see-all-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: #0D4A6B;
  border-radius: 50%;
  flex-shrink: 0;
}

.see-all-icon svg {
  width: 12px;
  height: 12px;
  stroke: white;
  fill: none;
}

/* Sounds Grid - Fixed dimensions to prevent CLS */
.sounds-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 1.5rem 1rem;
  justify-items: center;
  max-width: 100%;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  overflow-x: hidden;
  padding: 0;
  margin: 0;
  /* Reserve space to prevent layout shifts */
  min-height: 400px; /* Approximate height for 2 rows on desktop */
  contain: layout style paint; /* Optimize rendering */
}

.sound-row-divider {
  grid-column: 1 / -1;
  width: 100%;
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.75rem 0;
}

/* Ensure grid items align properly - Fixed dimensions to prevent CLS */
.sounds-grid .instant {
  width: 100%;
  max-width: 110px;
  min-width: 0;
  min-height: 180px; /* Reserve space: button (110px) + text + icons */
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  contain: layout style paint; /* Optimize rendering */
}

/* Desktop - Hide mobile elements completely to prevent CLS */
@media (min-width: 769px) {
  /* Ensure mobile menu is completely hidden on desktop */
  .mobile-menu-overlay,
  .mobile-menu-content,
  .mobile-nav,
  .mobile-categories-menu,
  .mobile-search-section,
  .mobile-user-actions,
  .mobile-header-actions {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    contain: layout style paint;
  }
}

/* Limit to 4 rows on desktop (11 columns x 4 rows = 44 sounds) */
@media (min-width: 769px) {
  .sounds-grid>*:nth-child(n + 45) {
    display: none;
  }
}

/* Limit New section to 2 rows on desktop (11 columns x 2 rows = 22 sounds) */
@media (min-width: 769px) {
  #sounds-grid-new>*:nth-child(n + 23) {
    display: none;
  }
}

.no-sounds {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-size: 1.1rem;
}

.explore-more-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.explore-more-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: transparent;
  color: #0D4A6B;
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border: 2px solid #0D4A6B;
  border-radius: 6px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.explore-more-button:hover {
  background-color: rgba(13, 74, 107, 0.1);
  transform: translateY(-1px);
}

/* Additional Content Section */
.additional-content-section {
  margin: 4rem 0;
}

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

.content-card {
  background-color: var(--bg-light);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.content-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.category-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--white);
  color: var(--primary-color);
  text-decoration: none;
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.category-link:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

.features-list {
  list-style: none;
  padding: 0;
}

.features-list li {
  padding: 0.75rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  padding-left: 1.5rem;
}

.features-list li:last-child {
  border-bottom: none;
}

.features-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--secondary-color);
  font-weight: bold;
}

.content-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-color);
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.cta-button:hover {
  background-color: #2980b9;
  transform: translateY(-1px);
}

/* Footer */
.footer {
  background-color: var(--header-bg);
  color: var(--white);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

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

.footer-section h3,
.footer-section h4 {
  margin-bottom: 1rem;
}

.footer-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.footer-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
}

.footer-text {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

/* AdSense Container Styles */
.adsense-container {
  contain: layout style paint;
  transform: translateZ(0);
  min-height: 250px;
  width: 100%;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.adsense-container ins.adsbygoogle {
  display: block;
  width: 100%;
  min-height: 250px;
  contain: layout style paint;
  transform: translateZ(0);
}

.inline-adsense-container {
  height: 250px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  contain: layout style paint;
  overflow: hidden;
  transform: translateZ(0);
  margin: 1.5rem 0;
}

.inline-adsense-container ins.adsbygoogle {
  display: block;
  width: 100%;
  height: 250px;
  min-height: 250px;
  max-height: 250px;
  contain: layout style paint;
  transform: translateZ(0);
}

/* Responsive AdSense */
@media (max-width: 768px) {
  .adsense-container,
  .inline-adsense-container {
    min-height: 250px;
  }

  .adsense-container ins.adsbygoogle,
  .inline-adsense-container ins.adsbygoogle {
    min-height: 250px;
  }
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design - Additional mobile styles */
@media (max-width: 768px) {
  /* Header container styles are handled in the mobile header section above */

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

  .main-title {
    font-size: 1.4rem;
  }

  .sounds-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem 0.3rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
    /* Reserve space to prevent layout shifts on mobile */
    min-height: 350px; /* Approximate height for 4 rows on mobile */
  }

  /* Limit to 4 rows on mobile (4 columns x 4 rows = 16 sounds) */
  .sounds-grid>*:nth-child(n + 17) {
    display: none;
  }

  .sounds-grid .instant {
    max-width: 75px;
    width: 100%;
    min-width: 0;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .section-header {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 0.3rem;
    padding: 0;
    margin: 0 0 1rem 0;
  }

  .section-title-wrapper {
    grid-column: 1 / 4;
    min-width: 0;
    overflow: hidden;
  }

  .section-header .see-all-button {
    grid-column: 4;
    justify-self: end;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
  }

  .see-all-icon {
    width: 18px;
    height: 18px;
  }

  .see-all-icon svg {
    width: 10px;
    height: 10px;
  }

  .section-divider {
    margin: 0.5rem 0 1rem 0;
  }

  .sound-row-divider {
    grid-column: 1 / -1;
    margin: 0.5rem 0;
  }
}

/* Load More Button */
.load-more-container {
  display: flex;
  justify-content: center;
  margin: 3rem 0;
  padding: 2rem 0;
}

.load-more-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 2rem;
  background-color: #0D4A6B;
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(13, 74, 107, 0.3);
}

.load-more-button:hover {
  background-color: #0A3A55;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 74, 107, 0.4);
}

.load-more-button:active {
  transform: translateY(0);
}

.load-more-button svg {
  transition: transform 0.3s ease;
}

.load-more-button:hover svg {
  transform: translateX(4px);
}

.sound-item {
  width: 100%;
}

@media (max-width: 768px) {
  .load-more-button {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Sound Detail Page - Hide title and icons, make button 3x larger */
.sound-button-center .instant .instant-link.link-secondary {
  display: none !important;
}

.sound-button-center .instant .result-page-instant-sharebox {
  display: none !important;
}

.sound-button-center .instant {
  width: 330px !important;
}

.sound-button-center .instant .sprite-wrapper {
  width: 330px !important;
  height: 330px !important;
}

.sound-button-center .instant .button-ring {
  width: 330px !important;
  height: 330px !important;
  background-size: 660px 330px !important;
}

.sound-button-center .instant .sprite-wrapper.pressed .button-ring {
  background-position: -330px 0 !important;
}

.sound-button-center .instant .inner-btn {
  width: 296px !important;
  height: 293px !important;
}

@media (max-width: 768px) {
  .sound-button-center .instant {
    width: 225px !important;
  }

  .sound-button-center .instant .sprite-wrapper {
    width: 225px !important;
    height: 225px !important;
  }

  .sound-button-center .instant .button-ring {
    width: 225px !important;
    height: 225px !important;
    background-size: 450px 225px !important;
  }

  .sound-button-center .instant .sprite-wrapper.pressed .button-ring {
    background-position: -225px 0 !important;
  }

  .sound-button-center .instant .inner-btn {
    width: 192px !important;
    height: 192px !important;
  }
}


/* User Profile Dropdown */
.user-profile-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.user-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.user-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.user-dropdown-menu {
  position: fixed;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  display: none;
  flex-direction: column;
  z-index: 99999;
  padding: 0.5rem 0;
  z-index: 10001;
}

.user-profile-dropdown.active .user-dropdown-menu {
  display: flex;
}

.user-dropdown-item {
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

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

.logout-item {
  color: var(--danger-color) !important;
  border-top: 1px solid var(--border-color);
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}

/* Soundboard Info Section Refactored */
.soundboard-info-section {
  margin: 3rem 0;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.info-hero {
  text-align: center;
  margin-bottom: 4rem;
  background-color: var(--bg-light);
  padding: 3rem 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.info-hero h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.info-hero p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Common Section Container */
.section-container {
  margin-bottom: 5rem;
}

/* Features Section - Reduce top spacing */
.features-section {
  margin-top: -2rem;
}

.section-title-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
  text-align: center;
}

.section-icon-centered {
  color: var(--primary-color);
  width: 32px;
  height: 32px;
}

.section-container h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.section-subtitle {
  text-align: center;
  max-width: 900px;
  margin: -1rem auto 2.5rem auto;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* Personal Collection Section */
.personal-section {
  text-align: center;
  margin-bottom: 3rem;
  background-color: var(--white);
  padding: 2rem 1rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  overflow: hidden;
}

.personal-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.personal-section .section-title-centered {
  margin-bottom: 1.5rem;
}

.personal-section h3 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.personal-section .section-subtitle {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 0;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Main Benefits Grid (Who Benefits) */
.main-benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.benefit-card {
  background-color: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.benefit-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.benefit-card h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--bg-light);
  padding-bottom: 0.75rem;
}

.benefit-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.benefit-card ul {
  padding-left: 1.2rem;
  margin-top: 1rem;
}

.benefit-card li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-item {
  background-color: var(--white);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.feature-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.feature-icon {
  width: 32px;
  height: 32px;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.feature-title {
  font-weight: 700;
  color: #0D4A6B;
  font-size: 1.1rem;
}

.feature-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.feature-item .feature-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.feature-item .feature-icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

/* Category Details Grid */
.category-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.category-detail-card {
  background-color: var(--white);
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  transition: all 0.2s ease;
  height: 100%;
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

.category-detail-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  background-color: var(--bg-light);
}

.category-detail-card h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.category-detail-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

/* FAQ Accordion */
.faq-accordion {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.faq-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.faq-item summary {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.1rem;
  list-style: none;
  /* Hide default triangle */
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary .icon {
  font-size: 1.5rem;
  color: var(--primary-color);
  font-weight: 400;
  transition: transform 0.2s ease;
}

.faq-item[open] summary .icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 1.5rem 1.5rem 1.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 1rem;
  border-top: 1px solid transparent;
}

.faq-item[open] .faq-answer {
  border-top-color: var(--bg-light);
  padding-top: 1rem;
}

/* Responsive Design for Soundboard Info */
@media (max-width: 768px) {
  .section-container {
    margin-bottom: 3rem;
  }

  .info-hero {
    padding: 2rem 1rem;
  }

  .info-hero h2 {
    font-size: 1.8rem;
  }

  .main-benefits-grid,
  .features-grid,
  .category-details-grid {
    grid-template-columns: 1fr;
  }

  .category-pills {
    gap: 0.75rem;
  }

  .category-pill {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

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

/* Desktop: 3 columns for features */
@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet: 2 columns for categories */
@media (min-width: 768px) {
  .category-details-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 3 columns for categories */
@media (min-width: 1024px) {
  .category-details-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Animation for download spinner */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Toast notification animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* 2x2 Features Grid */
.features-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  list-style: none;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

.feature-item-2x2 {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
}

.feature-item-2x2::before {
  content: "✓";
  color: var(--primary-color);
  font-weight: bold;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
  .features-grid-2x2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .feature-item-2x2 {
    gap: 0.5rem;
  }
}

/* Unblocked Section - Reduce top spacing */
.unblocked-section {
  margin-top: -2rem;
}

/* FAQ Section - Reduce top spacing */
.faq-section {
  margin-top: -2rem;
}

/* PWA Install Button - DISABLED */
.pwa-install-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: none !important; /* Hide install button container */
  align-items: center;
  justify-content: center;
}

.pwa-install-button {
  display: none !important; /* Hide install button */
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background-color: #0D4A6B;
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 74, 107, 0.3);
  transition: all 0.3s ease;
}

.pwa-install-button:hover {
  background-color: #0A3A55;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 74, 107, 0.4);
}

.pwa-install-button:active {
  transform: translateY(0);
}

.pwa-install-button svg {
  width: 20px;
  height: 20px;
}

/* PWA Update Notification */
.pwa-update-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--dark-bg);
  color: var(--white);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 300px;
}

.pwa-update-notification p {
  margin: 0;
  font-size: 0.9rem;
}

.pwa-update-notification button {
  padding: 0.5rem 1rem;
  background-color: #0D4A6B;
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.pwa-update-notification button:hover {
  background-color: #0A3A55;
}

/* Hide install button on mobile when in standalone mode */
@media (max-width: 768px) {
  .pwa-install-container {
    top: 70px;
    right: 10px;
  }

  .pwa-install-button {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }

  .pwa-update-notification {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* PWA Safe Area Insets for iOS */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }

  .header {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}