/* Apple Liquid Glass Design System */
:root {
  /* Apple-inspired color palette */
  --glass-bg-primary: rgba(255, 255, 255, 0.05);
  --glass-bg-secondary: rgba(255, 255, 255, 0.08);
  --glass-bg-tertiary: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-border-strong: rgba(255, 255, 255, 0.25);
  
  /* Text colors */
  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.75);
  --text-tertiary: rgba(255, 255, 255, 0.55);
  
  /* Accent colors */
  --accent-primary: #007AFF;
  --accent-hover: #0056CC;
  --accent-active: #004299;
  
  /* Liquid glass effects */
  --glass-blur: blur(40px);
  --glass-blur-heavy: blur(60px);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --glass-shadow-heavy: 0 16px 64px rgba(0, 0, 0, 0.24);
  --glass-shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  
  /* Border radius */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  
  /* Card specific radius */
  --card--border-radius: 12px;
  
  /* Transitions */
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Enhanced Animation Curves */
  --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-back: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-quint: cubic-bezier(0.83, 0, 0.17, 1);
  --ease-bounce: cubic-bezier(0.68, -0.6, 0.32, 1.6);
  
  /* Haptic-like feedback durations */
  --haptic-light: 0.1s;
  --haptic-medium: 0.15s;
  --haptic-heavy: 0.2s;
  
  /* Legacy variables for compatibility */
  --ambient-base: #121212;
  --ambient-surface: var(--glass-bg-secondary);
  --ambient-text: var(--text-primary);
  --ambient-muted: var(--text-secondary);
  --ambient-accent: var(--accent-primary);
  --transition-standard: var(--transition-normal);
  --shadow-standard: var(--glass-shadow);
  --radius-standard: var(--radius-md);
}

/* Pricing Modal Scrollbar Styling */
.pricing-panel::-webkit-scrollbar {
  width: 6px;
}

.pricing-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.pricing-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.pricing-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Firefox scrollbar styling */
.pricing-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

/* Mobile responsive pricing modal */
@media (max-width: 768px) {
  .pricing-modal {
    align-items: stretch !important;
    padding: 0 !important;
  }
  
  .pricing-container {
    min-width: 100vw !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    height: 100vh !important;
  }
  
  .pricing-panel {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 2em 1.5em !important;
    border: none !important;
  }
  
  /* Hide scrollbar on mobile for cleaner look */
  .pricing-panel::-webkit-scrollbar {
    display: none !important;
  }
  
  .pricing-panel {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  
  /* Mobile button styling */
  #pricing-action-btn {
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
  }
  
  /* Adjust close button for mobile */
  #close-pricing-modal {
    top: 1em !important;
    right: 1em !important;
  }
}
    
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    html, body {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%; /* Ensure full viewport height */
      overflow: hidden; /* Prevent scrollbars from background */
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
      color: var(--ambient-text);
      background-color: var(--ambient-base);
      line-height: 1.5;
    }
    
    /* Transparent Navigation Bar */
    .navbar {
      position: fixed;
      top: 12px;
      left: 12px;
      right: 12px;
      height: 54px;
      background: transparent;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 24px;
      z-index: 1000;
      transition: var(--transition-normal);
      transform: translateY(0);
      opacity: 1;
    }

    @media (max-width: 767px) {
      .navbar {
        padding: 0;
      }
      
      #right-nav-btn span {
        display: none;
      }
      
      #right-nav-btn {
        position: relative;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px;
        width: 34px;
        height: 34px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
      }
      
      
      #right-nav-btn svg {
        display: none;
      }
    }

    /* Hide navbar in hide mode */
    .hide-ui .navbar {
      opacity: 0;
      transform: translateY(-20px);
      pointer-events: none;
    }

    .nav-left, .nav-right {
      flex: 1;
      display: flex;
    }

    .nav-left {
      justify-content: flex-start;
    }

    .nav-right {
      justify-content: flex-end;
    }

    .nav-center {
      flex: 0 0 auto;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .logo-container {
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      overflow: hidden;
      transition: var(--transition-bounce);
      cursor: pointer;
    }

    .logo-container:hover {
      transform: scale(1.1);
    }

    .logo-container:active {
      transform: scale(1.05);
      transition: var(--transition-fast);
    }

    .nav-logo {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 50%;
    }

    /* Dropdown Styles */
    .dropdown {
      position: relative;
    }

    .dropdown-menu {
      position: absolute;
      top: calc(100% + 12px);
      background: var(--glass-bg-primary);
      backdrop-filter: var(--glass-blur-heavy);
      -webkit-backdrop-filter: var(--glass-blur-heavy);
      border: 1px solid var(--glass-border);
      border-radius: var(--radius-xl);
      box-shadow: var(--glass-shadow-heavy), var(--glass-shadow-inset);
      min-width: 220px;
      opacity: 0;
      visibility: hidden;
      transform: translateY(-20px) scale(0.95);
      transition: var(--transition-normal);
      z-index: 1001;
      padding: 8px;
      overflow: hidden;
    }

    .dropdown.active .dropdown-menu {
      opacity: 1;
      visibility: visible;
      transform: translateY(0) scale(1);
    }

    .dropdown-menu.left {
      left: 0;
    }

    .dropdown-menu.right {
      right: 0;
      left: auto;
      /* Ensure dropdown doesn't go off-screen */
      max-width: calc(100vw - 20px);
      min-width: 220px;
      /* Use absolute positioning relative to dropdown container */
      position: absolute;
      /* Ensure dropdown's right edge aligns with button's right edge */
      transform: translateX(0);
    }

    @media (max-width: 768px) {
      .dropdown-menu.right {
        right: 10px;
        max-width: calc(100vw - 40px);
      }
    }

    @media (max-width: 480px) {
      .dropdown-menu.right {
        right: 10px;
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
      }
    }

    .dropdown-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      color: var(--text-primary);
      text-decoration: none;
      font-size: 14px;
      font-weight: 500;
      letter-spacing: -0.01em;
      transition: var(--transition-fast);
      border-radius: var(--radius-md);
      margin: 2px 0;
      position: relative;
      overflow: hidden;
      cursor: pointer;
    }

    .dropdown-item::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: var(--glass-bg-tertiary);
      opacity: 0;
      transition: var(--transition-fast);
      pointer-events: none;
    }

    .dropdown-item:hover {
      color: var(--accent-primary);
      transform: translateX(4px);
    }

    .dropdown-item:hover::before {
      opacity: 1;
    }

    .dropdown-item:active {
      transform: translateX(2px);
      transition: var(--transition-fast);
    }

    .dropdown-item svg {
      flex-shrink: 0;
      opacity: 0.7;
      transition: var(--transition-fast);
      z-index: 1;
      position: relative;
    }

    .dropdown-item:hover svg {
      opacity: 1;
      color: #ffffff;
      transform: scale(1.1);
    }

    .dropdown-divider {
      height: 1px;
      background: var(--glass-border);
      margin: 8px 8px;
      border-radius: 1px;
    }

    /* Apple-style Plus+ Button */
    .plus-btn {
      background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
      border: 1px solid var(--accent-primary);
      color: white;
      font-weight: 600;
      box-shadow: var(--glass-shadow-inset), 0 4px 16px rgba(0, 122, 255, 0.3);
      position: relative;
      overflow: hidden;
    }

    .plus-btn::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
      opacity: 0;
      transition: var(--transition-fast);
      pointer-events: none;
    }

    .plus-btn:hover {
      background: linear-gradient(135deg, var(--accent-hover), var(--accent-active));
      transform: translateY(-3px);
      box-shadow: var(--glass-shadow-inset), 0 8px 24px rgba(0, 122, 255, 0.4);
      border-color: var(--accent-hover);
    }

    .plus-btn:hover::before {
      opacity: 1;
    }

    .plus-btn:active {
      transform: translateY(-1px);
      transition: var(--transition-fast);
    }


    /* Player layout */
    .player-container {
      position: relative;
      height: 100vh;
      width: 100%;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      background-position: center;
      background-size: cover;
      background-repeat: no-repeat;
      transition: background-image var(--transition-slow) var(--ease-expo);
      overflow: hidden;
      padding-top: 78px; /* Account for new navbar positioning and margin */
      animation: pageLoad 0.8s var(--ease-expo) forwards;
    }

    /* Page Load Animation */
    @keyframes pageLoad {
      from {
        opacity: 0;
        transform: scale(0.98) translateY(20px);
        filter: blur(10px);
      }
      to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
      }
    }
    
    .background-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.7);
      transition: background-color 0.3s ease;
      z-index: 0;
      background-size: cover;
      background-position: center center;
      background-repeat: no-repeat;
    }
    
    .main-content {
      position: relative;
      z-index: 10;
      padding: 2rem;
      flex-grow: 1;
      display: flex;
      flex-direction: column;
      max-height: calc(100vh - 160px);
      overflow-y: auto;
      transition: opacity 0.3s ease, transform 0.3s ease;
      scrollbar-width: thin;
      margin-top: 0; /* Remove extra margin since we have padding-top on container */
    }
    
    .main-content::-webkit-scrollbar {
      width: 6px;
    }
    
    .main-content::-webkit-scrollbar-track {
      background: transparent;
    }
    
    .main-content::-webkit-scrollbar-thumb {
      background: var(--ambient-surface);
      border-radius: 10px;
    }
    
    /* Sound title */
    .sound-title {
      font-size: 2.5rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
      text-align: center;
      margin-top: 1rem;
    }
    
    /* Mode selector */
    .mode-selector {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, calc(-50% + 100px));
      z-index: 10;
      transition: all 0.3s ease;
    }
    
    .mode-selector-container {
      display: flex;
      justify-content: center;
      margin-top: 1rem;
    }

    /* Sounds grid */
    .sounds-title {
      font-size: 1.25rem;
      font-weight: 500;
      margin: 0.5rem 0;
      text-align: center;
    }
    
    .sound-grid {
      align-items: center;
      width: 100%;
      height: auto;
      display: flex;
      overflow: scroll;
      gap: 0rem;
      padding: 0.5rem 0;
      margin: 0;
      justify-content: center;
      max-width: 600px;
      margin-left: auto;
      margin-right: auto;
      position: fixed;
      bottom: 95px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 10;
      opacity: 0;
      animation: gridFadeIn 0.8s ease-out 0.3s forwards;
    }

    @keyframes gridFadeIn {
      from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
      }
    }
    
    .sound-grid::-webkit-scrollbar {
      display: none;
    }
    
    .sound-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.25rem;
      position: relative;
      transition: var(--transition-normal);
      width: 60px;
      margin-left: 0.4rem;
      margin-right: 0.4rem;
      opacity: 0;
      transform: translateY(30px) scale(0.8);
      animation: cardSlideUp 0.6s ease-out forwards;
    }

    /* Staggered animation for each card */
    .sound-card:nth-child(1) { animation-delay: 0.1s; }
    .sound-card:nth-child(2) { animation-delay: 0.15s; }
    .sound-card:nth-child(3) { animation-delay: 0.2s; }
    .sound-card:nth-child(4) { animation-delay: 0.25s; }
    .sound-card:nth-child(5) { animation-delay: 0.3s; }
    .sound-card:nth-child(6) { animation-delay: 0.35s; }
    .sound-card:nth-child(7) { animation-delay: 0.4s; }
    .sound-card:nth-child(8) { animation-delay: 0.45s; }

    @keyframes cardSlideUp {
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    /* Loading skeleton for sound cards */
    .sound-card.loading .sound-button {
      position: relative;
      pointer-events: none;
    }

    .sound-card.loading .sound-button img {
      opacity: 0;
    }

    .sound-card.loading .sound-button::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%
      );
      background-size: 200% 100%;
      border-radius: 50%;
      animation: skeletonShimmer 1.5s infinite ease-in-out;
      z-index: 3;
    }

    .sound-card.loading .sound-overlay {
      opacity: 0;
    }

    @keyframes skeletonShimmer {
      0% {
        background-position: -200% 0;
      }
      100% {
        background-position: 200% 0;
      }
    }

    /* Skeleton pulse effect */
    .sound-card.loading {
      animation: skeletonPulse 2s infinite ease-in-out;
    }

    @keyframes skeletonPulse {
      0%, 100% {
        opacity: 0.6;
        transform: translateY(0) scale(0.98);
      }
      50% {
        opacity: 0.8;
        transform: translateY(-2px) scale(1.02);
      }
    }
    
    .sound-card:hover:not(.loading) {
      transform: translateY(-8px) scale(1.05);
    }
    
    .sound-button {
      width: 100%;
      aspect-ratio: 1/1;
      border-radius: 50%;
      overflow: hidden;
      position: relative;
      cursor: pointer;
      background: var(--glass-bg-secondary);
      backdrop-filter: var(--glass-blur);
      -webkit-backdrop-filter: var(--glass-blur);
      border: 1px solid var(--glass-border);
      box-shadow: var(--glass-shadow), var(--glass-shadow-inset);
      transition: var(--transition-normal);
    }

    .sound-button::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.08) 100%
      );
      opacity: 0;
      transition: var(--transition-fast);
      pointer-events: none;
      z-index: 1;
    }

    .sound-button:hover {
      transform: translateY(-3px) scale(1.05);
      box-shadow: var(--glass-shadow-heavy), var(--glass-shadow-inset);
      border-color: var(--glass-border-strong);
    }

    .sound-button:hover::before {
      opacity: 1;
    }

    .sound-button:active {
      transform: translateY(-1px) scale(1.02);
      transition: var(--haptic-medium) var(--ease-bounce);
    }

    /* Sound button haptic ripple - Enhanced */
    .sound-button::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 0;
      height: 0;
      background: radial-gradient(circle, 
        rgba(0, 122, 255, 0.6) 0%, 
        rgba(0, 122, 255, 0.3) 30%,
        rgba(0, 122, 255, 0.1) 70%,
        transparent 100%
      );
      border-radius: 50%;
      transform: translate(-50%, -50%);
      transition: width var(--haptic-medium) var(--ease-expo), 
                  height var(--haptic-medium) var(--ease-expo),
                  opacity var(--haptic-medium) var(--ease-expo);
      opacity: 0;
      pointer-events: none;
      z-index: 1;
    }

    .sound-button:active::after {
      width: 140%;
      height: 140%;
      opacity: 1;
      transition: width var(--haptic-light) var(--ease-back), 
                  height var(--haptic-light) var(--ease-back),
                  opacity var(--haptic-medium) var(--ease-back);
    }

    /* Multi-layered ripple effect for strong feedback */
    .sound-button:active {
      transform: translateY(-1px) scale(1.02);
      transition: var(--haptic-medium) var(--ease-bounce);
      animation: strongHaptic 0.3s var(--ease-bounce);
    }

    @keyframes strongHaptic {
      0% { transform: translateY(-1px) scale(1.02); }
      25% { transform: translateY(-3px) scale(1.08); }
      50% { transform: translateY(-2px) scale(1.05); }
      75% { transform: translateY(-2.5px) scale(1.06); }
      100% { transform: translateY(-1px) scale(1.02); }
    }
    
    .sound-button.active {
      background: var(--glass-bg-tertiary);
    }
    
    
    .sound-button img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 50%;
      transition: var(--transition-normal);
      will-change: transform;
      transform: translateZ(0);
      backface-visibility: hidden;
      position: relative;
      z-index: 2;
    }
    
    .sound-button:hover img {
      transform: scale(1.08);
    }

    .sound-button.active img {
      transform: scale(1.05);
    }
    
    .sound-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: radial-gradient(circle, 
        rgba(0, 0, 0, 0.2) 0%, 
        rgba(0, 0, 0, 0.4) 100%
      );
      display: flex;
      justify-content: center;
      align-items: center;
      opacity: 0.7;
      transition: var(--transition-normal);
      z-index: 3;
      border-radius: 50%;
    }
    
    .sound-button:hover .sound-overlay {
      background: radial-gradient(circle, 
        rgba(0, 0, 0, 0.1) 0%, 
        rgba(0, 0, 0, 0.3) 100%
      );
      opacity: 0.6;
    }
    
    .sound-button.active .sound-overlay {
      background: radial-gradient(circle, 
        rgba(0, 122, 255, 0.1) 0%, 
        rgba(0, 0, 0, 0.2) 100%
      );
      opacity: 0.5;
    }
    
    .sound-indicator {
      position: absolute;
      bottom: -4px;
      left: 50%;
      transform: translateX(-50%) scaleX(0);
      width: 80%;
      height: 3px;
      background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-primary) 50%, 
        transparent 100%
      );
      border-radius: var(--radius-sm);
      transition: var(--transition-normal);
    }
    
    .sound-button.active .sound-indicator {
      transform: translateX(-50%) scaleX(1);
    }
    
    .sound-name {
      display: none;
    }
    
    .sound-button.active + .sound-name {
      color: rgba(255, 255, 255, 0.9);
      font-weight: 600;
    }
    
    /* Controls */
    .controls-container {
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 16px;
      padding: 12px;
      background: rgb(63 63 63 / 50%);
      backdrop-filter: blur(10px);
      border-radius: 50px;
      z-index: 9999;
      transition: all 0.3s ease;
  }
  
  .control-btn {
      position: relative;
      width: 48px;
      height: 48px;
      border-radius: 50%;
      border: none;
      background: transparent;
      overflow: hidden;
      color: white;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all var(--transition-fast) var(--ease-back);
      padding: 0;
      margin: 0;
  }

  /* Control button micro-interactions */
  .control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, 
      rgba(255, 255, 255, 0.15) 0%, 
      rgba(255, 255, 255, 0.05) 100%
    );
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--haptic-medium) var(--ease-expo);
    pointer-events: none;
  }

  .control-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, 
      rgba(255, 255, 255, 0.4) 0%, 
      rgba(255, 255, 255, 0.1) 100%
    );
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width var(--haptic-medium) var(--ease-expo), 
                height var(--haptic-medium) var(--ease-expo),
                opacity var(--haptic-medium) var(--ease-expo);
    opacity: 0;
    pointer-events: none;
  }
  
  .control-btn:hover {
      background: rgba(255, 255, 255, 0.1);
      transform: scale(1.05);
      transition: all var(--haptic-light) var(--ease-back);
  }

  .control-btn:hover::before {
    opacity: 1;
  }

  .control-btn:active {
    transform: scale(0.95);
    transition: all var(--haptic-light) var(--ease-bounce);
  }

  .control-btn:active::after {
    width: 120%;
    height: 120%;
    opacity: 1;
    transition: width var(--haptic-light) var(--ease-back), 
                height var(--haptic-light) var(--ease-back),
                opacity var(--haptic-medium) ease-out;
  }
  
  /* Prevent click events from overlapping */
  .control-btn svg {
      pointer-events: none;
  }
  
  /* Play button specific styles */
  .play-btn {
      width: 56px;
      height: 56px;
      position: relative;
  }
  
  .play-btn svg {
      width: 32px;
      height: 32px;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      transition: all 0.4s var(--ease-expo);
  }

  /* Smooth play/pause morphing animations */
  #play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }

  #pause-icon {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8) rotate(180deg);
  }

  /* When playing state */
  .play-btn.playing #play-icon {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8) rotate(-180deg);
    transition: all 0.4s var(--ease-expo);
  }

  .play-btn.playing #pause-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    transition: all 0.4s var(--ease-expo);
  }

  /* Enhanced play button states */
  .play-btn:hover {
    transform: scale(1.08);
  }

  .play-btn:active {
    transform: scale(0.98);
    transition: all var(--haptic-light) var(--ease-bounce);
  }

  
  /* Hide UI button */
  .hide-btn svg {
      width: 24px;
      height: 24px;
  }

  /* Sound library button */
  .sound-library-btn svg {
      width: 24px;
      height: 24px;
  }
  
  /* Theme button */
  .theme-btn svg {
      width: 24px;
      height: 24px;
  }
  
  /* Hidden state */
  .controls-container.hidden {
      opacity: 0;
      pointer-events: none;
  }

  /* Timer Button */
  .timer-btn svg {
      width: 24px;
      height: 24px;
  }

  /* Timer Container Styles */
  .timer-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    transition: var(--transition-normal);
  }

  .timer-container.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
  }

  /* Timer Type Switcher */
  .timer-type-switcher {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    justify-content: center;
  }

  .timer-type-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .timer-type-dot.active {
    background-color: var(--accent-primary);
    transform: scale(1.2);
  }

  .timer-type-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: var(--glass-bg-tertiary);
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    margin-bottom: 8px;
    border: 1px solid var(--glass-border);
  }

  .timer-type-dot-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .timer-type-dot-container:hover .timer-type-tooltip {
    opacity: 1;
  }

  /* Mode Switcher */
  .mode-switcher {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    margin-top: 0;
    justify-content: center;
    transition: all 0.3s ease;
  }

  .mode-switcher.hidden {
    max-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .mode-btn {
    padding: 0;
    border: none;
    font-size: 16px;
    cursor: pointer;
    background: none;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-weight: normal;
    position: relative;
  }

  .mode-btn.active {
    color: var(--text-primary);
    font-weight: 500;
  }

  .mode-btn.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--accent-primary);
  }

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

  /* Timer Display */
  .timer-display {
    margin-bottom: 16px;
    width: 100%;
    text-align: center;
    position: relative;
  }

  .time {
    font-size: 5rem;
    font-weight: bold;
    cursor: text;
    position: relative;
    color: var(--text-primary);
  }

  .timer-display:not(.disabled):hover .edit-hint {
    opacity: 1;
    transform: translateY(0);
  }

  .edit-hint {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    pointer-events: none;
  }

  .timer-display.disabled .time {
    cursor: default;
  }

  /* Goal Section */
  .goal-section {
    width: 100%;
    margin-top: 8px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
  }

  .goal-section.hidden {
    max-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .goal-divider {
    width: 100%;
    height: 0.5px;
    background-color: var(--glass-border);
  }

  .goal-input {
    width: 100%;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid var(--glass-border);
    font-size: 16px;
    font-family: inherit;
    background: transparent;
    text-align: center;
    transition: border-color 0.2s ease;
    color: var(--text-secondary);
  }

  .goal-input:focus {
    outline: none;
    border-bottom-color: var(--accent-primary);
    color: var(--text-primary);
  }

  .goal-input::placeholder {
    color: var(--text-tertiary);
    font-style: normal;
  }

  .time-input {
    font-size: 5rem;
    font-weight: bold;
    width: 100%;
    text-align: center;
    border: none;
    outline: none;
    background: none;
    color: var(--text-primary);
  }

  /* Progress Bar */
  .progress-bar {
    width: 100%;
    height: 12px;
    background: var(--glass-bg-primary);
    border-radius: 999px;
    margin-bottom: 32px;
    margin-top: 0px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
  }

  .progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    border-radius: 999px;
    width: 0%;
    transition: width 1s linear;
  }

  /* Timer Controls */
  .timer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: 100%;
  }

  .control-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }

  .adjust-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-primary);
  }

  .adjust-btn:hover {
    transform: scale(1.1);
    opacity: 0.7;
  }

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

  .start-btn {
    padding: 12px 24px;
    min-width: 100px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-primary);
    backdrop-filter: var(--glass-blur);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
  }

  .start-btn:hover {
    background: var(--glass-bg-secondary);
    transform: scale(1.05);
  }

  .pause-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-primary);
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }

  .pause-btn.visible {
    display: flex;
  }

  .pause-btn:hover {
    background: var(--glass-bg-secondary);
    transform: scale(1.05);
  }

  .restart-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-primary);
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }

  .restart-btn.visible {
    display: flex;
  }

  .restart-btn:hover {
    background: var(--glass-bg-secondary);
    transform: scale(1.05);
  }

  /* Cycle dots */
  .cycles-container {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
  }

  .cycles-container.hidden {
    display: none;
  }

  .cycle-dot {
    width: 16px;
    height: 16px;
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: var(--glass-bg-primary);
  }

  .cycle-dot.half-filled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background-color: var(--accent-primary);
  }

  .cycle-dot.full-filled {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
  }

  /* Timer Settings Modal */
  .timer-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }

  .timer-settings-modal.open {
    display: flex;
  }

  .settings-content {
    background: var(--glass-bg-secondary);
    backdrop-filter: var(--glass-blur-heavy);
    -webkit-backdrop-filter: var(--glass-blur-heavy);
    padding: 32px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow-heavy);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    position: relative;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .settings-content::-webkit-scrollbar {
    display: none;
  }

  .settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
  }

  .settings-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
  }

  .close-btn:hover {
    color: var(--text-primary);
  }

  .settings-group {
    margin-bottom: 20px;
  }

  .settings-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
  }

  .settings-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: border-color 0.2s ease;
    background: var(--glass-bg-primary);
    color: var(--text-primary);
  }

  .settings-input:focus {
    outline: none;
    border-color: var(--accent-primary);
  }

  /* Compact Grid Layout */
  .settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }

  .settings-group-compact {
    display: flex;
    flex-direction: column;
  }

  .settings-label-compact {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-align: left;
  }

  .settings-input-compact {
    width: 100%;
    padding: 8px;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    text-align: left;
    transition: border-color 0.2s ease;
    background: var(--glass-bg-primary);
    color: var(--text-primary);
  }

  .settings-input-compact:focus {
    outline: none;
    border-color: var(--accent-primary);
  }

  /* Sound Input Container */
  .sound-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .sound-select {
    flex: 1;
  }

  .play-sound-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-primary);
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: var(--text-primary);
  }

  .play-sound-btn:hover {
    background: var(--glass-bg-secondary);
  }

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

  /* Preset Buttons */
  .preset-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .preset-btn {
    padding: 8px 16px;
    border: 2px solid var(--glass-border);
    background: var(--glass-bg-primary);
    border-radius: var(--radius-xs);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 100px;
    color: var(--text-primary);
  }

  .preset-btn:hover {
    border-color: var(--glass-border-strong);
    background: var(--glass-bg-secondary);
  }

  .preset-btn.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: white;
  }

  /* Settings Divider */
  .settings-divider {
    width: 100%;
    height: 1px;
    background-color: var(--glass-border);
    margin: 20px 0;
  }

  /* iOS Switch Styles */
  .ios-switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .ios-switch-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
  }

  .ios-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
  }

  .ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }

  .ios-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(120, 120, 128, 0.16);
    transition: 0.4s;
    border-radius: 31px;
    border: 1px solid rgba(120, 120, 128, 0.16);
  }

  .ios-switch-slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 1px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
  }

  .ios-switch input:checked + .ios-switch-slider {
    background-color: #34C759;
    border-color: #34C759;
  }

  .ios-switch input:focus + .ios-switch-slider {
    box-shadow: 0 0 1px #34C759;
  }

  .ios-switch input:checked + .ios-switch-slider:before {
    transform: translateX(20px);
  }

  /* Dark mode adjustments for iOS switch */
  .ios-switch-slider:before {
    background-color: white;
  }

  /* Settings Actions */
  .settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
  }

  .settings-btn-secondary {
    padding: 10px 20px;
    border: 2px solid var(--glass-border);
    background: var(--glass-bg-primary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
  }

  .settings-btn-secondary:hover {
    border-color: var(--glass-border-strong);
    background: var(--glass-bg-secondary);
  }

  .settings-btn-primary {
    padding: 10px 20px;
    border: none;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }

  .settings-btn-primary:hover {
    background: var(--accent-hover);
  }

  /* Icons */
  .icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .icon-small {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Mobile Responsive */
  @media (max-width: 480px) {
    .timer-container {
      width: 95%;
      padding: 1.5rem;
    }
    
    .time {
      font-size: 4rem;
    }
    
    .settings-content {
      width: 95%;
      padding: 24px;
      max-height: 85vh;
    }
    
    .settings-grid {
      gap: 12px;
    }
    
    .settings-input-compact {
      padding: 6px;
      font-size: 13px;
    }
    
    .settings-label-compact {
      font-size: 11px;
    }
    
    .preset-btn {
      padding: 6px 12px;
      font-size: 13px;
      min-width: 80px;
    }
  }
  
  .sound-grid.hidden {
      opacity: 0;
      pointer-events: none;
  }

  /* Insights Dashboard Styles */
  .back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
  }

  .back-btn:hover {
    background: var(--glass-bg-primary);
  }

  .insights-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
  }

  .insights-stat-card {
    text-align: center;
  }

  .insights-stat-time {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
  }

  .insights-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    opacity: 0.6;
  }

  /* Period Toggle */
  .insights-period-toggle {
    display: flex;
    background: var(--glass-bg-primary);
    border-radius: 24px;
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
  }

  .period-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .period-btn.active {
    background: var(--glass-bg-tertiary);
    color: var(--text-primary);
  }

  /* Period Navigation */
  .insights-period-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 16px;
  }

  .period-nav-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--glass-bg-primary);
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
  }

  .period-nav-btn:hover {
    background: var(--glass-bg-secondary);
    transform: scale(1.05);
  }

  .period-display {
    flex: 1;
    text-align: center;
    background: var(--glass-bg-primary);
    border-radius: 12px;
    padding: 12px 16px;
  }

  .period-main {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
  }

  .period-sub {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.7;
  }

  /* Chart Tabs */
  .insights-chart-tabs {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--glass-border);
  }

  .chart-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    padding: 0 0 12px 0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
  }

  .chart-tab.active {
    color: var(--text-primary);
  }


  /* Chart Container */
  .insights-chart-container {
    margin-bottom: 32px;
    min-height: 200px;
  }

  .insights-chart {
    position: relative;
    width: 100%;
    height: 200px;
  }

  /* Week Chart Styles */
  .week-chart {
    display: flex;
    align-items: end;
    justify-content: space-between;
    height: 160px;
    padding: 0 8px;
    gap: 12px;
  }

  .week-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
  }

  .week-bar-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    min-height: 16px;
  }

  .week-bar {
    width: 100%;
    background: var(--glass-bg-primary);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    flex: 1;
    max-width: 32px;
  }

  .week-bar-fill {
    width: 100%;
    background: white;
    border-radius: 20px;
    position: absolute;
    bottom: 0;
    transition: height 0.3s ease;
  }

  .week-bar-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
    opacity: 0.6;
  }

  /* Month Chart Styles */
  .month-chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding: 16px 0;
  }

  .month-day {
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--glass-bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
  }

  .month-day.has-data {
    background: var(--glass-bg-secondary);
  }

  .month-day-time {
    font-size: 8px;
    color: var(--text-secondary);
    position: absolute;
    top: -12px;
    white-space: nowrap;
  }

  .month-day-number {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.6;
  }

  .month-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 12px;
  }

  .month-label {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.6;
  }

  /* Download Button */
  .insights-download-btn {
    width: 100%;
    padding: 16px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-bottom: 8px;
  }

  .insights-download-btn:hover {
    background: #0056CC;
    transform: translateY(-1px);
  }

  .insights-download-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.6;
  }

  /* Mobile Responsive */
  @media (max-width: 480px) {
    .insights-stats-grid {
      gap: 12px;
    }
    
    .insights-stat-time {
      font-size: 18px;
    }
    
    .insights-chart-tabs {
      gap: 24px;
    }
    
    .week-chart {
      gap: 8px;
      padding: 0 4px;
    }
    
    .month-chart {
      gap: 6px;
    }
  }
  
  /* Unhide button */
  .unhide-button {
      position: fixed !important;
      bottom: 20px !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      background: rgba(0, 0, 0, 0.8) !important;
      border: none !important;
      border-radius: 50% !important;
      width: 48px !important;
      height: 48px !important;
      cursor: pointer !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      color: white !important;
      z-index: 10000 !important;
      transition: all 0.3s ease !important;
      backdrop-filter: blur(10px) !important;
      visibility: visible !important;
      opacity: 1 !important;
  }
  
  .unhide-button:hover {
      background: rgba(0, 0, 0, 0.7) !important;
  }

  /* Specific rule for unhide button ID */
  #unhide-btn,
  body.hide-ui #unhide-btn {
      position: fixed !important;
      bottom: 20px !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      background: rgba(0, 0, 0, 0.8) !important;
      border: none !important;
      border-radius: 50% !important;
      width: 48px !important;
      height: 48px !important;
      cursor: pointer !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      color: white !important;
      z-index: 99999 !important;
      transition: all 0.3s ease !important;
      backdrop-filter: blur(10px) !important;
      visibility: visible !important;
      opacity: 1 !important;
      pointer-events: auto !important;
  }

  /* Ensure background overlay is always visible */
  #background-overlay,
  .background-overlay,
  body.hide-ui #background-overlay,
  body.hide-ui .background-overlay {
      display: block !important;
      visibility: visible !important;
      opacity: 1 !important;
  }
  
  /* Sound library styles */
  .sound-library {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      background: rgba(0, 0, 0, 0.9);
      transform: translateY(100%);
      transition: transform 0.3s ease;
      z-index: 200;
  }
  
  .sound-library.active {
      transform: translateY(0);
  }
  
  /* Theme modal styles */
  .theme-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.8);
      backdrop-filter: blur(10px);
      z-index: 300;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
  }
  
  .theme-modal.visible {
      opacity: 1;
      pointer-events: auto;
  }
    
    /* Remove the glass panel styles */
    .glass-panel {
      display: none;
    }
    
    .controls {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    
    /* Specific button states */
    #hide-ui-btn.active {
      border-color: rgba(255, 255, 255, 0.4);
    }

    #sound-library-btn.active {
      border-color: rgba(255, 255, 255, 0.4);
    }
    
    /* Mobile adjustments */
    @media (max-width: 480px) {
      .controls-container {
        bottom: 30px;
        gap: 8px;
        z-index: 9999;
      }
      
      .control-btn {
        width: 44px;
        height: 44px;
      }
      
      .play-btn {
        width: 52px;
        height: 52px;
      }
      
      .control-btn svg {
        width: 22px;
        height: 22px;
      }
      
      .play-btn svg {
        width: 28px;
        height: 28px;
      }
    }
    
    /* Hover effects for touch devices */
    @media (hover: none) {
      .control-btn:active {
        transform: scale(0.95);
      }
    }
    
    /* Dialogs */
    .dialog {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }
    
    .dialog.active {
      opacity: 1;
      visibility: visible;
    }
    
    .dialog-content {
      width: 90%;
      max-width: 600px;
      max-height: 90vh;
      overflow-y: auto;
      border-radius: 16px;
      padding: 24px;
      position: relative;
    }
    
    .dialog-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 24px;
    }
    
    .dialog-header h2 {
      margin: 0;
      color: #fff;
      font-size: 24px;
    }
    
    .close-btn {
      background: var(--glass-bg-secondary);
      backdrop-filter: var(--glass-blur);
      -webkit-backdrop-filter: var(--glass-blur);
      border: 1px solid var(--glass-border);
      color: var(--text-primary);
      font-size: 20px;
      cursor: pointer;
      padding: 8px;
      border-radius: 50%;
      transition: var(--transition-fast);
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: var(--glass-shadow-inset);
    }
    
    .close-btn:hover {
      background: var(--glass-bg-tertiary);
      border-color: var(--glass-border-strong);
      transform: scale(1.05);
      color: var(--accent-primary);
    }
    
    .close-btn:active {
      transform: scale(0.95);
      transition: var(--transition-fast);
    }
    
    /* Tabs */
    .dialog-tabs {
      display: flex;
      gap: 8px;
      margin-bottom: 24px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      padding-bottom: 8px;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    
    .dialog-tabs::-webkit-scrollbar {
      display: none;
    }
    
    .tab-btn {
      background: none;
      border: none;
      color: rgba(255, 255, 255, 0.7);
      padding: 8px 16px;
      cursor: pointer;
      border-radius: 8px;
      transition: all 0.2s;
      white-space: nowrap;
      font-size: 14px;
    }
    
    .tab-btn:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.1);
    }
    
    .tab-btn.active {
      color: #fff;
      background: #1d69ff;
    }
    
    .tab-content {
      padding: 16px 0;
    }
    
    .tab-pane {
      display: none;
    }
    
    .tab-pane.active {
      display: block;
    }
    
    /* Settings styles */
    .settings-section {
      margin-bottom: 24px;
    }
    
    .settings-section h5 {
      margin-bottom: 16px;
      font-size: 18px;
    }
    
    .settings-description {
      color: rgba(255, 255, 255, 0.7);
      margin-bottom: 16px;
      font-size: 14px;
      line-height: 1.5;
    }
    
    .preset-buttons {
      display: flex;
      gap: 8px;
      margin-bottom: 16px;
      flex-wrap: wrap;
    }
    
    .preset-btn {
      padding: 8px 16px;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: white;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
      font-size: 14px;
      flex: 1;
      min-width: 100px;
      text-align: center;
    }
    
    .preset-btn:hover {
      background: rgba(255, 255, 255, 0.2);
    }
    
    .preset-btn.active {
      background: #1d69ff;
      border-color: #1d69ff;
      color: white;
    }
    
    .settings-form {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    
    .form-group {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    
    .form-group label {
      color: rgba(255, 255, 255, 0.9);
      font-size: 14px;
    }
    
    .input-with-button {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    
    .input-with-button input {
      flex: 1;
    }
    
    input[type="number"] {
      width: 100%;
      padding: 8px 12px;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 8px;
      color: white;
      font-size: 14px;
      -moz-appearance: textfield;
    }
    
    input[type="number"]::-webkit-outer-spin-button,
    input[type="number"]::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
    
    .input-btn {
      padding: 8px 12px;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: white;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
      font-size: 14px;
    }
    
    .apply-btn {
      margin-top: 16px;
      padding: 10px 20px;
      background: #1d69ff;
      color: white;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
    }
    
    .apply-btn:hover {
      background-color: #3a7cff;
    }
    
    /* Form toggle switch */
    .form-group.toggle {
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      padding: 12px 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .form-group.toggle:last-child {
      border-bottom: none;
    }
    
    .form-group.toggle label {
      color: rgba(255, 255, 255, 0.9);
      font-size: 14px;
      margin-right: 16px;
    }
    
    /* Toggle switch styles */
    .toggle-switch {
      position: relative;
      display: inline-block;
      width: 56px;
      height: 24px;
    }
    
    .toggle-switch input {
      opacity: 0;
      width: 0;
      height: 0;
      margin: 0;
    }
    
    .toggle-slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(255, 255, 255, 0.1);
      transition: .4s;
      border-radius: 34px;
    }
    
    .toggle-slider:before {
      position: absolute;
      content: "";
      height: 20px;
      width: 20px;
      left: 4px;
      bottom: 3px;
      background-color: white;
      transition: .4s;
      border-radius: 50%;
    }
    
    input:checked + .toggle-slider {
      background-color: #1d69ff;
    }
    
    input:checked + .toggle-slider:before {
      transform: translateX(20px);
    }
    
    /* Volume slider styles */
    .volume-control {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      max-width: 300px;
      margin-top: 8px;
    }
    
    .volume-btn {
      background: none;
      border: none;
      color: var(--ambient-text);
      cursor: pointer;
      padding: 4px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.2s ease;
    }
    
    .volume-btn:hover {
      background-color: rgba(255, 255, 255, 0.1);
    }
    
    .volume-slider-container {
      position: relative;
      flex: 1;
      height: 4px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 2px;
      cursor: pointer;
    }
    
    .volume-slider-track {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border-radius: 2px;
      overflow: hidden;
    }
    
    .volume-slider-progress {
      position: absolute;
      top: 0;
      left: 0;
      height: 100%;
      background: #1d69ff;
      border-radius: 2px;
      transition: width 0.1s ease;
    }
    
    #volume-slider {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      cursor: pointer;
      z-index: 2;
      -webkit-appearance: none;
      appearance: none;
      background: transparent;
    }
    
    #volume-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 16px;
      height: 16px;
      background: #1d69ff;
      border-radius: 50%;
      cursor: pointer;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
      margin-top: -6px;
    }
    
    #volume-slider::-moz-range-thumb {
      width: 16px;
      height: 16px;
      background: #1d69ff;
      border: none;
      border-radius: 50%;
      cursor: pointer;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    #volume-slider::-webkit-slider-runnable-track {
      width: 100%;
      height: 4px;
      cursor: pointer;
      background: transparent;
      border-radius: 2px;
    }
    
    #volume-slider::-moz-range-track {
      width: 100%;
      height: 4px;
      cursor: pointer;
      background: transparent;
      border-radius: 2px;
    }
    
    .volume-value {
      min-width: 40px;
      text-align: right;
      color: var(--ambient-text);
      opacity: 0.8;
      font-size: 0.9rem;
      font-weight: 500;
    }

    .settings-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    
    .sound-option {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      background: rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      color: #fff;
    }
    
    .sound-option.active {
      border-color: #1d69ff;
      background: rgba(29, 105, 255, 0.1);
    }
    
    .sound-option-label {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      cursor: pointer;
    }
    
    .radio-custom {
      display: inline-block;
      width: 16px;
      height: 16px;
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-radius: 50%;
      position: relative;
    }
    
    .sound-option.active .radio-custom {
      border-color: #1d69ff;
    }
    
    .radio-custom-inner {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background-color: #1d69ff;
      display: none;
    }
    
    .sound-option.active .radio-custom-inner {
      display: block;
    }
    
    .preview-btn {
      padding: 8px 16px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
    }
    
    .preview-btn:hover {
      background: rgba(255, 255, 255, 0.2);
    }
    
    
    /* Background themes */
    .background-themes {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 16px;
      margin-top: 24px;
    }
    
    .background-theme, 
    .theme-item {
      position: relative;
      border-radius: 8px;
      overflow: hidden;
      cursor: pointer;
      transition: transform 0.2s;
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-bottom: 12px;
    }
    
    .background-theme:hover,
    .theme-item:hover {
      transform: scale(1.05);
    }
    
    .theme-button {
      width: 100%;
      height: auto;
      border: none;
      background: none;
      padding: 0;
      cursor: pointer;
      border-radius: 8px;
      overflow: hidden;
    }
    
    .theme-button.active {
      box-shadow: 0 0 0 2px #1d69ff;
    }
    
    .theme-button img,
    .theme-item img {
      width: 100%;
      aspect-ratio: 16/9;
      object-fit: cover;
      display: block;
    }
    
    .theme-item.active::after {
      content: '';
      position: absolute;
      inset: 0;
      border: 2px solid #1d69ff;
      border-radius: 8px;
      pointer-events: none;
    }
    
    .theme-name {
      font-size: 0.75rem;
      color: var(--ambient-muted);
      text-align: center;
      margin-top: 8px;
    }
    
    .use-sound-image-btn {
      width: 100%;
      padding: 12px 16px;
      margin-top: 16px;
      margin-bottom: 24px;
      background: #1d69ff;
      color: white;
      border: none;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: background-color 0.2s;
    }
    
    .use-sound-image-btn:hover {
      background: #3a7cff;
    }
    
    /* Apple Liquid Glass Bottom Sheet */
    .bottom-sheet {
      position: fixed;
      bottom: 12px;
      left: 12px;
      right: 12px;
      background: var(--glass-bg-primary);
      backdrop-filter: var(--glass-blur-heavy);
      -webkit-backdrop-filter: var(--glass-blur-heavy);
      border: 1px solid var(--glass-border);
      border-radius: var(--radius-2xl);
      box-shadow: var(--glass-shadow-heavy), var(--glass-shadow-inset);
      transform: translateY(calc(100% + 24px)) scale(0.95);
      transition: var(--transition-slow);
      z-index: 1000;
      max-height: 85vh;
      display: flex;
      flex-direction: column;
      position: relative;
      opacity: 0;
      pointer-events: none;
      overflow: hidden;
    }
    
    .bottom-sheet.active {
      transform: translateY(0) scale(1);
      opacity: 1;
      pointer-events: auto;
    }
    
    .bottom-sheet.hidden {
      display: none;
    }
    
    .bottom-sheet::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.08) 100%
      );
      opacity: 0.6;
      pointer-events: none;
      z-index: 1;
    }
    
    .sheet-header {
      padding: 24px 28px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--glass-border);
      background: var(--glass-bg-secondary);
      backdrop-filter: var(--glass-blur);
      -webkit-backdrop-filter: var(--glass-blur);
      position: relative;
      z-index: 2;
    }
    
    .sheet-header h3 {
      color: var(--text-primary);
      font-weight: 600;
      font-size: 18px;
      letter-spacing: -0.01em;
      margin: 0;
    }
    
    .sheet-content {
      padding: 24px 28px;
      overflow-y: auto;
      flex: 1;
      position: relative;
      z-index: 2;
      margin-bottom: 70px;
    }
    
    .sheet-content::-webkit-scrollbar {
      width: 6px;
    }
    
    .sheet-content::-webkit-scrollbar-track {
      background: transparent;
    }
    
    .sheet-content::-webkit-scrollbar-thumb {
      background: var(--glass-bg-tertiary);
      border-radius: var(--radius-sm);
    }
    
    .sheet-content::-webkit-scrollbar-thumb:hover {
      background: var(--glass-border-strong);
    }
    
    .sound-category {
      margin-bottom: 32px;
    }
    
    .sound-category h3 {
      margin-bottom: 16px;
      font-size: 1.2em;
      color: rgba(255, 255, 255, 0.9);
    }
    
    /* Sound Library Card Grid Style */
    .sound-library-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 10px;
      padding: 12px 0;
      width: 100%;
      justify-items: center;
    }
    @media (max-width: 767px) {
      .sound-library-list {
        gap: 10px;
      }
    }
    .library-sound-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      background: rgba(102, 102, 102, 0.2) !important;
      border-radius: 20px;
      box-shadow: none;
      padding: 0 !important;
      cursor: pointer;
      transition: box-shadow 0.2s, background 0.2s;
      width: 100%;
      max-width: 240px;
      min-width: 0;
      gap: 0;
    }
    .library-sound-item.active {
      border: 2px solid #ffffff80;
    }
    .library-sound-thumbnail {
      width: 120px !important;
      height: 150px !important;
      border-radius: 8px !important;
      overflow: hidden;
      flex-shrink: 0;
      margin-bottom: 10px;
      position: relative;
      background: #222;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: border 0.2s;
    }
    .library-sound-name {
      font-size: 1.15rem;
      color: #d5d5d5bf;
      text-align: center;
      margin: 0;
      margin-top: 2px;
      font-weight: 500;
      letter-spacing: 0.01em;
      transition: color 0.2s;
    }
    .library-sound-item.active .library-sound-name {
      color: #fff;
    }
    .library-sound-thumbnail img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 8px;
      display: block;
    }
    .library-sound-name {
      font-size: 1.15rem;
      color: #222;
      text-align: center;
      margin: 0;
      margin-top: 2px;
      font-weight: 500;
      letter-spacing: 0.01em;
    }
    /* Optional badge */
    .library-sound-badge {
      position: absolute;
      top: 10px;
      right: 10px;
      background: #fff;
      color: #1d69ff;
      font-size: 0.75rem;
      font-weight: 700;
      border-radius: 8px;
      padding: 2px 10px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
      z-index: 2;
    }
    .library-sound-item.active {
      background: rgba(29,105,255,0.04);
    }
    @media (max-width: 1200px) {
      .sound-library-list {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
        gap: 24px 12px;
      }
      .library-sound-item {
        max-width: 180px;
    }
      .library-sound-thumbnail {
        width: 120px !important;
        height: 150px !important;
        border-radius: 8px !important;
        max-width: none !important;
        aspect-ratio: unset !important;
      }
    }
    @media (max-width: 900px) {
      .sound-library-list {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: 16px 8px;
      }
      .library-sound-item {
        max-width: 140px;
    }
      .library-sound-thumbnail {
        width: 120px !important;
        height: 150px !important;
        border-radius: 8px !important;
        max-width: none !important;
        aspect-ratio: unset !important;
      }
    }
    @media (max-width: 600px) {
      .sound-library-list {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
        gap: 10px 4px;
        padding: 4px 0;
      }
      .library-sound-item {
        max-width: 110px;
    }
      .library-sound-thumbnail {
        width: 120px !important;
        height: 150px !important;
        border-radius: 8px !important;
        max-width: none !important;
        aspect-ratio: unset !important;
      }
      .library-sound-name {
        font-size: 0.95rem;
      }
    }
    
    .library-sound-status svg {
      width: 24px;
      height: 24px;
    }
    
    .library-sound-status .play-icon,
    .library-sound-status .pause-icon {
      position: absolute;
      transition: opacity 0.2s ease, transform 0.2s ease;
    }
    
    .library-sound-status .pause-icon {
      opacity: 0;
      transform: scale(0.8);
    }
    
    .library-sound-item.active .library-sound-status .play-icon {
      opacity: 0;
      transform: scale(0.8);
    }
    
    .library-sound-item.active .library-sound-status .pause-icon {
      opacity: 1;
      transform: scale(1);
    }
    
    /* Touch Device Optimizations */
    @media (hover: none) and (pointer: coarse) {
      .library-sound-item {
        padding: 16px;
        min-height: 80px;
      }
      
      .library-sound-thumbnail {
        width: 64px;
        height: 64px;
      }
      
      .library-sound-status {
        width: 40px;
        height: 40px;
      }
      
      .close-btn {
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
      }
    }
    
    /* Scrollbar Styles */
    .sheet-content::-webkit-scrollbar,
    .modal-container::-webkit-scrollbar {
      width: 8px;
    }
    
    .sheet-content::-webkit-scrollbar-track,
    .modal-container::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 4px;
    }
    
    .sheet-content::-webkit-scrollbar-thumb,
    .modal-container::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 4px;
    }
    
    .sheet-content::-webkit-scrollbar-thumb:hover,
    .modal-container::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.3);
    }
    
    /* Tablet Styles for Sound Library */
    @media (min-width: 768px) {
      .bottom-sheet {
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        width: 90%;
        max-width: 800px;
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
      }
      
      .bottom-sheet.active {
        transform: translateX(-50%) translateY(0);
      }
      
      .sheet-content {
        padding: 32px;
      }
      
      .sound-library-list {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 24px;
      }
      
      .library-sound-item {
        padding: 16px;
      }
    }
    
    /* Large Tablet/Desktop Styles */
    @media (min-width: 1024px) {
      .bottom-sheet {
        max-width: 1000px;
      }
      
      .sound-library-list {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
      }
    }
    
    /* Mobile Styles for Sound Library */
    @media (max-width: 767px) {
      .bottom-sheet {
        max-height: 100vh;
      }
      
      .sheet-header {
        padding: 16px;
      }
      
      .sheet-content {
        padding: 16px;
      }
      
      .sound-library-list {
        grid-template-columns: 1fr;
        gap: 12px;
      }
      
      .library-sound-item {
        padding: 12px;
      }
    }
    
    /* Enhanced Modal Tablet Styles */
    @media (min-width: 768px) {
      .modal-container {
        width: 90%;
        max-width: 800px;
        padding: 32px;
      }
      
      .modal-header {
        margin-bottom: 24px;
      }
      
      .theme-section {
        margin-bottom: 32px;
      }
      
      .preset-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
      }
      
      .url-input-group {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 16px;
        align-items: center;
      }
      
      .url-input-group input {
        min-width: 300px;
      }
    }
    
    /* Landscape Mode Enhancements */
    @media (max-height: 600px) and (orientation: landscape) {
      .bottom-sheet {
        max-height: 95vh;
      }
      
      .sound-library-list {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
      }
      
      .library-sound-item {
        padding: 12px;
      }
    }
    
    /* Common Item Styles */
    .library-sound-item {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      padding: 14px;
      display: flex;
      align-items: center;
      gap: 1px;
      transition: all 0.2s ease;
      cursor: pointer;
    }
    
    .library-sound-item:hover {
      background: rgba(255, 255, 255, 0.15);
      transform: translateY(-2px);
    }
    
    .library-sound-item.active {
      background: rgba(29,105,255,0.04);
    }
    
    .library-sound-thumbnail {
      width: 60px;
      height: 60px;
      border-radius: 8px;
      overflow: hidden;
      flex-shrink: 0;
    }
    
    .library-sound-thumbnail img {
        width: 100%;
      height: 100%;
      object-fit: cover;
    }
    
    .library-sound-name {
      flex: 1;
      font-size: 1rem;
      color: rgba(255, 255, 255, 0.9);
    }
    
    .library-sound-status {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: rgba(255, 255, 255, 0.9);
      transition: all 0.2s ease;
    }

    .sleep-time-value {
      font-size: 1.5rem;
      font-weight: 700;
      color: #fff;
      background: rgba(29, 105, 255, 0.2);
      border-radius: 4px;
      padding: 4px 8px;
      margin: 0 4px;
    }
    
    .cancel-btn {
      padding: 8px 16px;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: var(--ambient-text);
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
    }
    
    .cancel-btn:hover {
      background: rgba(255, 255, 255, 0.2);
    }

    #custom-time {
      height: 36px;
      padding: 8px 12px;
      font-size: 1rem;
      border-radius: 6px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      background: rgba(255, 255, 255, 0.1);
      color: var(--ambient-text);
      width: 100%;
      max-width: 120px;
      box-sizing: border-box;
    }
    
    .input-with-button {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    #background-tab {
      padding: 0 16px;
    }
    
    #background-tab h3 {
      margin-bottom: 24px;
    }
    
    /* Hide scrollbars for all elements */
    .sound-grid::-webkit-scrollbar,
    .dialog-content::-webkit-scrollbar,
    .sound-library-list::-webkit-scrollbar,
    .sheet-content::-webkit-scrollbar,
    .main-content::-webkit-scrollbar,
    .tab-content::-webkit-scrollbar {
      display: none;
    }
    
    /* For Firefox */
    .sound-grid,
    .dialog-content,
    .sound-library-list,
    .sheet-content,
    .main-content,
    .tab-content {
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    
    .player-container.ui-hidden {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }
    
    .player-container.ui-hidden .main-content {
      display: flex !important;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 0;
      margin: 0;
      height: 100vh;
      max-height: 100vh;
      position: relative;
      z-index: 10;
    }
    
    .player-container.ui-hidden .sound-grid {
      display: none !important;
      opacity: 0 !important;
      visibility: hidden !important;
      pointer-events: none !important;
    }
    
    .player-container.ui-hidden .sound-title {
      display: none !important;
    }

    .player-container.ui-hidden 
    
    .player-container.ui-hidden 
    
    /* Media query adjustments for hidden UI mode */
    @media (max-width: 480px) {
      .player-container.ui-hidden 
    }
    
    @media (max-height: 600px) {
      .player-container.ui-hidden 
      
      .player-container.ui-hidden 
    }
    
    /* Hero Section */
    .hero {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      z-index: 20;
      color: white;
      transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .hero h5 {
      font-size: 2rem;
      margin-bottom: 1rem;
      text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .hero p {
      font-size: 1.25rem;
      color: rgba(255, 255, 255, 0.8);
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
    
    .hero.hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }
    
    /* Open Hero Button */
    .open-hero-btn {
      position: fixed;
      bottom: 20px;
      right: 20px;
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: white;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
      z-index: 20;
    }
    
    .open-hero-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: scale(1.1);
    }

    /* ===== NEW TODO LIST STYLES ===== */
    
    /* Date Display */
    .date-display {
      display: flex;
      align-items: center;
      gap: 12px;
      color: #ffffff;
    }
    
    .day-number {
      font-size: 48px;
      font-weight: 700;
      line-height: 1;
      color: #ffffff;
    }
    
    .date-info {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    
    .month {
      font-size: 16px;
      font-weight: 500;
      color: #ffffff;
      line-height: 1;
    }
    
    .weekday {
      font-size: 14px;
      font-weight: 400;
      color: rgba(255, 255, 255, 0.7);
      line-height: 1;
    }

    /* New Task Section */
    .new-task-section {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 32px;
      padding: 0;
    }
    
    .new-task-checkbox {
      width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: rgba(255, 255, 255, 0.4);
      flex-shrink: 0;
    }
    
    .new-task-checkbox svg {
      width: 16px;
      height: 16px;
    }
    
    .new-task-input {
      flex: 1;
      background: none;
      border: none;
      color: rgba(255, 255, 255, 0.6);
      font-size: 16px;
      font-weight: 400;
      outline: none;
      padding: 0;
    }
    
    .new-task-input::placeholder {
      color: rgba(255, 255, 255, 0.4);
    }
    
    .new-task-input:focus {
      color: #ffffff;
    }

    /* Task Sections */
    .task-section {
      margin-bottom: 28px;
    }
    
    .section-title {
      font-size: 14px;
      font-weight: 500;
      color: rgba(255, 255, 255, 0.6);
      margin: 0 0 12px 0;
      text-transform: none;
      letter-spacing: 0;
    }

    /* Updated Task Lists */
    .task-list {
      list-style: none;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    
    .task-list.focus-tasks .task-item {
      background: rgba(99, 102, 241, 0.1);
      border: 1px solid rgba(99, 102, 241, 0.2);
    }
    
    .task-list.next-tasks .task-item {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .task-list.done-tasks .task-item {
      background: rgba(34, 197, 94, 0.1);
      border: 1px solid rgba(34, 197, 94, 0.2);
    }

    /* Updated Task Items */
    .task-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      border-radius: 8px;
      transition: all 0.2s ease;
      cursor: pointer;
      margin: 0;
      position: relative;
    }
    
    .task-item:hover {
      background: rgba(255, 255, 255, 0.08) !important;
    }
    
    .task-item.dragging {
      opacity: 0.8;
      transform: scale(0.98);
      z-index: 1000;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

    /* Updated Task Checkboxes */
    .task-checkbox {
      width: 18px;
      height: 18px;
      border: 2px solid rgba(255, 255, 255, 0.4);
      border-radius: 3px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      cursor: pointer;
      transition: all 0.2s ease;
      background: transparent;
      position: relative;
    }
    
    .task-checkbox:hover {
      border-color: rgba(255, 255, 255, 0.6);
    }
    
    .task-checkbox.checked {
      background: #ffffff;
      border-color: #ffffff;
    }
    
    .task-checkbox svg {
      width: 16px;
      height: 16px;
      color: rgba(255, 255, 255, 0.4);
      transition: all 0.2s ease;
    }
    
    .task-checkbox.checked svg {
      color: #000000;
    }
    
    /* Task edit input */
    .task-edit-input {
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.3);
      border-radius: 4px;
      color: #ffffff;
      font-size: 16px;
      font-weight: 400;
      padding: 4px 8px;
      outline: none;
      width: 100%;
    }
    
    .task-edit-input:focus {
      border-color: rgba(99, 102, 241, 0.5);
      background: rgba(255, 255, 255, 0.15);
    }

    /* Empty Placeholder Styles */
    .empty-placeholder {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px 16px;
      margin: 0;
      border: 2px dashed rgba(255, 255, 255, 0.2);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.02);
      transition: all 0.3s ease;
      min-height: 60px;
    }
    
    .empty-placeholder-content {
      text-align: center;
    }
    
    .empty-placeholder-text {
      color: rgba(255, 255, 255, 0.4);
      font-size: 14px;
      font-style: italic;
    }
    
    /* Drag over states for empty placeholders */
    .task-list.drag-over .empty-placeholder {
      border-color: rgba(99, 102, 241, 0.5);
      background: rgba(99, 102, 241, 0.1);
      transform: scale(1.02);
    }
    
    .task-list.drag-over .empty-placeholder-text {
      color: rgba(255, 255, 255, 0.7);
    }

    /* Updated Task Text */
    .task-text {
      flex: 1;
      color: #ffffff;
      font-size: 16px;
      font-weight: 400;
      line-height: 1.4;
      background: none;
      border: none;
      outline: none;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    
    .task-item.completed .task-text {
      color: rgba(255, 255, 255, 0.5);
      text-decoration: line-through;
    }
    
    .task-text[contenteditable="true"]:focus {
      outline: none;
      border-bottom: 1px solid rgba(255, 255, 255, 0.3);
      padding-bottom: 2px;
    }

    /* Drag Handle */
    .task-drag-handle {
      width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: grab;
      opacity: 0;
      transition: opacity 0.2s ease;
      color: rgba(255, 255, 255, 0.4);
    }
    
    .task-item:hover .task-drag-handle {
      opacity: 1;
    }
    
    .task-drag-handle:active {
      cursor: grabbing;
    }
    
    .task-drag-handle svg {
      width: 16px;
      height: 16px;
    }

    /* Bottom Navigation */
    .todo-bottom-nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 32px;
      padding-top: 20px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .task-count {
      color: rgba(255, 255, 255, 0.6);
      font-size: 14px;
      font-weight: 400;
    }
    
    .nav-controls {
      display: flex;
      align-items: center;
      gap: 16px;
    }
    
    .nav-btn {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: rgba(255, 255, 255, 0.6);
      cursor: pointer;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      position: relative;
      overflow: hidden;
    }
    
    .nav-btn::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.02) 100%
      );
      opacity: 0;
      transition: opacity 0.3s ease;
      pointer-events: none;
    }
    
    .nav-btn:hover {
      color: #ffffff;
      background: rgba(255, 255, 255, 0.1);
      border-color: rgba(255, 255, 255, 0.2);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .nav-btn:hover::before {
      opacity: 1;
    }
    
    .nav-btn:active {
      transform: translateY(0);
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    
    .nav-btn svg {
      transition: transform 0.2s ease;
    }
    
    .nav-btn:hover svg {
      transform: scale(1.1);
    }
    
    .date-nav-text {
      color: #ffffff;
      font-size: 14px;
      font-weight: 500;
      min-width: 60px;
      text-align: center;
    }

    /* Animations and Transitions */
    .task-item {
      animation: slideInUp 0.3s ease-out;
    }
    
    @keyframes slideInUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    
    /* Drag and Drop Styles */
    .task-item.drag-over {
      border-color: rgba(99, 102, 241, 0.5);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    /* Mobile Responsiveness */
    @media (max-width: 767px) {
      .day-number {
        font-size: 40px;
      }
      
      .month {
        font-size: 14px;
      }
      
      .weekday {
        font-size: 12px;
      }
      
      .task-item {
        padding: 10px 12px;
      }
      
      .task-text {
        font-size: 15px;
      }
      
      .new-task-input {
        font-size: 15px;
      }
      
      .todo-bottom-nav {
        margin-top: 24px;
        padding-top: 16px;
      }
    }

    /* Modal Hidden States */
    .pricing-modal.hidden,
    .auth-modal.hidden {
      display: none !important;
    }
    
    .pricing-modal .pricing-panel {
      animation: modalSlideIn 0.3s ease-out;
    }
    
    @keyframes modalSlideIn {
      from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }
    
    .open-hero-btn.hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }
    
    /* Hero Overlay */
    .hero-overlay {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      height: 200px; /* Adjust this value to cover the controls and sound grid */
      background: transparent;
      z-index: 30;
      cursor: pointer;
      transition: background-color 0.3s ease;
    }
    
    .hero-overlay:hover {
      background: transparent;
    }
    
    /* Play/Pause Icons */
    #play-icon, #pause-icon {
      transition: none;
    }
    
    .hidden {
      display: none !important;
    }
    
    .control-btn {
      background: none;
      border: none;
      color: var(--ambient-text);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      width: 3rem;
      height: 3rem;
      background-color: #00000050;
      transition: var(--transition-standard);
    }
    
    /* Modal Styles */
    .modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 16px;
    }
    
    .modal.hidden {
      display: none;
    }
    
    .modal-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(5px);
    }
    
    .modal-container {
      position: relative;
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border-radius: 20px;
      padding: 24px;
      max-width: 90%;
      width: 500px;
      max-height: 85vh;
      overflow-y: auto;
      transform: scale(0.8);
      opacity: 0;
      transition: all 0.3s ease;
    }
    .modal-container::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 20px;
      padding: 2px;
      pointer-events: none;
      z-index: 2;
      background: linear-gradient(
        to bottom,
        rgba(110,106,104,0.7) 0%,
        rgba(110,106,104,0.2) 20%,
        rgba(110,106,104,0.0) 50%,
        rgba(110,106,104,0.18) 80%,
        rgba(110,106,104,0.35) 100%
      );
      -webkit-mask:
        linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      box-sizing: border-box;
    }
    
    .modal-container.modal-open {
      transform: scale(1);
      opacity: 1;
    }
    
    .modal-container.modal-close {
      transform: scale(0.8);
      opacity: 0;
    }
    
    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 24px;
    }
    
    .modal-header h2 {
      margin: 0;
      font-size: 24px;
      font-weight: 600;
    }
    
    .close-btn {
      background: none;
      border: none;
      color: #ffffff;
      cursor: pointer;
      padding: 8px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.2s;
    }
    
    .close-btn:hover {
      background-color: rgba(255, 255, 255, 0.1);
    }
    
    .theme-section {
      margin-bottom: 24px;
      padding-left: 8px;
      padding-right: 8px;
    }
    
    .theme-section:last-child {
      padding-bottom: 48px; /* Extra space for last item accessibility */
    }
    
    .theme-section h3 {
      margin: 0 0 16px 0;
      font-size: 18px;
      font-weight: 500;
    }
    
    /* Toggle Switch */
    .toggle-switch {
      display: flex;
      align-items: center;
      cursor: pointer;
    }
    
    .toggle-switch input {
      display: none;
    }
    
    .toggle-slider {
      position: relative;
      width: 48px;
      height: 24px;
      background-color: rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      margin-right: 12px;
      transition: background-color 0.2s;
    }
    
    .toggle-slider:before {
      content: '';
      position: absolute;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background-color: white;
      top: 2px;
      left: 2px;
      transition: transform 0.2s;
    }
    
    .toggle-switch input:checked + .toggle-slider {
      background-color: #4CAF50;
    }
    
    .toggle-switch input:checked + .toggle-slider:before {
      transform: translateX(24px);
    }
    
    .toggle-label {
      font-size: 16px;
    }
    
    /* URL Input Group */
    .url-input-group {
      display: flex;
      gap: 8px;
    }
    
    .url-input-group input {
      flex: 1;
      padding: 12px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 6px;
      background: rgba(255, 255, 255, 0.05);
      color: white;
      font-size: 14px;
    }
    
    .url-input-group input:focus {
      outline: none;
      border-color: rgba(255, 255, 255, 0.3);
    }
    
    .primary-btn {
      padding: 12px 24px;
      background: #1d69ff;
      border: none;
      border-radius: 6px;
      color: white;
      font-weight: 500;
      cursor: pointer;
      transition: background-color 0.2s;
    }
    
    .primary-btn:hover {
      background: #3a7cff;
    }
    
    .primary-btn:disabled {
      background: rgba(255, 255, 255, 0.1);
      color: rgba(255, 255, 255, 0.5);
      cursor: not-allowed;
    }
    
    /* Upload Section */
    .upload-section {
      margin-top: 24px;
      padding-top: 24px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .upload-section h4 {
      color: white;
      font-size: 16px;
      font-weight: 500;
      margin: 0 0 16px 0;
    }
    
    .file-drop-zone {
      border: 2px dashed rgba(255, 255, 255, 0.2);
      border-radius: 8px;
      padding: 32px 16px;
      text-align: center;
      transition: all 0.3s ease;
      cursor: pointer;
      position: relative;
      background: rgba(255, 255, 255, 0.02);
      margin-bottom: 16px;
    }
    
    .file-drop-zone:hover {
      border-color: rgba(255, 255, 255, 0.4);
      background: rgba(255, 255, 255, 0.05);
    }
    
    .file-drop-zone.drag-over {
      border-color: #1d69ff;
      background: rgba(29, 105, 255, 0.1);
    }
    
    .drop-zone-content svg {
      color: rgba(255, 255, 255, 0.6);
      margin-bottom: 12px;
    }
    
    .drop-text {
      color: white;
      font-size: 16px;
      margin: 0 0 8px 0;
    }
    
    .browse-link {
      color: #1d69ff;
      text-decoration: underline;
      cursor: pointer;
    }
    
    .browse-link:hover {
      color: #3a7cff;
    }
    
    .file-types {
      color: rgba(255, 255, 255, 0.5);
      font-size: 14px;
      margin: 0;
    }
    
    /* Preset Themes */
    .preset-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 16px;
      margin-top: 16px;
    }
    
    .preset-theme {
      position: relative;
      cursor: pointer;
      transition: transform 0.3s ease;
      border-radius: 50%;
      overflow: hidden;
      aspect-ratio: 1;
      background: rgba(0, 0, 0, 0.2);
    }
    
    .preset-theme:hover {
      transform: translateY(-4px);
    }
    
    .preset-preview {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-size: cover;
      background-position: center;
      border-radius: 50%;
      transition: transform 0.3s ease;
    }
    
    .preset-theme:hover .preset-preview {
      transform: scale(1.05);
    }
    
    .preset-theme span {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 8px;
      color: white;
      text-align: center;
      font-size: 14px;
      border-radius: 0 0 8px 8px;
    }
    
    /* Modal scrollbar styles */
    .modal-content::-webkit-scrollbar {
      width: 8px;
    }
    
    .modal-content::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 4px;
    }
    
    .modal-content::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 4px;
    }
    
    .modal-content::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.3);
    }
    
    /* Responsive styles */
    @media (min-width: 768px) {
      .modal-container {
        width: 90%;
        max-width: 800px;
      }
    
      .preset-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 20px;
      }
    }
    
    @media (max-width: 480px) {
      /* Prevent iOS zoom on inputs */
      input, select, textarea {
        font-size: 16px !important;
      }

      .modal-container {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 16px;
      }
    
    
      .preset-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
      }
    
      .preset-theme span {
        font-size: 0.75rem;
        padding: 6px;
      }
    }
    
    /* Landscape mode adjustments */
    @media (max-height: 480px) and (orientation: landscape) {
      .modal-container {
        max-height: 95vh;
      }
    
      .modal-content {
        max-height: calc(95vh - 80px);
      }
    
      .preset-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
      }
    }
    
    /* Theme Button */
    .theme-btn {
      position: relative;
    }
    
    .theme-btn:hover {
      background-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Toast Modifications */
    .toast {
      background: rgba(28, 28, 28, 0.95);
      color: white;
      padding: 12px 24px;
      border-radius: 8px;
      margin-bottom: 8px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    .toast-error {
      background: rgba(244, 67, 54, 0.95);
    }
    
    .toast-success {
      background: rgba(76, 175, 80, 0.95);
    }
    
    /* Sound Background Section Styles */
    .sound-bg-section {
      background: rgba(29, 105, 255, 0.1) !important;
      border: 1px solid rgba(29, 105, 255, 0.2);
    }
    
    .section-header {
      margin-bottom: 16px;
    }
    
    .section-header h3 {
      margin-bottom: 8px;
    }
    
    .section-description {
      color: rgba(255, 255, 255, 0.7);
      font-size: 14px;
      line-height: 1.4;
    }
    
    .toggle-switch-container {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      border-radius: 8px;
    }
    
    .toggle-label-group {
      display: flex;
      align-items: center;
    }
    
    .toggle-title {
      font-size: 15px;
      font-weight: 500;
      color: rgba(255, 255, 255, 0.9);
    }
    
    .toggle-description {
      font-size: 13px;
      color: rgba(255, 255, 255, 0.6);
    }
    
    .toggle-control {
      display: flex;
      align-items: center;
    }

    /* Mobile styles - now only applying to smaller screens */
    @media (max-width: 480px) {

    }

    @media (max-height: 480px) and (orientation: landscape) {

    }

    .player-container.ui-hidden 

    /* Reorder the dots using order property */

    .controls {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .icon {
      width: 20px;
      height: 20px;
      stroke-width: 2;
      stroke: currentColor;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .instructions-content {
      padding: 24px;
      height: 100%;
      overflow-y: auto;
      color: #fff;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    
    .instructions-content::-webkit-scrollbar {
      display: none;
    }
    
    .instructions-title {
      font-size: 24px;
      font-weight: 500;
      margin-bottom: 16px;
      color: #fff;
    }
    
    .instructions-section {
      margin-bottom: 24px;
    }
    
    .instructions-section h3 {
      font-size: 1.5rem;
      font-weight: 500;
      margin-bottom: 1rem;
      color: #fff;
    }
    
    .instructions-list {
      list-style-type: none;
    }
    
    .instructions-list li {
      margin-bottom: 12px;
      padding-left: 24px;
      position: relative;
      color: rgba(255, 255, 255, 0.8);
    }
    
    .instructions-list li::before {
      content: "•";
      position: absolute;
      left: 8px;
      color: rgba(255, 255, 255, 0.6);
    }
    
    .close-instructions {
      position: absolute;
      top: 16px;
      right: 16px;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background-color: rgba(255, 255, 255, 0.1);
      border: none;
      color: #fff;
      font-size: 20px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
    }
    
    .close-instructions:hover {
      background-color: rgba(255, 255, 255, 0.2);
    }
    
    @media (max-width: 480px) {

      .controls {
        gap: 12px;
      }

      .icon {
        width: 16px;
        height: 16px;
      }

      .instructions-title {
        font-size: 20px;
      }
  
      .instructions-section h3 {
        font-size: 1.2rem;
      }
  
      .instructions-list li {
        font-size: 14px;
        margin-bottom: 8px;
      }
  
      .close-instructions {
        width: 28px;
        height: 28px;
        font-size: 16px;
      }
    }
    
    @media (max-height: 600px) {

    }
    
    /* Mobile styles for modal */
    @media (max-width: 480px) {
      .modal-container {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 16px;
        margin: 0;
        display: flex;
        flex-direction: column;
      }
  
      .modal-header {
        padding: 12px 0;
      }
  
      .modal-content {
        flex: 1;
        overflow-y: auto;
        padding: 12px 0;
      }
  
      .theme-section {
        margin-bottom: 24px;
      }
  
      .url-input-group {
        flex-direction: column;
        gap: 12px;
      }
  
      .url-input-group input {
        width: 100%;
        font-size: 16px; /* Prevent iOS zoom */
      }
  
      .url-input-group button {
        width: 100%;
      }
  
      .preset-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
      }
  
      .preset-theme {
        aspect-ratio: 1;
      }
    }
    
    /* Tablet styles */
    @media (min-width: 481px) and (max-width: 768px) {
      .modal-container {
        width: 90%;
        max-width: 600px;
        padding: 20px;
      }
  
      .preset-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
      }
    }
    
    /* Landscape mode adjustments */
    @media (max-height: 480px) and (orientation: landscape) {
      .modal-container {
        height: auto;
        max-height: 90vh;
        display: block;
      }
  
      .modal-content {
        max-height: calc(90vh - 120px);
        overflow-y: auto;
      }
  
      .preset-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
      }
    }
    
    /* Enhance scrollbar styles for modal content */
    .modal-container::-webkit-scrollbar {
      width: 8px;
    }
  
    .modal-container::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 4px;
    }
  
    .modal-container::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.3);
      border-radius: 4px;
    }
  
    .modal-container::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.4);
    }
    
    /* Enhance form controls for touch devices */
    @media (hover: none) and (pointer: coarse) {
      .url-input-group input,
      .url-input-group button,
      .preset-theme {
        min-height: 44px; /* Better touch targets */
      }
  
      .close-btn {
        padding: 12px;
      }
  
      .toggle-switch {
        transform: scale(1.2);
      }
    }
    
    .sound-button img:not([loaded]) {
      background: rgba(255, 255, 255, 0.1);
    }
    
    .library-sound-thumbnail img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      will-change: transform;
      transform: translateZ(0);
      backface-visibility: hidden;
    }
    
    /* Headings Responsive */
    h2, h3, h4 {
      font-family: inherit;
      font-weight: 700;
      margin: 0;
    }
  
    h2, .instructions-title {
      font-size: 2.2rem;
    }
  
    h3, .section-header h3, .instructions-section h3 {
      font-size: 1.5rem;
      font-weight: 500;
      color: #fff;
    }
  
    h4 {
      font-size: 1.4rem; /* Increased for desktop */
    }
  
    @media (max-width: 480px) {
      h2, .instructions-title {
        font-size: 1.5rem;
      }
      h3, .section-header h3, .instructions-section h3 {
        font-size: 1.2rem;
      }
      h4 {
        font-size: 1.1rem; /* Increased for mobile */
      }
      .sound-library-list {
        padding: 0 !important;
      }
    }
    
    @media (max-width: 767px) {
      .sound-library-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
      }
    }
    
    /* Removed unused navigation styles: .custom-nav, .nav-left, .nav-logo, .nav-right, .nav-icon */
    
    /* Theme Modal Tab System */
    .theme-tabs {
      display: flex;
      gap: 8px;
      margin-bottom: 20px;
      border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .theme-tab-btn {
      background: none;
      border: none;
      color: rgba(255,255,255,0.7);
      padding: 10px 18px;
      cursor: pointer;
      font-size: 16px;
      font-weight: 500;
      border-radius: 8px 8px 0 0;
      transition: background 0.2s, color 0.2s;
      outline: none;
      position: relative;
    }
    .theme-tab-btn.active {
      color: #fff;
      background: rgb(220 231 255 / 12%);
      border-bottom: 2px solid #a9a9a9;
      z-index: 2;
    }
    .theme-tab-btn:focus {
      outline: 2px solid #7777777a;
    }
    .tab-pane {
      display: none;
    }
    .tab-pane.active {
      display: block;
    }
    
    .library-sound-status {
      position: absolute;
      left: 8px;
      bottom: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      background: rgba(0,0,0,0.5);
      border-radius: 50%;
      z-index: 2;
    }
    
    @media (min-width: 768px) {
      .sound-library-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 24px;
      }
    }
    
    .preset-theme.active {
      border: 2px solid #ffffff80 !important;
      box-sizing: border-box;
      z-index: 2;
    }
    
    #sound-library.bottom-sheet {
      background: rgba(102, 102, 102, 0.2) !important;
      backdrop-filter: blur(10px) !important;
    }
    
    #theme-modal.bottom-sheet {
      background: rgba(102, 102, 102, 0.2) !important;
      backdrop-filter: blur(10px) !important;
    }
    
    .todo-container {
      background: rgba(30, 30, 40, 0.65) !important;
      backdrop-filter: blur(18px) !important;
      -webkit-backdrop-filter: blur(18px) !important;
    }
    
    /* Remove old .todo-container styles (centered, fixed, etc.) */
    /* ... existing code ... */

    @media (min-width: 768px) {
      .sound-library-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
      }
    }
    
    .app-navbar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1000;
      background: transparent;
      padding: 1rem;
      /* Add any additional styling you need */
    }
    
    .webflow-navbar-container {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1000;
      background: transparent;
      pointer-events: none; /* This allows clicks to pass through to elements below */
    }
    
    /* This ensures any elements inside the container can receive clicks */
    .webflow-navbar-container > * {
      pointer-events: auto;
    }
    
    /* Ensure the main content doesn't get hidden behind the navbar */
    .main-content {
      padding-top: 80px; /* Adjust this value based on your navbar height */
    }
    
    /* Settings Button Positioning */
    .settings-btn {
      position: fixed;
      top: 20px;
      left: 20px;
      z-index: 1000;
    }
    
    /* Add styles for the new full screen modal */
    .full-screen-modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.8); /* Dark overlay */
      backdrop-filter: blur(10px);
      z-index: 1100; /* Higher than other modals */
      display: flex; /* To center modal container */
      align-items: center;
      justify-content: center;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .full-screen-modal.active {
      opacity: 1;
      visibility: visible;
    }
    
    .full-screen-modal .modal-container {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      border-radius: 12px;
      padding: 24px;
      width: 95%; /* Adjust max width as needed */
      max-width: 800px; /* Optional: limit max width */
      height: 95%; /* Adjust max height as needed */
      max-height: 90vh; /* Optional: limit max height */
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .full-screen-modal .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
      padding-bottom: 10px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .full-screen-modal .modal-header h2 {
      margin: 0;
      font-size: 28px;
      color: white;
    }
    
    .full-screen-modal .modal-content {
      flex-grow: 1;
      overflow-y: auto;
      padding-right: 8px; /* Space for scrollbar */
    }
    
    /* Scrollbar styles for modal content */
    .full-screen-modal .modal-content::-webkit-scrollbar {
      width: 8px;
    }
    
    .full-screen-modal .modal-content::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 4px;
    }
    
    .full-screen-modal .modal-content::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 4px;
    }
    
    .full-screen-modal .modal-content::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.3);
    }
    
    /* Adjust close button in modal header */
    .full-screen-modal .close-btn {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 50%;
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.2s;
    }
    
    .full-screen-modal .close-btn:hover {
      background-color: rgba(255, 255, 255, 0.2);
    }
    
    /* Mobile adjustments for modal */
    @media (max-width: 600px) {
      .full-screen-modal .modal-container {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 16px;
      }
      .full-screen-modal .modal-header {
        margin-bottom: 16px;
      }
      .full-screen-modal .modal-header h2 {
        font-size: 24px;
      }
      .full-screen-modal .close-btn {
        width: 36px;
        height: 36px;
      }
    }
    
    /* Auth Pages Styles */
    .auth-container {
      max-width: 350px;
      margin: 80px auto;
      padding: 32px 24px;
      background: rgba(30, 30, 30, 0.95);
      border-radius: 16px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.2);
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    .auth-container h2 {
      margin-bottom: 24px;
      color: #fff;
    }
    .auth-container form {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .auth-container input {
      padding: 10px 12px;
      border-radius: 8px;
      border: 1px solid #444;
      background: #222;
      color: #fff;
      font-size: 1rem;
    }
    .auth-container button {
      padding: 10px 0;
      border-radius: 8px;
      border: none;
      background: var(--ambient-accent, #1d69ff);
      color: #fff;
      font-weight: bold;
      font-size: 1rem;
      cursor: pointer;
      transition: background 0.2s;
    }
    .auth-container button:hover {
      background: #1551c1;
    }
    .auth-container p {
      margin-top: 18px;
      color: #bbb;
      font-size: 0.95rem;
    }
    .auth-container a {
      color: var(--ambient-accent, #1d69ff);
      text-decoration: underline;
    }
    .auth-error {
      color: #ff4d4f;
      margin-top: 12px;
      min-height: 20px;
      font-size: 0.98rem;
      text-align: center;
    }
    
    /* Minimal slider for mix mode */
    .mix-volume-slider {
      width: 80px;
      height: 2px;
      background: transparent;
      margin: 8px 0 0 0;
      padding: 0;
      appearance: none;
      -webkit-appearance: none;
      outline: none;
    }
    .mix-volume-slider::-webkit-slider-runnable-track {
      height: 2px;
      background: #fff;
      border-radius: 1px;
    }
    .mix-volume-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: #fff;
      cursor: pointer;
      margin-top: -6px;
      box-shadow: 0 0 2px rgba(0,0,0,0.1);
    }
    .mix-volume-slider:focus {
      outline: none;
    }
    .mix-volume-slider::-moz-range-thumb {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: #fff;
      cursor: pointer;
    }
    .mix-volume-slider::-moz-range-track {
      height: 2px;
      background: #fff;
      border-radius: 1px;
    }
    .mix-volume-slider::-ms-thumb {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: #fff;
      cursor: pointer;
    }
    .mix-volume-slider::-ms-fill-lower,
    .mix-volume-slider::-ms-fill-upper {
      background: #fff;
      border-radius: 1px;
    }
  
    /* Reduce padding/margin for sound items in mix mode */
    .library-sound-item {
      padding: 8px 4px;
      margin: 0 4px;
      box-sizing: border-box;
    }
    
    .library-sound-item {
      padding: 15px 15px !important;
      margin: 0 4px;
      box-sizing: border-box;
      border: 1px solid #ffe0e01f;
      background: rgba(102, 102, 102, 0.2);
      backdrop-filter: blur(10px);
  }
  
  .library-sound-thumbnail {
      width: 100px !important;
      height: 100px !important;
      border-radius: 8px !important;
      margin-bottom: 10px;
      background: #222;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: border 0.2s;
  }
  
  @media (max-width: 1200px) {
      .library-sound-thumbnail {
          width: 100px !important;
          height: 100px !important;
          border-radius: 8px !important;
          max-width: none !important;
          aspect-ratio: unset !important;
      }
  }
  
  @media (max-width: 900px) {
      .library-sound-thumbnail {
          width: 100px !important;
          height: 100px !important;
          border-radius: 8px !important;
          max-width: none !important;
          aspect-ratio: unset !important;
      }
  }
  
  @media (max-width: 600px) {
      .library-sound-item {
          max-width: 100%;
      }
    }
    
    /* Normal Mode Sound Library Card Styles */
    #sound-library .sound-library-list {
      display: grid;
      grid-template-columns: repeat(6, 1fr); /* Show 6 cards per row */
      gap: 16px;
      padding: 16px;
    }
  
    .library-sound-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      width: 100%;
    }
    
    .library-sound-wrapper .library-sound-item {
      width: 120px;
      height: 120px;
      flex-shrink: 0;
    }
    
    #sound-library .library-sound-item {
      position: relative;
      display: block; /* Change from flex */
      border-radius: 50%; /* Match theme card radius */
      overflow: hidden;
      cursor: pointer;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      background: rgba(0, 0, 0, 0.2); /* Subtle background */
      aspect-ratio: 100 / 100; /* Example aspect ratio, adjust based on desired card shape */
      padding: 0 !important; /* Remove padding from mix mode */
      margin: 0; /* Remove margin from mix mode */
      border: none; /* Remove border from mix mode */
      backdrop-filter: none; /* Remove backdrop filter from mix mode */
    }
  
    #sound-library .library-sound-item:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }
  
    #sound-library .library-sound-item.active {
        border: none; /* Remove active border from mix mode */
        box-shadow: 0 0 0 2px #ffffff80; /* Add active indicator */
        background: rgba(29,105,255,0.1); /* Subtle active background */
    }
  
    #sound-library .library-sound-item .library-sound-thumbnail img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100% !important;
      height: 100% !important;
      object-fit: cover !important;
      display: block;
      border-radius: 12px;
    }
    
    #sound-library .library-sound-item .library-sound-thumbnail {
      position: absolute !important;
      top: 0;
      left: 0;
      width: 100% !important;
      height: 100% !important;
      border-radius: 12px;
      overflow: hidden;
    }
  
  
    .library-sound-wrapper .library-sound-name {
      text-align: center;
      color: white; /* Text color over the dark gradient */
      font-size: 1rem; /* Adjust font size */
      font-weight: 500;
      padding: 0 8px; /* Add some horizontal padding */
      margin-top: 4px;
      text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); /* Add text shadow for readability */
    }
  
    /* Hide mix mode specific elements that are no longer needed in Normal Mode */
    /* Note: library-sound-thumbnail and library-sound-status were already handled in JS for Normal Mode */
    /* But keep these rules universal in case they were ever rendered */
    #sound-library .library-sound-thumbnail,
    #sound-library .library-sound-status {
        display: none;
    }
  
    /* Glass-like gradient border */
    #sound-library .library-sound-item::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 50%; /* Match card border-radius */
      padding: 2px; /* Adjust border thickness */
      background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.7) 0%, /* White at top */
        rgba(255, 255, 255, 0) 50%, /* Transparent in middle */
        rgba(110, 106, 104, 0.35) 100% /* Grayish at bottom */
      );
      -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      pointer-events: none; /* Ensure clicks go through */
      z-index: 2; /* Above image and overlay */
      opacity: 0.8; /* Adjust opacity as needed */
    }
  
    /* Mix Mode Volume Slider Positioning */
    .library-sound-wrapper .mix-volume-slider {
        width: 80%; /* Adjust width as needed */
        max-width: 100px; /* Limit max width */
        height: 4px; /* Make slider visible */
        margin: 8px auto 0 auto; /* Center horizontally and add top margin */
        display: block;
        background: rgba(255, 255, 255, 0.3); /* Visible track */
        border-radius: 2px;
    }
  
    .library-sound-wrapper .mix-volume-slider::-webkit-slider-runnable-track {
        background: transparent; /* Hide default track */
    }
  
    .library-sound-wrapper .mix-volume-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: #fff; /* White thumb */
        cursor: pointer;
        margin-top: -5px; /* Center thumb vertically */
        box-shadow: 0 0 2px rgba(0,0,0,0.1);
    }
  
    .library-sound-wrapper .mix-volume-slider::-moz-range-track {
         background: transparent; /* Hide default track */
    }
  
    .library-sound-wrapper .mix-volume-slider::-moz-range-thumb {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: #fff; /* White thumb */
        cursor: pointer;
    }
  
    .library-sound-wrapper .mix-volume-slider::-ms-thumb {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: #fff; /* White thumb */
        cursor: pointer;
    }
  
    .library-sound-wrapper .mix-volume-slider::-ms-fill-lower,
    .library-sound-wrapper .mix-volume-slider::-ms-fill-upper {
      background: transparent; /* Hide default track */
    }
  
    /* Adjust grid for smaller screens */
    @media (max-width: 767px) {
      #sound-library .sound-library-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Smaller cards on mobile */
        gap: 10px;
      }
      .library-sound-wrapper .library-sound-item {
          width: 100px;
          height: 100px;
      }
      .library-sound-wrapper .library-sound-name {
          font-size: 0.9rem; /* Smaller font size on mobile */
      }
       .library-sound-wrapper .mix-volume-slider {
           width: 90%; /* Adjust slider width for mobile */
           margin-top: 6px; /* Reduce margin on mobile */
       }
    }
    
    .preset-theme-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      width: 100%;
    }
    
    .preset-theme-wrapper .preset-theme {
      width: 120px;
      height: 120px;
      flex-shrink: 0;
    }
    
    .preset-theme-wrapper .theme-name {
      text-align: center;
      color: white;
      font-size: 0.9rem;
      font-weight: 500;
      padding: 0 8px;
      margin-top: 4px;
    }
    
    /* Preset Themes Card Styles */
    #theme-modal .preset-grid {
      display: grid;
      grid-template-columns: repeat(6, 1fr); /* Show 6 cards per row */
      gap: 16px;
      margin-top: 32px;
    }
  
    #theme-modal .preset-theme {
      position: relative;
      display: block; /* Ensure block layout */
      border-radius: 50%; /* Match sound library radius */
      overflow: hidden;
      cursor: pointer;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      background: rgba(0, 0, 0, 0.2); /* Subtle background */
      aspect-ratio: 150 / 180; /* Match sound library aspect ratio */
      padding: 0; /* Remove padding */
    }
  
    #theme-modal .preset-theme:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* Match sound library hover effect */
    }
  
    #theme-modal .preset-theme.active {
      border: none; /* Remove old active border */
      box-shadow: 0 0 0 2px #ffffff80; /* Add active indicator */
      background: rgba(29,105,255,0.1); /* Subtle active background */
    }
  
    #theme-modal .preset-theme .preset-preview {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      display: block;
      border-radius: 50%;
    }
  
  
    #theme-modal .preset-theme span {
      position: absolute;
      bottom: 10px; /* Position name at the bottom */
      left: 0;
      right: 0;
      text-align: center;
      color: white; /* Text color over the dark gradient */
      font-size: 1rem; /* Adjust font size */
      font-weight: 500;
      z-index: 1; /* Ensure name is above overlay */
      padding: 0 8px; /* Add some horizontal padding */
      text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); /* Add text shadow for readability */
    }
  
    /* Glass-like gradient border */
    #theme-modal .preset-theme::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 50%; /* Match card border-radius */
      padding: 2px; /* Adjust border thickness */
      background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.7) 0%, /* White at top */
        rgba(255, 255, 255, 0) 50%, /* Transparent in middle */
        rgba(110, 106, 104, 0.35) 100% /* Grayish at bottom */
      );
      -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      pointer-events: none; /* Ensure clicks go through */
      z-index: 2; /* Above image and overlay */
      opacity: 0.8; /* Adjust opacity as needed */
    }
  
    /* Adjust grid for smaller screens */
    @media (max-width: 767px) {
      #theme-modal .preset-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Smaller cards on mobile */
        gap: 10px;
      }
      .preset-theme-wrapper .preset-theme {
          width: 100px;
          height: 100px;
      }
      .preset-theme-wrapper .theme-name {
          font-size: 0.9rem; /* Smaller font size on mobile */
      }
    }
    
    /* Adjust grid for smaller screens */
    @media (max-width: 1200px) {
      #sound-library .sound-library-list,
      #theme-modal .preset-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 cards per row on medium screens */
      }
      .library-sound-wrapper .library-sound-item,
      .preset-theme-wrapper .preset-theme {
        width: 110px;
        height: 110px;
      }
    }
    
    @media (max-width: 900px) {
      #sound-library .sound-library-list,
      #theme-modal .preset-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 cards per row on smaller screens */
        gap: 12px;
      }
      .library-sound-wrapper .library-sound-item,
      .preset-theme-wrapper .preset-theme {
        width: 100px;
        height: 100px;
      }
    }
    
    @media (max-width: 767px) {
      #sound-library .sound-library-list,
      #theme-modal .preset-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 cards per row on mobile */
        gap: 10px;
      }
      .library-sound-wrapper .library-sound-item,
      .preset-theme-wrapper .preset-theme {
        width: 90px;
        height: 90px;
      }
    }
    
    /* Remove old blur classes completely - they're not needed anymore */
    .library-sound-item .blur,
    .preset-theme .blur {
        display: none !important;
    }


  
  
    /* Update card structure */
    .library-sound-item,
    .preset-theme {
        position: relative;
        display: block;
        border-radius: 50%;
        overflow: hidden;
        cursor: pointer;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        background: rgba(0, 0, 0, 0.15);
        aspect-ratio: 150 / 180;
        padding: 0;
    }
  
    /* Update image styles */
    .library-sound-item .library-sound-thumbnail img,
    .preset-theme .preset-preview {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transform: scale(1.05);
        transition: transform 0.3s ease;
    }
  
    /* Update hover effects */
    .library-sound-item:hover,
    .preset-theme:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    }
  
    .library-sound-item:hover .library-sound-thumbnail img,
    .preset-theme:hover .preset-preview {
        transform: scale(1.1);
    }
  
    /* Update active state */
    .library-sound-item.active,
    .preset-theme.active {
        border: none;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
        background: rgba(29, 105, 255, 0.15);
    }
  
    /* Glass-like gradient border */
    .library-sound-item::before,
    .preset-theme::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 50%;
        padding: 2px;
        background: linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(110, 106, 104, 0.4) 100%
        );
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
        z-index: 4;
        opacity: 0.9;
    }
  
    /* Mobile adjustments */
    @media (max-width: 767px) {
        .library-sound-item,
        .preset-theme {
            aspect-ratio: 120 / 150;
        }

        .library-sound-item .library-sound-name,
        .preset-theme .theme-name {
            font-size: 1rem;
            bottom: 10px;
            padding: 0 8px;
        }

        /* Fix thumbnail-blur progressive effect on mobile */
        .thumbnail-blur {
            z-index: 1;
            width: 100%;
            height: 100%;
            border-radius: 12px;
            -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px);
            position: absolute;
            top: 0%;
            bottom: 0%;
            left: 0%;
            right: 0%;
            overflow: hidden;
            -webkit-mask: linear-gradient(#0000 0%, #000 95%);
            mask: linear-gradient(#0000 0%, #000 95%);
        }

        /* Fallback for browsers that don't support CSS masks */
        @supports not (mask-image: linear-gradient(black, transparent)) {
            .thumbnail-blur {
                /* Use opacity gradient as fallback */
                background: linear-gradient(to top,
                    rgba(0, 0, 0, 0.1) 0%,
                    rgba(0, 0, 0, 0.05) 30%,
                    rgba(0, 0, 0, 0.02) 60%,
                    rgba(0, 0, 0, 0.01) 85%,
                    transparent 95%
                ) !important;
                -webkit-backdrop-filter: blur(3px) !important;
                backdrop-filter: blur(3px) !important;
            }
        }
    }

    /* Hide thumbnail-blur below 767px */
    .thumbnail-blur {
        display: none;
    }
    
    #sound-library .library-sound-item .mix-mode-icon {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 32px;
      height: 32px;
      z-index: 4;
      pointer-events: none;
      opacity: 0.9;
      filter: invert(100);
  }
  
  #sound-library .library-sound-item .mix-mode-icon img {
      width: 100%;
      height: 100%;
      object-fit: contain;
  }
  
  /* Only show mix mode icon when in mix mode */
  #sound-library:not(.mix-mode) .mix-mode-icon {
      display: none;
  }
  
  
  /* Ensure the icon is visible above the overlay */
  #sound-library .library-sound-item .mix-mode-icon {
      z-index: 4;
  }
  
  .library-sound-wrapper .library-sound-name {
      text-align: center;
      color: white;
      font-size: 1rem;
      font-weight: 500;
      padding: 0 8px;
      margin-top: 4px;
      text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  }
    
  @media (max-width: 767px) {
      .bottom-sheet {
          position: fixed;
          top: 10px;
          left: 0;
          right: 0;
          bottom: 0;
          width: 100%;
          height: calc(100% - 10px);
          border-radius: 20px 20px 0 0;
          background: rgba(18, 18, 18, 0.95);
          backdrop-filter: blur(10px);
          -webkit-backdrop-filter: blur(10px);
          z-index: 1000;
          transform: translateY(100%);
          transition: transform 0.3s ease-in-out;
      }
  
      .bottom-sheet.active {
          transform: translateY(0);
      }
  
      #sound-library.bottom-sheet,
      #theme-modal.bottom-sheet {
          top: 10px;
          height: calc(100% - 10px);
      }
  
      .sheet-header {
          padding: 16px;
          border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      }
  
      .sheet-content {
          height: calc(100% - 60px);
          overflow-y: auto;
          padding: 16px;
      }
  }
  
  /* Ensure the sheet stays full screen on mobile */
  @media (max-width: 767px) and (max-height: 600px) {
      .bottom-sheet {
          top: 10px;
          height: calc(100% - 10px);
      }
  }
    
  /* Large devices (desktops, less than 1200px) */
  @media (max-width: 1200px) {
      .sound-library-list {
          grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      }
      .library-sound-item {
          width: 100%;
      }
      .library-sound-thumbnail {
          height: 200px;
      }
  }
  
  /* Medium devices (tablets, less than 991px) */
  @media (max-width: 991px) {
      .sound-library-list {
          grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      }
      .library-sound-item {
          width: 100%;
      }
      .library-sound-thumbnail {
          height: 180px;
      }
  }
  
  /* Small devices (landscape phones, less than 767px) */
  @media (max-width: 767px) {
      .bottom-sheet {
          position: fixed;
          top: 10px;
          left: 0;
          right: 0;
          bottom: 0;
          width: 100%;
          height: calc(100% - 10px);
          border-radius: 20px 20px 0 0;
          background: rgba(18, 18, 18, 0.95);
          backdrop-filter: blur(10px);
          -webkit-backdrop-filter: blur(10px);
          z-index: 1000;
          transform: translateY(100%);
          transition: transform 0.3s ease-in-out;
      }
  
      .bottom-sheet.active {
          transform: translateY(0);
      }
  
      #sound-library.bottom-sheet,
      #theme-modal.bottom-sheet {
          top: 10px;
          height: calc(100% - 10px);
      }
  
      .sheet-header {
          padding: 16px;
          border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      }
  
      .sheet-content {
          height: calc(100% - 60px);
          overflow-y: auto;
          padding: 16px;
      }
  
      .sound-library-list {
          grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      }
  
      .library-sound-item {
          width: 100%;
      }
  
      .library-sound-thumbnail {
          height: 150px;
      }
  }
  
  /* Extra small devices (portrait phones, less than 478px) */
  @media (max-width: 478px) {
      .controls-container {
          bottom: 10px;
          z-index: 9999;
      }
      .control-btn {
          width: 40px;
          height: 40px;
      }
      .play-btn {
          width: 48px;
          height: 48px;
      }
      .control-btn svg {
          width: 20px;
          height: 20px;
      }
      .play-btn svg {
          width: 24px;
          height: 24px;
      }
      .sound-library-list {
          grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      }
      .library-sound-item {
          width: 100%;
      }
      .library-sound-thumbnail {
          height: 140px;
      }
  }
  
  /* Keep height-based and feature-based breakpoints */
  @media (max-height: 600px) and (orientation: landscape) {
      .bottom-sheet {
          top: 10px;
          height: calc(100% - 10px);
      }
  }
  
  @media (hover: none) and (pointer: coarse) {
      .library-sound-item {
          cursor: pointer;
      }
      .library-sound-thumbnail {
          cursor: pointer;
      }
      .library-sound-status {
          cursor: pointer;
      }
  }
    
  /* Large devices (1200px to 991px) - 6 columns */
  @media (max-width: 1200px) and (min-width: 992px) {
      #sound-library .sound-library-list,
      #theme-modal .preset-grid {
          grid-template-columns: repeat(6, 1fr);
          gap: 16px;
      }
  }
  
  /* Medium devices (991px and down) - 5 columns */
  @media (max-width: 991px) {
      #sound-library .sound-library-list,
      #theme-modal .preset-grid {
          grid-template-columns: repeat(5, 1fr);
          gap: 16px;
      }
  }
  
  /* Small devices (767px to 478px) - 4 columns */
  @media (max-width: 767px) and (min-width: 479px) {
      #sound-library .sound-library-list,
      #theme-modal .preset-grid {
          grid-template-columns: repeat(4, 1fr);
          gap: 12px;
      }
  }
  
  /* Extra small devices (478px and down) - 2 columns */
  @media (max-width: 478px) {
      #sound-library .sound-library-list,
      #theme-modal .preset-grid {
          grid-template-columns: repeat(2, 1fr);
          gap: 12px;
      }
      
      .library-sound-item,
      .preset-theme {
          width: 100%;
      }
      
      .library-sound-thumbnail,
      .preset-preview {
          height: 140px;
      }
  }
    
  /* Common gradient border styles */
  .library-sound-item::before,
  .preset-theme::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 50%;
      padding: 1px;
      background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
      -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.3s ease;
  }
  
  .library-sound-item:hover::before,
  .preset-theme:hover::before {
      opacity: 1;
  }
  
  .library-sound-item.active::before,
  .preset-theme.active::before {
      opacity: 1;
      background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
  }
  
  /* Update existing styles */
  .library-sound-item,
  .preset-theme {
      position: relative;
      border-radius: 50%;
      overflow: hidden;
      background: rgba(0, 0, 0, 0.2);
      transition: all 0.3s ease;
  }
  
  .library-sound-item:hover,
  .preset-theme:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  
  .library-sound-item.active,
  .preset-theme.active {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
    
  /* Statistics Modal Styles */
  .stats-container {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 24px;
      padding: 24px;
  }
  
  .stat-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      padding: 20px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 12px;
      position: relative;
      overflow: hidden;
  }
  
  .stat-item::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 12px;
      padding: 1px;
      background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
      -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      pointer-events: none;
  }
  
  .stat-label {
      font-size: 1rem;
      color: rgba(255, 255, 255, 0.7);
      margin-bottom: 8px;
  }
  
  .stat-value {
      font-size: 2.5rem;
      font-weight: 600;
      color: #fff;
      margin-bottom: 4px;
  }
  
  .stat-unit {
      font-size: 0.875rem;
      color: rgba(255, 255, 255, 0.5);
  }
  
  @media (max-width: 767px) {
      .stats-container {
          grid-template-columns: 1fr;
          gap: 16px;
          padding: 16px;
      }
  
      .stat-item {
          padding: 16px;
      }
  
      .stat-value {
          font-size: 2rem;
      }
  }
    
  .stats-btn {
      position: fixed;
      top: 20px;
      right: 80px;
      z-index: 1000;
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 50%;
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.3s ease;
  }
  
  .stats-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: translateY(-2px);
  }
  
  .stats-btn svg {
      width: 20px;
      height: 20px;
      color: #fff;
  }
  
  #stats-modal {
      position: fixed;
      bottom: 12px;
      left: 50%;
      transform: translateX(-50%) translateY(100%);
      width: 90%;
      max-width: 600px;
      background: rgba(102, 102, 102, 0.2);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border-top-left-radius: 24px;
      border-top-right-radius: 24px;
      transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 1000;
      box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.3);
      border: 1px solid rgba(255, 255, 255, 0.1);
  }

  #stats-modal.active {
      transform: translateX(-50%) translateY(0);
  }

  @media (max-width: 767px) {
    #stats-modal {
      width: 100%;
      left: 50%;
      transform: translateX(-50%) translateY(100%);
    }
    
    #stats-modal.active {
      transform: translateX(-50%) translateY(0);
    }
  }
  
  #stats-modal.hidden {
      display: none;
    }

  /* Enhanced modal content spacing */
  #stats-modal .sheet-content {
      padding: 24px;
      overflow-y: auto;
      scrollbar-width: none;
      -ms-overflow-style: none;
  }

  #stats-modal .sheet-content::-webkit-scrollbar {
      display: none;
  }

  
    /* --- To-Do List Styles (App Themed) --- */
  .todo-container {
      background-color: rgba(30, 30, 40, 0.95) !important;
      border-radius: 12px;
      padding: 24px 18px 12px 18px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.10);
      position: relative;
      transition: all 0.3s ease;
      overflow: hidden;
      color: #fff;
  }
  
  .todo-container.hidden {
      transform: translateX(-110%);
      opacity: 0;
      height: 0;
      padding: 0;
      overflow: hidden;
  }
  
  .show-list-btn {
      position: fixed;
      top: 20px;
      left: 20px;
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background-color: #222;
      color: white;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 2px 10px rgba(0,0,0,0.2);
      opacity: 0;
      transform: scale(0);
      transition: all 0.3s ease;
      z-index: 100;
  }
  .show-list-btn.visible {
      opacity: 1;
      transform: scale(1);
  }
  
  #current-date {
      display: flex;
      align-items: center;
      font-weight: 500;
      text-align: left;
      margin-bottom: 18px;
      gap: 10px;
  }
  .day-number {
      font-size: 40px;
      font-weight: 700;
      margin-right: 5px;
      color: #fff;
  }
  .month-day {
      display: flex;
      flex-direction: column;
      line-height: 1.2;
      color: #bbb;
      font-size: 15px;
  }
  
  #action-buttons {
      display: flex;
      gap: 15px;
      margin-top: 10px;
      justify-content: flex-end;
  }
  #action-buttons button {
      background: none;
      border: none;
      cursor: pointer;
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background-color: #23232a;
      transition: background 0.2s;
  }
  #action-buttons button:hover {
      background-color: #333;
  }
  
  #task-list {
      list-style-type: none;
      padding: 0;
      margin: 0;
      position: relative;
  }
  .task-item {
      display: flex;
      align-items: center;
      margin-bottom: 15px;
      padding-bottom: 15px;
      position: relative;
      transition: all 0.2s ease;
  }
  .task-item.dragging {
      opacity: 0.8;
      transform: scale(0.98);
      z-index: 1000;
      background-color: #23232a;
      border-radius: 4px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      border: 1px solid #444;
  }
  .task-item.drag-over {
      transform: translateY(-8px);
      box-shadow: 0 8px 16px rgba(0,0,0,0.1);
      margin-bottom: 23px;
  }
  .task-item:after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 40px;
      right: 0;
      border-bottom: 1px solid #23232a;
  }
  .task-circle {
      width: 18px;
      height: 18px;
      border: 2px solid #fff;
      border-radius: 50%;
      margin-right: 15px;
      cursor: pointer;
      position: relative;
      overflow: hidden;
      flex-shrink: 0;
      background: #18181f;
  }
  .task-circle::after {
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      background-color: transparent;
      border-radius: 50%;
  }
  .task-circle.in-progress::after {
      background-color: #fff;
      clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
      opacity: 0.7;
  }
  .task-circle.completed::after {
      background-color: #fff;
      opacity: 1;
  }
  .task-text {
      flex-grow: 1;
      font-size: 20px;
      margin: 0;
      cursor: pointer;
      outline: none;
      font-weight: 500;
      color: #fff;
      background: none;
      border: none;
      transition: color 0.2s;
  }
  .task-circle.completed + .task-text {
      text-decoration: line-through;
      color: #888;
  }
  .task-text[contenteditable="true"]:focus {
      border-bottom: 1px dashed #888;
  }
  .drag-handle {
      width: 20px;
      height: 20px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      cursor: grab;
      margin-left: 10px;
      opacity: 0.3;
      transition: opacity 0.2s ease;
  }
  .drag-handle:hover {
      opacity: 0.7;
  }
  .drag-handle:active {
      cursor: grabbing;
  }
  .drag-handle.hidden {
      display: none;
  }
  .drag-dots {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      grid-template-rows: repeat(3, 1fr);
      gap: 2px;
      width: 12px;
      height: 12px;
  }
  .drag-dot {
      width: 2px;
      height: 2px;
      background-color: #bbb;
      border-radius: 50%;
  }
  .feather {
      width: 18px;
      height: 18px;
      stroke-width: 2;
  }
  @media (max-width: 480px) {
      .todo-container {
          padding: 12px 6px 6px 6px;
      }
      #current-date {
          font-size: 22px;
      }
      .day-number {
          font-size: 26px;
      }
      .task-text {
          font-size: 16px;
      }
      #action-buttons button {
          width: 32px;
          height: 32px;
      }
      #action-buttons {
          gap: 8px;
      }
    }
    
    /* Sound Library Fixed Header */
    .sound-header-fixed {
      position: sticky;
      top: 0;
      z-index: 10;
      padding: 0px 28px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin: -24px -28px 30px -28px;
    }
    
    /* Mix Mode Tab Switcher */
    .mix-mode-switcher {
      display: flex;
      gap: 24px;
      align-items: center;
    }
    
    .mix-mode-btn {
      padding: 0;
      border: none;
      font-size: 16px;
      cursor: pointer;
      background: none;
      transition: all 0.2s ease;
      color: var(--text-secondary);
      font-weight: normal;
      position: relative;
    }
    
    .mix-mode-btn.active {
      color: var(--text-primary);
      font-weight: 500;
    }
    
    .mix-mode-btn.active::after {
      content: '';
      position: absolute;
      bottom: -4px;
      left: 0;
      right: 0;
      height: 1px;
      background-color: var(--accent-primary);
    }
    
    /* Theme Header Fixed */
    .theme-header-fixed {
      position: sticky;
      top: 0;
      z-index: 10;
      padding: 0px 28px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin: -24px -28px 30px -28px;
    }
    
    .theme-mode-switcher {
      display: flex;
      gap: 24px;
      align-items: center;
    }
    
    .theme-mode-btn {
      padding: 0;
      border: none;
      font-size: 16px;
      cursor: pointer;
      background: none;
      transition: all 0.2s ease;
      color: var(--text-secondary);
      font-weight: normal;
      position: relative;
    }
    
    .theme-mode-btn.active {
      color: var(--text-primary);
      font-weight: 500;
    }
    
    .theme-mode-btn.active::after {
      content: '';
      position: absolute;
      bottom: -4px;
      left: 0;
      right: 0;
      height: 1px;
      background-color: var(--accent-primary);
    }
    
    /* Stats Header Fixed */
    .stats-header-fixed {
      position: sticky;
      top: 0;
      z-index: 10;
      padding: 0px 28px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin: -24px -28px 30px -28px;
    }
    
    .stats-header-fixed h3 {
      color: var(--text-primary);
      font-weight: 600;
      font-size: 18px;
      letter-spacing: -0.01em;
      margin: 0;
    }
    
    /* Todo Header Fixed */
    .todo-header-fixed {
      position: sticky;
      top: 0;
      z-index: 10;
      padding: 0px 28px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin: -24px -28px 30px -28px;
    }
    
    /* Responsive adjustments for fixed headers */
    @media (max-width: 767px) {
      .sound-header-fixed,
      .theme-header-fixed,
      .stats-header-fixed,
      .todo-header-fixed {
        padding: 0px 16px 16px;
        margin: -16px -16px 30px -16px;
      }
    }
    
    /* Style for the copy button in the todo action buttons */
    .copy-btn {
      background: none;
      border: none;
      color: inherit;
      cursor: pointer;
      padding: 0 8px;
      font-size: 18px;
      display: flex;
      align-items: center;
      transition: color 0.2s;
    }
    .copy-btn:hover {
      color: #ffd700;
    }
    
    /* Settings Dropdown Styles */
    .settings-dropdown {
      z-index: 2001;
      display: flex;
      flex-direction: column;
      row-gap: 4px;
      width: 270px;
      height: max-content;
      padding: 4px;
      border-radius: 8px;
      background: rgba(40, 40, 40, 0.98);
      box-shadow: 0 4px 16px rgba(0,0,0,0.18);
      position: absolute;
      top: 110%;
      left: 0;
    }
    .settings-dropdown.show {
      display: flex;
    }
    .dropdown-item {
      padding: 10px 18px;
      color: #fff;
      cursor: pointer;
      font-size: 15px;
      transition: background 0.18s;
      border-radius: 6px;
    }
    .dropdown-item:hover {
      background: #1d69ff;
      color: #fff;
    }

    /* Remove special settings-dot style */
    .settings-dot { all: unset; }

    .settings-dot {
      background: linear-gradient(135deg, #1d69ff 60%, #fff 100%);
      border: 2px solid #fff;
      box-shadow: 0 2px 8px rgba(30,80,255,0.18);
      width: 16px;
      height: 16px;
      border-radius: 50%;
      cursor: pointer;
      transition: box-shadow 0.2s, border 0.2s;
    }
    .settings-dot:hover {
      box-shadow: 0 4px 16px #1d69ff55;
      border: 2px solid #1d69ff;
    }
    @media (max-width: 480px) {
      
    }
    
    .settings-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: 1fr 1fr;
      gap: 8px 18px;
      margin-bottom: 10px;
    }
    .settings-cell {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: rgba(255,255,255,0.04);
      border-radius: 8px;
      padding: 6px 10px 6px 12px;
      font-size: 1.05rem;
      min-width: 120px;
    }
    .settings-cell span:first-child {
      color: #ffffff;
      font-weight: 500;
      letter-spacing: 0.01em;
    }
    .settings-cell input[type="number"] {
      width: 38px;
      border: none;
      background: transparent;
      color: #eaeaea;
      font-size: 1.05rem;
      text-align: right;
      outline: none;
      margin-left: 8px;
      margin-right: 2px;
      border-bottom: 1px solid #eee;
      border-radius: 0;
      padding: 2px 0;
    }
    .settings-cell .unit {
      color: #cacaca;
      font-size: 0.98em;
      margin-left: 2px;
      min-width: 18px;
    }

#theme-modal .preset-theme .card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.library-sound-item .card-image, .preset-theme .card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Loading animation for theme application */
.preset-theme.loading {
    position: relative;
}

.preset-theme.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.preset-theme.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

#theme-modal .preset-theme {
  position: relative;
  display: block;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: rgba(0, 0, 0, 0.2);
  aspect-ratio: 150 / 180;
  padding: 0;
}

#theme-modal .preset-theme .theme-description {
  position: absolute;
  bottom: 35px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  z-index: 1;
  padding: 0 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  font-weight: normal;
  line-height: 1.2;
}

#theme-modal .preset-theme span {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 1rem;
  font-weight: 500;
  z-index: 1;
  padding: 0 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Theme Category Bar Styles */
.theme-category-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 18px;
  justify-content: flex-start;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
}

.theme-category-bar::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}
.theme-category-btn {
  padding: 7px 18px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  outline: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  flex-shrink: 0;
  white-space: nowrap;
}
.theme-category-btn.active {
  background: var(--ambient-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(29,105,255,0.15);
}
.theme-category-btn:hover:not(.active) {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* === Enhanced Insights Dashboard Styles === */

/* Top Stats Cards */
.insights-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.insights-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  background: var(--glass-bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.insights-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.insights-stat-card:hover {
  background: var(--glass-bg-tertiary);
  border-color: var(--glass-border-strong);
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow-heavy);
}

.insights-stat-card:hover::before {
  opacity: 1;
}

.insights-stat-time {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.insights-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Period Toggle */
.insights-period-toggle {
  display: flex;
  background: var(--glass-bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 6px;
  margin-bottom: 24px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.period-btn {
  flex: 1;
  padding: 14px 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.period-btn.active {
  background: linear-gradient(135deg, var(--glass-bg-tertiary), var(--glass-bg-secondary));
  color: var(--text-primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border-strong);
}

.period-btn:hover:not(.active) {
  color: var(--text-primary);
  background: var(--glass-bg-secondary);
}

/* Period Navigation */
.insights-period-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  gap: 20px;
}

.period-nav-btn {
  width: 40px;
  height: 48px;
  border: none;
  background: var(--glass-bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.period-nav-btn:hover {
  background: var(--glass-bg-tertiary);
  color: var(--text-primary);
  border-color: var(--glass-border-strong);
  transform: translateY(-1px);
}

.period-nav-btn:active {
  transform: translateY(0);
}

.period-display {
  text-align: center;
  min-width: 140px;
}

.period-main {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.period-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Chart Type Tabs */
.insights-chart-tabs {
  display: flex;
  background: var(--glass-bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 24px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.chart-tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.chart-tab.active {
  background: var(--glass-bg-tertiary);
  color: var(--text-primary);
  box-shadow: var(--glass-shadow-inset), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-tab:hover:not(.active) {
  color: var(--text-primary);
  background: var(--glass-bg-secondary);
}

/* Chart Container */
.insights-chart-container {
  background: var(--glass-bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.insights-chart-container::-webkit-scrollbar {
  display: none;
}

.insights-chart {
  height: auto;
  position: relative;
}

/* Week Chart Styles */
.week-chart {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  height: 200px;
  padding: 0 8px;
}

.week-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.week-bar-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  min-height: 18px;
  display: flex;
  align-items: center;
}

.week-bar {
  flex: 1;
  width: 100%;
  background: var(--glass-bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
  min-height: 4px;
  display: flex;
  align-items: end;
}

.week-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #00D4FF 0%, var(--accent-primary) 50%, var(--accent-hover) 100%);
  border-radius: var(--radius-md);
  transition: height 0.8s var(--ease-expo);
  min-height: 3px;
  box-shadow: 0 -2px 12px rgba(0, 122, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
}

.week-bar-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  border-radius: var(--radius-md);
}

.week-bar-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
}

/* Month Chart Styles */
.month-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  row-gap: 25px;
  margin-bottom: 16px;
  padding: 8px;
  justify-items: center;
}

.month-day {
  width: 32px;
  height: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  position: relative;
  cursor: default;
  transition: var(--transition-normal);
}

.month-day.has-data {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
  transform: scale(1.0);
}

.month-day.has-data:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

.month-day-time {
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-shadow: none;
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  line-height: 1;
  white-space: nowrap;
}

.month-day-number {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1;
}

.month-day.has-data .month-day-number {
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  margin-top: 3px;
}

.month-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.month-label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.month-label {
  color: var(--text-secondary);
  margin-bottom: 5px;
}

/* Download Button */
.insights-download-btn {
  width: 100%;
  padding: 16px;
  border: none;
  background: var(--glass-bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-normal);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}

.insights-download-btn:hover {
  background: var(--glass-bg-tertiary);
  border-color: var(--glass-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-heavy);
}

.insights-download-btn:active {
  transform: translateY(0);
}

.insights-download-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 8px;
  font-style: italic;
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
  .insights-stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  .insights-stat-card {
    padding: 16px 12px;
  }

  .insights-stat-time {
    font-size: 1.5rem;
  }

  .insights-chart-container {
    padding: 16px;
  }

  .week-chart {
    height: 150px;
    gap: 4px;
    padding: 0 4px;
  }

  .week-bar-time {
    font-size: 0.7rem;
    margin-bottom: 6px;
  }

  .week-bar-label {
    font-size: 0.7rem;
    margin-top: 6px;
  }

  .month-chart {
    gap: 4px;
    row-gap: 20px;
  }

  .insights-chart-container {
    padding-top: 20px;
    padding-left: 5px;
    padding-right: 5px;
  }

  .month-day-time {
    font-size: 0.6rem;
  }

  .month-day-number {
    font-size: 0.7rem;
  }

  .insights-download-btn {
    padding: 14px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .insights-period-nav {
    gap: 12px;
  }

  .insights-chart-tabs {
    gap: 5px;
  }
  
  /* Timer mobile styles */
  .mode-switcher {
    gap: 20px;
    margin-bottom: 5px;
  }
  
  .mode-btn {
    font-size: 13px;
  }
  
  .timer-display {
    margin-bottom: 10px;
  }
  
  .progress-bar {
    margin-bottom: 10px;
  }
  
  .cycles-container {
    margin-top: 15px;
  }

  .period-nav-btn {
    width: 36px;
    height: 36px;
  }

  .period-display {
    min-width: 120px;
  }

  .period-main {
    font-size: 1.1rem;
  }

  .insights-chart-tabs {
    padding: 3px;
  }

  .chart-tab {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

}

/* Blur effect for cards */
.library-sound-item .blur,
.preset-theme .blur {
    z-index: 1;
    width: 100%;
    height: 100%;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    position: absolute;
    top: 0%;
    bottom: 0%;
    left: 0%;
    right: 0%;
    overflow: hidden;
    -webkit-mask: linear-gradient(#0000 0%, #000 95%);
    mask: linear-gradient(#0000 0%, #000 95%);
    background: rgba(0, 0, 0, 0.1);
}

/* Remove any existing blur classes */
.library-sound-item .blur,
.preset-theme .blur {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .library-sound-item,
    .preset-theme {
        aspect-ratio: 120 / 150;
    }
    
    .library-sound-item .library-sound-name,
    .preset-theme .theme-name {
        font-size: 1rem;
        bottom: 10px;
        padding: 0 8px;
    }
    
    /* Consistent blur effect for mobile */
    .library-sound-item .blur,
    .preset-theme .blur {
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
        -webkit-mask: linear-gradient(#0000 0%, #000 95%);
        mask: linear-gradient(#0000 0%, #000 95%);
    }
}

/* Base blur effect for cards */
.library-sound-item .thumbnail-blur,
.preset-theme .thumbnail-blur {
    z-index: 1;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    overflow: hidden;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    -webkit-mask: linear-gradient(to bottom, transparent 0%, black 95%);
    mask: linear-gradient(to bottom, transparent 0%, black 95%);
    background: rgba(0, 0, 0, 0.1);
}

/* Remove old blur classes */
.library-sound-item .blur,
.preset-theme .blur {
    display: none !important;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .library-sound-item,
    .preset-theme {
        aspect-ratio: 120 / 150;
    }
    
    .library-sound-item .library-sound-name,
    .preset-theme .theme-name {
        font-size: 1rem;
        bottom: 10px;
        padding: 0 8px;
    }
    
    /* Keep blur effect consistent on mobile */
    .library-sound-item .thumbnail-blur,
    .preset-theme .thumbnail-blur {
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
        -webkit-mask: linear-gradient(to bottom, transparent 0%, black 95%);
        mask: linear-gradient(to bottom, transparent 0%, black 95%);
    }
}

/* Fallback for browsers that don't support CSS masks */
@supports not (mask-image: linear-gradient(black, transparent)) {
    .library-sound-item .thumbnail-blur,
    .preset-theme .thumbnail-blur {
        background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.1) 0%,
            rgba(0, 0, 0, 0.05) 30%,
            rgba(0, 0, 0, 0.02) 60%,
            rgba(0, 0, 0, 0.01) 85%,
            transparent 95%
        );
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .library-sound-item,
    .preset-theme {
        aspect-ratio: 120 / 150;
    }
    
    .library-sound-item .library-sound-name,
    .preset-theme .theme-name {
        font-size: 1rem;
        bottom: 10px;
        padding: 0 8px;
    }
    
    /* Remove old blur class */
    .library-sound-item .blur,
    .preset-theme .blur {
        display: none !important;
    }
    
    /* Keep thumbnail-blur consistent with desktop */
    .library-sound-item .thumbnail-blur,
    .preset-theme .thumbnail-blur {
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
        -webkit-mask: linear-gradient(to bottom, transparent 0%, black 95%);
        mask: linear-gradient(to bottom, transparent 0%, black 95%);
    }
}

/* Remove all old blur classes */
.library-sound-item .blur,
.preset-theme .blur,
.library-sound-item .card-overlay,
.preset-theme .card-overlay {
    display: none !important;
}

/* Base thumbnail-blur effect - consistent across all viewport sizes */
.library-sound-item .thumbnail-blur,
.preset-theme .thumbnail-blur {
    z-index: 1;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    overflow: hidden;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    -webkit-mask: linear-gradient(to bottom, transparent 0%, black 95%);
    mask: linear-gradient(to bottom, transparent 0%, black 95%);
    background: rgba(0, 0, 0, 0.1);
}

/* Mobile adjustments - only adjust layout, not blur effect */
@media (max-width: 767px) {
    .library-sound-item,
    .preset-theme {
        aspect-ratio: 120 / 150;
    }
    
    .library-sound-item .library-sound-name,
    .preset-theme .theme-name {
        font-size: 1rem;
        bottom: 10px;
        padding: 0 8px;
    }
}

/* Fallback for browsers that don't support CSS masks */
@supports not (mask-image: linear-gradient(black, transparent)) {
    .library-sound-item .thumbnail-blur,
    .preset-theme .thumbnail-blur {
        background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.1) 0%,
            rgba(0, 0, 0, 0.05) 30%,
            rgba(0, 0, 0, 0.02) 60%,
            rgba(0, 0, 0, 0.01) 85%,
            transparent 95%
        );
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
}

/* Right dropdown positioning - only one definition */
.dropdown-menu.right {
  right: 0;
  left: auto;
  /* Ensure dropdown's right edge aligns with button's right edge */
  transform: translateX(0);
  max-width: calc(100vw - 20px);
  min-width: 220px;
  /* Prevent dropdown from extending beyond viewport */
  position: absolute;
  /* Ensure dropdown's right edge aligns with button's right edge */
  transform: translateX(0);
}
@media (max-width: 768px) {
  .dropdown-menu.right {
    right: 10px;
    max-width: calc(100vw - 40px);
  }
}
@media (max-width: 480px) {
  .dropdown-menu.right {
    right: 10px;
    min-width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
  }
}

/* Mobile adjustments - only adjust layout, not blur effect */
@media (max-width: 767px) {
    .library-sound-item,
    .preset-theme {
        aspect-ratio: 120 / 150;
    }
    
    .library-sound-item .library-sound-name,
    .preset-theme .theme-name {
        font-size: 1rem;
        bottom: 10px;
        padding: 0 8px;
    }
}

/* Fallback for browsers that don't support CSS masks */
@supports not (mask-image: linear-gradient(black, transparent)) {
    .library-sound-item .thumbnail-blur,
    .preset-theme .thumbnail-blur {
        background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.1) 0%,
            rgba(0, 0, 0, 0.05) 30%,
            rgba(0, 0, 0, 0.02) 60%,
            rgba(0, 0, 0, 0.01) 85%,
            transparent 95%
        );
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
}

/* Single Mode Control Panel */
.single-mode-container {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.single-mode-container.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.single-mode-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(63, 63, 63, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.mode-control-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.mode-control-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.05) 100%
    );
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mode-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.mode-control-btn:hover::before {
    opacity: 1;
}

.mode-control-btn:active {
    transform: scale(0.95);
}

.mode-control-btn.active {
    background: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.current-sound-display {
    min-width: 180px;
    max-width: 250px;
    text-align: center;
    overflow: hidden;
}

#current-sound-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Mix Count Display */
.mix-count {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.mix-menu-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mix-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.1);
}

/* Enhanced Dropdowns */
.enhancer-dropdown {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    background: rgb(63 63 63 / 50%);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 16px;
    border: none;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.enhancer-dropdown:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.preset-select {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 15px;
    color: white;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.preset-select::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.05) 100%
    );
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.preset-select:hover::before {
    opacity: 1;
}

.preset-select option {
    background: rgba(63, 63, 63, 0.9);
    color: white;
    padding: 8px;
}

.custom-controls {
    margin-bottom: 12px;
    padding: 12px;
    background: transparent;
    border-radius: 15px;
    border: none;
    position: relative;
    overflow: hidden;
}

.custom-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.03) 100%
    );
    border-radius: 15px;
    opacity: 1;
    pointer-events: none;
}

.custom-controls:not(.hidden) {
    display: block;
}

.custom-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.custom-row label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-row input[type="number"] {
    background: transparent;
    border: none;
    border-radius: 10px;
    color: white;
    padding: 8px 12px;
    width: 70px;
    font-size: 12px;
    outline: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.custom-row input[type="number"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.05) 100%
    );
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.custom-row input[type="number"]:focus::before {
    opacity: 1;
}

.dropdown-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.enhancer-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.enhancer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.05) 100%
    );
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.enhancer-btn:hover::before {
    opacity: 1;
}

.enhancer-btn:hover {
    transform: scale(1.05);
}

.enhancer-btn:active {
    transform: scale(0.95);
}

.enhancer-btn.stop-btn {
    background: transparent;
}

.enhancer-btn.stop-btn::before {
    background: radial-gradient(circle, 
        rgba(239, 68, 68, 0.3) 0%, 
        rgba(239, 68, 68, 0.1) 100%
    );
}

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

/* Volume Control */
.volume-control {
    margin: 12px 0;
    padding: 12px;
    background: transparent;
    border-radius: 15px;
    border: none;
    position: relative;
    overflow: hidden;
}

.volume-control::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.03) 100%
    );
    border-radius: 15px;
    opacity: 1;
    pointer-events: none;
}

.volume-control label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.volume-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Mix Mode Menu */
.mix-mode-menu {
    position: fixed;
    bottom: 160px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-width: 90vw;
    background: rgba(63, 63, 63, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    max-height: 400px;
    overflow-y: auto;
}

.mix-mode-menu:not(.hidden) {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.mix-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-top: 0;
}

.mix-menu-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    text-align: center;
    flex: 1;
}

.close-mix-btn, .save-mix-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-mix-btn:hover, .save-mix-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.mix-sounds-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px;
    margin-bottom: 20px;
    /* Hide scrollbar for webkit browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.mix-sounds-list::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.mix-sound-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.mix-sound-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.mix-sound-icon img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.mix-sound-icon img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.mix-sound-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.mix-sound-name {
    color: white;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mix-sound-content .mix-volume-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    appearance: none;
    cursor: pointer;
    position: relative;
}

.mix-volume-slider::-webkit-slider-track {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
}

.mix-sound-content .mix-volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    margin-top: -6px;
    position: relative;
}

.mix-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.mix-volume-slider::-moz-range-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.remove-sound-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.remove-sound-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}


.clear-all-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #333;
    padding: 16px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 20px 40px 20px;
}

.clear-all-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .enhancer-dropdown {
        width: 260px;
        padding: 12px;
    }
    
    .current-sound-display {
        min-width: 140px;
        max-width: 180px;
    }
    
    .single-mode-panel {
        padding: 10px 16px;
        gap: 12px;
    }
    
    .custom-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .custom-row label {
        justify-content: center;
    }
}
