.outfit-font {
  font-family: 'Outfit', sans-serif;
}

.bg-gradient {
  --background: radial-gradient(circle at top left, #2d3436 0%, #121212 100%);
  background: radial-gradient(circle at top left, #2d3436 0%, #121212 100%);
}

.custom-searchbar {
  flex: 1 !important;
  --background: transparent !important;
  --color: white;
  --placeholder-color: rgba(255, 255, 255, 0.4);
  --icon-color: var(--ion-color-secondary);
  --box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;

  &::part(container) {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  
  &::part(input-container) {
    background: transparent !important;
  }
}

.search-wrapper-group {
  display: flex;
  flex-direction: column;
  padding: 2px 16px 12px 16px; // Reduced top padding
  gap: 12px;
}

.search-row {
  width: 100%;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 2px 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);

  .voice-search-btn {
    --padding-start: 8px;
    --padding-end: 8px;
    margin: 0;
    height: 44px;
    
    ion-icon {
      font-size: 1.5rem;
    }
  }
}

.filter-actions-row {
  display: flex;
  align-items: center;
  width: 100%;
  overflow-x: auto;
  gap: 12px;
  padding: 8px 4px 8px 0;
  
  // Hide scrollbar but keep functionality
  &::-webkit-scrollbar {
    display: none;
  }
  -ms-overflow-style: none;
  scrollbar-width: none;

  .song-count-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--ion-color-secondary-rgb), 0.15);
    border: 1px solid rgba(var(--ion-color-secondary-rgb), 0.3);
    padding: 0 12px;
    border-radius: 12px;
    height: 32px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--ion-color-secondary);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .filter-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;

    ion-button.filter-chip {
      --border-radius: 20px;
      --border-width: 1px;
      font-family: 'Outfit', sans-serif;
      font-weight: 500;
      margin: 0;
      min-height: 32px;
      font-size: 0.85rem;
      text-transform: none;
      letter-spacing: normal;

      .close-icon-wrapper {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: 6px;
        padding: 4px;
        margin-right: -8px;
        cursor: pointer;
        z-index: 100;
        
        ion-icon {
          font-size: 1.2rem;
          margin: 0;
          pointer-events: none;
        }

        &:active {
          opacity: 0.5;
          transform: scale(0.9);
        }
      }
    }

  }
}




.transparent-list {
  background: transparent !important;
  padding-bottom: 120px; // Spazio per il player fisso
}

ion-item.glass {
  --background: rgba(255, 255, 255, 0.05);
  --border-radius: 16px;
  --padding-start: 16px;
  --inner-padding-end: 16px;
  margin-bottom: 12px;
  transition: transform 0.2s ease, background 0.2s ease;
  
  &:active {
    transform: scale(0.98);
    --background: rgba(255, 255, 255, 0.1);
  }
}

ion-title {
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ion-color-secondary);
  padding-inline: 0;
  
  .add-btn, .settings-btn {
  --color: var(--ion-color-secondary);
  --padding-start: 8px;
  --padding-end: 8px;
  font-size: 1.2rem;
}  

  .header-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 16px 0 16px 24px; // Spacing adjusted for search bar breathing room
  }

  .header-logo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(var(--ion-color-secondary-rgb), 0.2);
  }

  .header-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1;

    .app-name {
      font-size: 1.4rem;
      font-weight: 700;
      color: var(--ion-color-secondary);
      margin-bottom: 2px;
    }

    .version-badge {
      font-size: 0.8rem;
      font-weight: 500;
      color: rgba(255, 255, 255, 0.4);
      letter-spacing: 0.5px;
    }
  }
}


.settings-btn {
  margin-right: 16px;
}

.special-list-banner {
  --background: rgba(var(--ion-color-secondary-rgb), 0.1);
  --border-style: none;
  border-bottom: 1px solid rgba(var(--ion-color-secondary-rgb), 0.2);
  
  .banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 40px;

    .banner-text {
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--ion-color-secondary);
      font-weight: 600;
      font-size: 0.9rem;

      small {
        opacity: 0.6;
        font-weight: 400;
        font-size: 0.75rem;
      }
    }

    ion-button {
      --padding-start: 4px;
      --padding-end: 4px;
      margin: 0;
      height: 32px;
      font-size: 1.2rem;
    }
  }
}

.results-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ion-color-secondary);
  background: rgba(var(--ion-color-secondary-rgb), 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  margin-right: 0;
  border: 1px solid rgba(var(--ion-color-secondary-rgb), 0.1);
  transition: all 0.2s ease;
  cursor: pointer;

  &.is-filtered {
    background: rgba(var(--ion-color-secondary-rgb), 0.2);
    border-color: var(--ion-color-secondary);
    box-shadow: 0 0 10px rgba(var(--ion-color-secondary-rgb), 0.1);
  }

  &:active {
    transform: scale(0.95);
  }

  ion-icon {
    font-size: 1.1rem;
    margin-left: 2px;
  }

  .canti-label {
    display: inline;
  }

  @media (max-width: 380px) {
    .canti-label {
      display: none;
    }
  }
}

.loading-container {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.loading-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.percentage-label {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ion-color-secondary);
  text-shadow: 0 0 15px rgba(253, 203, 110, 0.3);
}

.no-padding-top {
  padding-top: 0 !important;
}

.search-wrapper-group {
  display: flex;
  flex-direction: column;
  padding: 6px 16px 8px 16px; // Added slight top padding for search bar breathing room
  gap: 8px;
}

.momentos-toolbar {
  --min-height: 32px;
  padding-bottom: 8px;
}

.momento-scroll {
  display: flex;
  overflow-x: auto;
  padding: 0 16px;
  gap: 10px;
  scrollbar-width: none;
  &::-webkit-scrollbar {
    display: none;
  }
}

.momento-chip {
  flex: 0 0 auto;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Outfit', sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  white-space: nowrap;

  &.active {
    background: var(--ion-color-secondary) !important;
    color: #000;
    font-weight: 600;
    border-color: var(--ion-color-secondary);
  }

  &.comunita-chip {
    display: inline-flex;
    align-items: center;
    border-left: 3px solid rgba(var(--ion-color-secondary-rgb), 0.6);
    background: rgba(var(--ion-color-secondary-rgb), 0.08);

    &.active {
      border-left-color: #000;
    }
  }
}

.non-validati-add-icon {
  font-size: 1.1rem;
  color: #000;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  padding: 2px;
  display: inline-block;
  vertical-align: middle;
}

:host-context(body.high-contrast) {
  .non-validati-add-icon {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2) !important;
  }
}

// Custom Item Layout
.custom-item {
  --padding-start: 16px;
  --inner-padding-end: 16px;
  --min-height: 70px; // Reduced height
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  &.is-playing {
    --background: rgba(var(--ion-color-secondary-rgb), 0.15) !important;
    border-left: 4px solid var(--ion-color-secondary);
    box-shadow: inset 0 0 20px rgba(var(--ion-color-secondary-rgb), 0.1);
    transform: scale(1.02);
    margin-left: 8px;
    margin-right: 8px;
    border-radius: 12px;
    z-index: 10;
  }

  .playlist-name-chip {
    margin-right: 8px;
    max-width: 150px;
    
    span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .close-icon {
      font-size: 1.2rem;
      margin-left: 4px;
      opacity: 0.8;
    }
  }
  .item-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    
    .selection-column {
      padding: 10px 14px 10px 0;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 100;
      position: relative;
    }

    .content-column {
      flex: 1;
      display: flex;
      flex-direction: column;
      padding: 10px 0;
      cursor: pointer;
      overflow: hidden;

      .top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
      }

      .info-section {
        flex: 1;
        margin: 0;
        padding: 0;
      }
    }

    .canto-number {
      position: relative;
      width: 32px;
      height: 32px;
      line-height: 28px;
      text-align: center;
      background: rgba(var(--ion-color-secondary-rgb), 0.1);
      color: var(--ion-color-secondary);
      font-size: 0.85rem;
      border-radius: 8px;
      font-weight: 700;
      border: 2px solid var(--ion-color-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      pointer-events: none; 

      &.selected-number {
        background: var(--ion-color-secondary) !important;
        color: #000 !important;
        box-shadow: 0 0 15px rgba(var(--ion-color-secondary-rgb), 0.5);
        transform: scale(1.1);
      }
    }
  }
  .player-inline-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 4px;
    
    &.full-width {
      margin-top: 4px;
      padding-top: 4px;
      border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    ion-range {
      flex: 1;
      padding: 0;
      --bar-height: 2px;
      --knob-size: 10px;
    }
  }

  .thumb-container {
    &.compact {
      width: 50px;
      height: 38px;
      border-radius: 8px;
      margin-left: 12px;
    }
  }

  .thumb-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
  }

  .hidden-player {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  .thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;

    &.loaded {
      opacity: 1;
    }
  }

  .skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05) 25%,
      rgba(255, 255, 255, 0.1) 50%,
      rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
  }
  
  .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    backdrop-filter: blur(4px);
    z-index: 2;
    pointer-events: none;
    
    ion-icon {
      font-size: 14px;
      margin-left: 2px;
    }
  }

  .youtube-overlay {
    background: rgba(0, 0, 0, 0.6) !important;
    ion-icon {
      color: #ff0000;
      font-size: 16px;
      margin-left: 0;
    }
  }

  .offline-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    gap: 4px;

    ion-icon {
      font-size: 1.2rem;
    }
    span {
      font-size: 0.6rem;
      text-transform: uppercase;
      font-weight: 700;
      font-family: 'Outfit', sans-serif;
    }
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.finish-selection-fab {
  --border-radius: 30px;
  width: auto;
  min-width: 120px;
  
  .fab-content {
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    
    ion-icon {
      font-size: 1.4rem;
    }
    
    .fab-label {
      font-size: 0.9rem;
      font-weight: 600;
      text-transform: none;
    }
  }
}

.selection-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(var(--ion-color-secondary-rgb), 0.15) !important;
  border: 1px solid rgba(var(--ion-color-secondary-rgb), 0.3);
  padding: 2px 4px 2px 10px;
  border-radius: 20px;
  height: 32px;
  flex-shrink: 0;

  .selection-count {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--ion-color-secondary);
    margin-right: 4px;
  }

  .mini-action-btn {
    --padding-start: 4px;
    --padding-end: 4px;
    margin: 0;
    height: 28px;
    min-width: 32px;
    
    ion-icon {
      font-size: 1.2rem;
    }
  }
}

.small-action-btn {
  --padding-start: 4px;
  --padding-end: 4px;
  height: 32px;
  margin: 0;
  
  ion-icon {
    font-size: 1.3rem !important;
  }
}

.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px 0 0;
  cursor: grab;
  color: rgba(255, 255, 255, 0.5);
  
  ion-icon {
    font-size: 1.8rem;
  }

  &:active {
    cursor: grabbing;
  }
}

.action-mode-btn {
  --border-radius: 20px;
  --box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  font-weight: 700;
  letter-spacing: 0.5px;
  height: 44px;
}

@media (max-width: 360px) {
  .header-logo-wrapper {
    margin-bottom: 12px !important;
  }
}
/* GLOBAL PLAYER FOOTER */
.global-player-toolbar {
  --background: transparent;
  --padding-top: 4px;
  --padding-bottom: 4px;
  --padding-start: 12px;
  --padding-end: 12px;
  
  &.glass {
    background: rgba(26, 26, 46, 0.95) !important;
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .player-content {
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .controls-row {
    display: flex;
    align-items: center;
    gap: 4px;

    .play-btn {
      --padding-start: 0;
      --padding-end: 0;
      height: 44px;
      width: 44px;
      
      ion-icon {
        font-size: 2.2rem;
      }
    }

    .skip-btn, .close-btn {
      --padding-start: 0;
      --padding-end: 0;
      height: 36px;
      width: 36px;
      
      ion-icon {
        font-size: 1.4rem;
      }
    }

    .global-range {
      flex: 1;
      --bar-height: 4px;
      --knob-size: 14px;
      padding-top: 0;
      padding-bottom: 0;
    }
  }
}

/* Adjust bottom spacing for list when player is active */
.transparent-list {
  padding-bottom: 100px !important;
}

.suggeriti-header-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 12px;
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;

  &:active {
    background: rgba(255, 255, 255, 0.08);
  }

  .card-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: padding-bottom 0.3s ease, border-bottom-color 0.3s ease;
  }

  &.expanded {
    .card-header-row {
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      padding-bottom: 6px;
    }
  }

  .card-header-left {
    display: flex;
    align-items: center;
  }

  .expand-icon {
    font-size: 1.25rem;
    color: var(--ion-color-secondary);
    transition: transform 0.3s ease;
  }

  .card-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--ion-color-secondary);
  }

  .card-date-compact {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 8px;
  }

  .expandable-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, margin-top 0.35s ease;
    
    &.show {
      max-height: 400px; /* High enough to fit summary */
      opacity: 1;
      margin-top: 10px;
    }
  }

  .card-date-row {
    margin-bottom: 6px;
  }

  .card-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
  }

  .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 4px 0 0 0;
  }

  .card-summary {
    font-size: 0.85rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.75);
    margin: 6px 0 0 0;
    font-weight: 400;
  }
}

:host-context(body.high-contrast) .suggeriti-header-card {
  background: #ffffff !important;
  border-color: #000000 !important;
  box-shadow: none !important;

  .card-date-compact {
    color: black !important;
    background: transparent !important;
  }

  &.expanded {
    .card-header-row {
      border-bottom-color: rgba(0, 0, 0, 0.15);
    }
  }

  .card-label {
    color: black !important;
  }

  .card-date {
    color: black !important;
  }

  .card-title {
    color: black !important;
  }

  .card-summary {
    color: black !important;
  }
}

:host-context(body.high-contrast) {
  .drag-handle {
    color: rgba(0, 0, 0, 0.6) !important;
  }
}

.song-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.song-tag-badge {
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* High Contrast mode overrides */
:host-context(body.high-contrast) .song-tag-badge {
  background: rgba(0, 0, 0, 0.05) !important;
  color: rgba(0, 0, 0, 0.7) !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
}

:host-context(body.high-contrast) .update-date-badge {
  color: rgba(0, 0, 0, 0.5) !important;
  ion-icon {
    color: rgba(0, 0, 0, 0.5) !important;
  }
}

.non-validato-badge {
  font-size: 0.65rem;
  background: rgba(231, 76, 60, 0.15); /* Soft premium red */
  color: #e74c3c;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(231, 76, 60, 0.3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;

  &.mio-badge {
    background: rgba(var(--ion-color-secondary-rgb), 0.15);
    color: var(--ion-color-secondary);
    border-color: rgba(var(--ion-color-secondary-rgb), 0.35);
  }
}

:host-context(body.high-contrast) .non-validato-badge {
  background: rgba(231, 76, 60, 0.1) !important;
  color: #c0392b !important;
  border-color: #c0392b !important;

  &.mio-badge {
    background: rgba(var(--ion-color-secondary-rgb), 0.1) !important;
    color: var(--ion-color-secondary-shade, #007bb6) !important;
    border-color: var(--ion-color-secondary-shade, #007bb6) !important;
  }
}

/* ==========================================================================
   PWA INSTALLATION PROMOTIONS (Android & iOS)
   ========================================================================== */

/* 1. Android Installation Banner */
.pwa-android-banner {
  --background: rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--ion-color-secondary);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideInBanner 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  &:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  }

  .banner-inner {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
  }

  .banner-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--ion-color-secondary-rgb), 0.12);
    border: 1px solid rgba(var(--ion-color-secondary-rgb), 0.2);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex-shrink: 0;

    .banner-icon {
      font-size: 1.5rem;
      color: var(--ion-color-secondary);
    }
  }

  .banner-text-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;

    .banner-title {
      font-size: 0.95rem;
      font-weight: 700;
      color: white;
      margin: 0;
      letter-spacing: 0.2px;
    }

    .banner-subtitle {
      font-size: 0.78rem;
      line-height: 1.35;
      color: rgba(255, 255, 255, 0.65);
      margin: 0;
      font-weight: 400;
    }
  }

  .banner-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;

    .install-action-btn {
      --border-radius: 10px;
      --box-shadow: 0 4px 10px rgba(var(--ion-color-secondary-rgb), 0.2);
      font-weight: 700;
      font-size: 0.8rem;
      height: 32px;
      margin: 0;
      text-transform: none;
      letter-spacing: 0.2px;
      transition: transform 0.2s ease;

      &:active {
        transform: scale(0.95);
      }
    }

    .dismiss-action-btn {
      --color: rgba(255, 255, 255, 0.5);
      --padding-start: 4px;
      --padding-end: 4px;
      margin: 0;
      height: 32px;
      width: 32px;

      ion-icon {
        font-size: 1.3rem;
      }

      &:active {
        opacity: 0.7;
      }
    }
  }
}

/* 2. iOS Safari Contextual Tooltip */
.pwa-ios-tooltip-wrapper {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  width: 90%;
  max-width: 385px;
  pointer-events: none;
  filter: drop-shadow(0 12px 36px rgba(0, 0, 0, 0.45));
  transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  &.has-player {
    bottom: 84px; /* Float above active bottom player footer */
  }

  .pwa-ios-tooltip {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    background: rgba(26, 26, 46, 0.96) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1.5px solid rgba(var(--ion-color-secondary-rgb), 0.25);
    border-radius: 20px;
    padding: 14px 16px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
    animation: floatTooltip 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275), bounceGently 3s ease-in-out infinite;

    .tooltip-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;

      .tooltip-title {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--ion-color-secondary);
        letter-spacing: 0.3px;
      }

      .dismiss-btn {
        --color: rgba(255, 255, 255, 0.45);
        --padding-start: 4px;
        --padding-end: 4px;
        margin: 0;
        height: 24px;
        width: 24px;

        ion-icon {
          font-size: 1.2rem;
        }

        &:active {
          opacity: 0.7;
        }
      }
    }

    .tooltip-body {
      .tooltip-text {
        font-size: 0.82rem;
        line-height: 1.45;
        color: rgba(255, 255, 255, 0.85);
        margin: 0;
        font-weight: 400;

        strong {
          color: white;
          font-weight: 600;
        }

        .safari-icon-inline {
          display: inline-flex;
          align-items: center;
          justify-content: center;
          background: rgba(255, 255, 255, 0.08);
          border: 1px solid rgba(255, 255, 255, 0.12);
          padding: 3px;
          border-radius: 6px;
          vertical-align: middle;
          margin: 0 3px;
          width: 20px;
          height: 20px;

          ion-icon {
            font-size: 0.95rem;
            color: #007aff; /* Apple System Blue */
          }
        }
      }
    }

    .tooltip-arrow {
      width: 0;
      height: 0;
      border-left: 12px solid transparent;
      border-right: 12px solid transparent;
      border-top: 12px solid rgba(26, 26, 46, 0.96);
      position: absolute;
      bottom: -11px;
      left: 50%;
      transform: translateX(-50%);
      
      &::after {
        content: '';
        width: 0;
        height: 0;
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-top: 12px solid rgba(var(--ion-color-secondary-rgb), 0.25);
        position: absolute;
        bottom: -1px;
        left: -12px;
        z-index: -1;
      }
    }
  }
}

/* Animations */
@keyframes slideInBanner {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatTooltip {
  from {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

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

/* High Contrast mode adaptations */
:host-context(body.high-contrast) {
  .pwa-android-banner {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-left-width: 6px !important;
    
    .banner-title, .banner-subtitle {
      color: #000000 !important;
    }
    .banner-icon {
      color: #000000 !important;
    }
    .banner-icon-wrapper {
      background: rgba(0, 0, 0, 0.05) !important;
      border-color: #000000 !important;
    }
    .install-action-btn {
      --background: #000000 !important;
      --color: #ffffff !important;
    }
    .dismiss-action-btn {
      --color: #000000 !important;
    }
  }

  .pwa-ios-tooltip {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    
    .tooltip-title, .tooltip-text, .tooltip-text strong {
      color: #000000 !important;
    }
    .dismiss-btn {
      --color: #000000 !important;
    }
    .tooltip-arrow {
      border-top-color: #ffffff !important;
      &::after {
        border-top-color: #000000 !important;
      }
    }
    .safari-icon-inline {
      background: rgba(0, 0, 0, 0.05) !important;
      border-color: #000000 !important;
      ion-icon {
        color: #000000 !important;
      }
    }
  }
}

.empty-playlist-container {
  padding: 12px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.empty-playlist-instruction {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
  text-align: left;
  background: rgba(var(--ion-color-secondary-rgb), 0.08);
  border: 1px dashed rgba(var(--ion-color-secondary-rgb), 0.35);
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

:host-context(body.high-contrast) {
  .empty-playlist-instruction {
    color: #000000 !important;
    background: rgba(var(--ion-color-secondary-rgb), 0.12) !important;
    border-color: var(--ion-color-secondary) !important;
    box-shadow: none !important;
  }
}


