/* Alpine.js x-cloak - hide until Alpine initializes */
[x-cloak] {
  display: none !important;
}

/* Enforce fixed dimensions and prevent shifting */
.player-card {
  background: var(--bs-card-bg, var(--bs-body-bg));
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    padding: 20px;
    box-sizing: border-box;
    width: 500px;
    /* fixed width */
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    /* clip overflowing content */
    transition: none;
    /* remove transition effects that may shift layout */
}

.player-card:hover {
    transform: translateY(-3px);
}

.player-header {
    text-align: left;
    line-height: 1.2;
    padding-bottom: 8px;
  border-bottom: 1px solid var(--bs-border-color);
    min-height: 50px;
    overflow: hidden;
}

.player-title,
.player-truncate {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-wrapper {
    margin-top: 15px;
}

.nav-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Navbar styling */
    .navbar.navbar-compact {
      --ubase-nav-link-y: 0.4rem;
      --ubase-nav-link-x: 0.55rem;
      --ubase-nav-touch-size: 2.45rem;
      --ubase-nav-meta-size: 0.84rem;
      padding-top: 0.35rem;
      padding-bottom: 0.35rem;
    }

    .navbar.navbar-compact .navbar-brand {
      margin-right: 0.75rem;
      font-size: 1rem;
    }

    .navbar-nav .nav-item {
      margin-right: 0.35rem;
    }
    .navbar-nav .dropdown-menu {
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    .navbar-nav .user-menu-dropdown {
      left: auto;
      right: 0;
    }
    .navbar-brand {
      font-weight: 600;
      color: #0d6efd !important;
    }
    .navbar-nav .nav-link {
      transition: all 0.2s ease;
      border-radius: 0.375rem;
      margin: 0 0.1rem;
      padding: var(--ubase-nav-link-y, 0.5rem) var(--ubase-nav-link-x, 0.75rem);
      font-size: 0.93rem;
    }

    .navbar.navbar-compact .nav-profile-trigger {
      display: inline-flex;
      align-items: center;
      gap: 0.38rem;
      line-height: 1.1;
      min-height: var(--ubase-nav-touch-size);
      min-width: var(--ubase-nav-touch-size);
    }

    .navbar.navbar-compact .nav-profile-label {
      font-size: var(--ubase-nav-meta-size);
      font-weight: 600;
      max-width: 9.5rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .navbar.navbar-compact .btn.btn-sm {
      min-height: var(--ubase-nav-touch-size);
      min-width: var(--ubase-nav-touch-size);
      padding: 0.25rem 0.55rem;
      line-height: 1;
    }

    .navbar.navbar-compact .dropdown-menu .dropdown-item {
      padding-top: 0.38rem;
      padding-bottom: 0.38rem;
      font-size: 0.9rem;
    }
    .navbar-nav .nav-link:hover {
      background-color: rgba(13, 110, 253, 0.1);
    }
    .navbar-nav .nav-link.active {
      background-color: rgba(13, 110, 253, 0.15);
      font-weight: 500;
    }
    
    /* Role indicator badge styling */
    .role-indicator-badge {
      position: relative;
      top: -2px;
      font-size: 0.6rem;
      padding: 0.15rem 0.3rem;
    }
    
    /* Role switching form styling */
    .dropdown-item-form {
      margin: 0;
      padding: 0;
    }
    
    .dropdown-item-form button {
      width: 100%;
      text-align: left;
      border: none;
      background: none;
      padding: 0.5rem 1rem;
      transition: background-color 0.15s ease-in-out;
    }
    
    .dropdown-item-form button:hover {
      background-color: var(--bs-dropdown-link-hover-bg);
      color: var(--bs-dropdown-link-hover-color);
    }
    
    .dropdown-item-form button.active {
      background-color: var(--bs-primary);
      color: var(--bs-white);
    }
    
    .dropdown-item-form button.active:hover {
      background-color: var(--bs-primary);
      color: var(--bs-white);
    }
    
    /* Role switching section styling */
    .dropdown-header {
      padding: 0.5rem 1rem 0.25rem;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    @media (max-width: 991.98px) {
      .navbar.navbar-compact {
        --ubase-nav-link-y: 0.46rem;
        --ubase-nav-touch-size: 2.65rem;
      }

      .navbar.navbar-compact .navbar-nav .nav-item {
        margin-right: 0;
      }

      .navbar.navbar-compact .nav-profile-label {
        max-width: none;
      }
    }

    /* Dashboard specific styling */
    .hero-section {
      background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(108, 117, 125, 0.05) 100%);
      border-radius: 1rem;
      margin-bottom: 2rem;
    }

    /* Enhanced home page styling */
    .player-card .card {
      border-radius: 1rem;
      overflow: hidden;
    }

    .player-card .card-header {
      background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%) !important;
      border: none;
    }

    .player-card audio {
      border-radius: 0.5rem;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .btn-lg {
      border-radius: 0.75rem;
      font-weight: 500;
      transition: all 0.2s ease;
    }

    .btn-lg:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .display-4 .bi-soundwave {
      animation: pulse 2s infinite;
    }

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

    /* Article card enhancements for discover page */
    .article-card {
      border-radius: 1rem !important;
      transition: all 0.3s ease;
      overflow: hidden;
    }

    .article-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15) !important;
    }

    .article-card .card-header {
      border-radius: 1rem 1rem 0 0 !important;
      background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%) !important;
    }

    .article-card audio {
      border-radius: 0.5rem;
      background: var(--bs-tertiary-bg);
    }

    /* Compact article cards for discover page */
    .article-card-compact {
      border-radius: 0.75rem !important;
      transition: all 0.2s ease;
      border: 1px solid var(--bs-border-color) !important;
      height: auto;
    }

    .article-card-compact:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
      border-color: var(--bs-secondary-color) !important;
    }

    .article-card-compact .card-body {
      padding: 1rem !important;
    }

    .article-card-compact .card-title {
      font-size: 0.95rem;
      line-height: 1.3;
      margin-bottom: 0.75rem !important;
    }

    .audio-compact audio {
      height: 32px !important;
      border-radius: 0.375rem;
      background: var(--bs-tertiary-bg);
    }

    .text-truncate-3 {
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
      line-height: 1.4;
      max-height: 4.2em;
    }

    .stats-container {
      background: rgba(var(--bs-secondary-bg-rgb), 0.8);
      border-radius: 1rem;
      padding: 2rem;
    }

    .stat-card {
      background: var(--bs-card-bg, var(--bs-body-bg));
      padding: 1.5rem;
      border-radius: 0.75rem;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .stat-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .engine-card {
      background: var(--bs-card-bg, var(--bs-body-bg));
      border: 1px solid var(--bs-border-color);
      border-radius: 1rem;
      transition: all 0.2s ease;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .wallpaper-switch-row {
      padding-left: 2.5rem;
      min-height: 2.75rem;
      display: flex;
      align-items: center;
    }

    .wallpaper-preview-strip {
      display: flex;
      gap: 0.75rem;
      overflow-x: auto;
      padding-bottom: 0.25rem;
    }

    .wallpaper-preview-thumb {
      width: 84px;
      height: 84px;
      object-fit: cover;
      border: 1px solid var(--bs-border-color);
      flex: 0 0 auto;
    }

    .wallpaper-asset-image {
      aspect-ratio: 4 / 3;
      object-fit: cover;
    }

    .wallpaper-collection-card,
    .wallpaper-asset-card {
      border-radius: 1rem;
    }

    .engine-card:hover {
      transform: translateY(-3px);
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
      border-color: rgba(13, 110, 253, 0.2);
    }

    .engine-icon {
      background: rgba(13, 110, 253, 0.08);
      width: 80px;
      height: 80px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto;
    }

    .stat-mini {
      padding: 0.5rem;
      background: rgba(var(--bs-secondary-bg-rgb), 0.8);
      border-radius: 0.5rem;
    }

    .stat-mini-value {
      font-size: 1.25rem;
      line-height: 1;
    }

    .stat-mini-label {
      font-size: 0.75rem;
      opacity: 0.7;
    }

    .activity-card {
      border: none;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
      border-radius: 1rem;
    }

    .activity-item {
      padding: 1rem 0;
      transition: background-color 0.2s ease;
    }

    .activity-item:hover {
      background-color: rgba(248, 249, 250, 0.5);
      border-radius: 0.5rem;
      margin: 0 -1rem;
      padding: 1rem;
    }

    .activity-icon {
      width: 40px;
      height: 40px;
      background: rgba(13, 110, 253, 0.1);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
    }

    .activity-content {
      min-height: 40px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .activity-message {
      font-weight: 500;
      color: var(--bs-body-color);
      margin-bottom: 0.25rem;
    }

    /* Audio dashboard specific styles */
    .action-section {
      background: rgba(var(--bs-secondary-bg-rgb), 0.5);
      border-radius: 1rem;
      padding: 2rem;
    }

    .content-card {
      background: var(--bs-card-bg, var(--bs-body-bg));
      border: 1px solid var(--bs-border-color);
      border-radius: 1rem;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .content-card .card-header {
      background: rgba(var(--bs-primary-rgb), 0.08);
      border-bottom: 1px solid var(--bs-border-color);
      border-radius: 1rem 1rem 0 0 !important;
      padding: 1.25rem 1.5rem;
    }

    .audio-list {
      max-height: 400px;
      overflow-y: auto;
    }

    .audio-item {
      padding: 1rem 0;
      border-bottom: 1px solid rgba(0, 0, 0, 0.08);
      transition: background-color 0.2s ease;
    }

    .audio-item:last-child {
      border-bottom: none;
    }

    .audio-item:hover {
      background-color: rgba(248, 249, 250, 0.5);
      border-radius: 0.5rem;
      margin: 0 -1rem;
      padding: 1rem;
    }

    .audio-icon {
      width: 40px;
      height: 40px;
      background: rgba(13, 110, 253, 0.1);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
    }

    .audio-content h6 a {
      color: var(--bs-body-color);
      transition: color 0.2s ease;
    }

    .audio-content h6 a:hover {
      color: var(--bs-link-hover-color);
    }

    .empty-state {
      padding: 3rem 1rem;
    }

    /* Badge styling improvements */
    .badge.bg-completed { background-color: #198754 !important; }
    .badge.bg-processing { background-color: #0dcaf0 !important; }
    .badge.bg-failed { background-color: #dc3545 !important; }
    .badge.bg-pending { background-color: var(--bs-warning) !important; color: var(--bs-black) !important; }

    /* Responsive adjustments */
    @media (max-width: 768px) {
      .stats-container {
        padding: 1rem;
      }
      
      .hero-section {
        padding: 2rem 1rem !important;
      }
      
      .engine-icon {
        width: 60px;
        height: 60px;
      }
      
      .display-4 {
        font-size: 1.5rem !important;
      }

      .action-section {
        padding: 1.5rem;
      }
      
      .audio-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
      }
    }

    /* Homepage Playlist Styling */
    #playlist-container .card {
      transition: transform 0.2s ease, box-shadow 0.3s ease;
    }
    
    #playlist-container .card:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    }
    
    .list-group-item {
      transition: background-color 0.2s ease;
    }
    
    .list-group-item:hover {
      background-color: rgba(var(--bs-primary-rgb), 0.05);
    }
    
    /* Enhanced play button styling */
    .btn.rounded-circle {
      transition: all 0.2s ease;
    }
    
    .btn.rounded-circle:hover {
      transform: scale(1.05);
    }
    
    /* Track number badge styling */
    .track-number-badge {
      font-size: 0.7rem;
      font-weight: 600;
      opacity: 0.7;
    }

/* ====== KIOSK MODE STYLING ====== */
.kiosk-body {
  /* Full-screen layout with no spacing */
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.kiosk-body main,
.kiosk-body section {
  /* Expand to fill viewport */
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: auto;
}

.kiosk-body .content {
  /* Full viewport for content */
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Overlay action buttons fade in/out on touch */
.kiosk-action-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1030;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kiosk-action-buttons.visible {
  opacity: 1;
}

.kiosk-action-buttons button {
  display: block;
  width: 60px;
  height: 60px;
  margin: 10px 0;
  font-size: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(var(--bs-primary-rgb), 0.9);
  color: var(--bs-white);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.kiosk-action-buttons button:hover {
  transform: scale(1.1);
  background: rgba(var(--bs-primary-rgb), 1);
}

/* Kiosk calendar view - full screen */
.kiosk-calendar {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  width: 100%;
  height: 100%;
}

.kiosk-calendar .calendar-month,
.kiosk-calendar .calendar-week,
.kiosk-calendar .calendar-day {
  width: 100%;
  height: 100%;
  font-size: 1.2rem;
  padding: 20px;
  box-sizing: border-box;
}

/* Kiosk dashboard - full screen widgets */
.kiosk-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  height: 100%;
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.kiosk-dashboard .widget {
  min-height: 200px;
  padding: 20px;
  border-radius: 12px;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
}

/* Hide elements in kiosk mode */
.kiosk-body header,
.kiosk-body nav,
.kiosk-body .sidebar {
  display: none !important;
}

/* Kiosk exit button - floating in bottom-right corner */
.kiosk-exit-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), 0.9);
  color: var(--bs-white);
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.kiosk-exit-btn:not([style*="display:none"]) {
  opacity: 1;
  pointer-events: all;
}

.kiosk-exit-btn:hover {
  transform: scale(1.1);
  background: rgba(13, 110, 253, 1);
}
