/* Overrides for Skeleton CSS */

button, input {
  margin-bottom: 0;
}
.container {
  width: 100%;
  padding: 0;
}

/* Colors */

nav a, nav a:link, nav a:hover, nav a:active, nav a:visited {
  color: #000000;
  text-decoration: none;
}

/* Navbar */

.navbar {
  display: block;
  margin: 0 auto;
  height: auto;
  min-height: 5rem;
  background: #fff;
  z-index: 99;
  position: fixed;
  top: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;
  left: 50%;
  transform: translate(-50%, 0);
  width: 100%;
}

.navbar-top {
  display: flex;
  width: 100%;
}

.navbar-menu, .navbar-random {
  width: 40px;
  color: white;
}

.navbar-search {
  flex: 1;  /* This makes the middle div expand */
}

.navbar-bottom {
  width: 100%;
}

.decade-filter {
  width: 100%;
  color: white;
  background: #fff;
  text-align: center;
  padding: 5px 0;
}

.decade-filter button {
  padding: 0;
  text-transform: lowercase;
  height: 30px;
  line-height: 30px;
  margin: 0px;
}

.decade-filter button:disabled {
  opacity: 0.35;
  cursor: default;
}

#random:disabled {
  opacity: 0.35;
  cursor: default;
}

.navbar-content {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.5rem;
}

#search {
  width: 100%;
}

#search.playlist-active {
  background-color: #e8f4fb;
  color: #1a7fad;
  font-style: italic;
  padding-right: 2rem;
}

.navbar-search {
  position: relative;
}

.playlist-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #777;
  padding: 4px;
  line-height: 1;
}

.playlist-clear-btn:hover {
  color: #333;
}

#songs {
  width: 100%;
  margin-top: 10rem;
}

#songs table a, table a:link, table a:hover, table a:active, table a:visited {
  color: #000000;
  text-decoration: none;
}

#songs tbody tr.row-odd {
  background-color: #eee;
}

#songs tbody tr {
  cursor: pointer;
}

#songs tbody tr * {
  cursor: pointer;
}

#songs tr td:first-child {
  padding-left: 4px;
}
#songs tr td:last-child {
  padding-right: 4px;
}

#songs tr.selected {
  background-color: #ff5a5f !important;
}

.song-artist-sub-text {
  display: none;
}

#random { padding: 0 10px;}

.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 2rem;
  padding: 0.5rem;
}

.icon-button:hover {
  opacity: 0.8;
}

#sort-popover-toggle {
  text-transform: uppercase;
  color: #222;
  font-weight: 600;
  float: left;
  margin-top: .5rem;
  font-size: 1.5rem;
}

.navbar-link.selected {
  border-bottom: 2px solid currentColor;
}

/* Popover */
.popover.open {
  display: block;
}
.popover {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  top: 92%;
/*  left: -50%; */
  -webkit-filter: drop-shadow(0 0 6px rgba(0,0,0,.1));
     -moz-filter: drop-shadow(0 0 6px rgba(0,0,0,.1));
          filter: drop-shadow(0 0 6px rgba(0,0,0,.1)); }
.popover-item:first-child .popover-link:after,
.popover-item:first-child .popover-link:before {
  bottom: 100%;
  left: 50%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none; }
.popover-item:first-child .popover-link:after {
  border-color: rgba(255, 255, 255, 0);
  border-bottom-color: #fff;
  border-width: 10px;
  margin-left: -10px; }
.popover-item:first-child .popover-link:before {
  border-color: rgba(238, 238, 238, 0);
  border-bottom-color: #eee;
  border-width: 11px;
  margin-left: -11px; }
.popover-list {
  padding: 0;
  margin: 0;
  list-style: none; }
.popover-item {
  padding: 0;
  margin: 0; }
.popover-link {
  position: relative;
  color: #222;
  display: block;
  padding: 8px 20px;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 1.0rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: .1rem; }
.popover-item:first-child .popover-link {
  border-radius: 4px 4px 0 0; }
.popover-item:last-child .popover-link {
  border-radius: 0 0 4px 4px;
  border-bottom-width: 0; }
.popover-link:hover {
  color: #fff;
  background: #33C3F0; }
.popover-link:hover,
.popover-item:first-child .popover-link:hover:after {
    border-bottom-color: #33C3F0; }


input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  margin-left: .4em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>");
  cursor: pointer;
}

#search.playlist-active::-webkit-search-cancel-button {
  display: none;
}

/* Song Action Popover */
.song-actions {
  position: relative;
  display: inline-block;
}

.song-actions-toggle {
  cursor: pointer;
  padding: 4px 8px;
  color: #666;
  font-size: 18px;
  line-height: 1;
}

.song-actions-toggle:hover {
  color: #000;
}

.song-actions-popover {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
  min-width: 150px;
}

.song-actions-popover.open {
  display: block;
}

.song-actions-item {
  display: block;
  padding: 8px 12px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

.song-actions-item:hover {
  background: #f5f5f5;
}

/* Song actions cell styling */
.song-actions-cell {
  width: 40px;
  text-align: center;
  padding: 0 4px;
}

/* Remove the padding-right from song-title since we no longer need it */
.song-title {
  padding-right: 0;
}

/* QR Code Modal */
.qr-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow: auto;
}

.qr-modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 20px;
  border-radius: 5px;
  width: 80%;
  max-width: 400px;
  position: relative;
  text-align: center;
}

.qr-modal-close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 5px;
}

.qr-modal-close:hover,
.qr-modal-close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

#qr-song-info {
  margin-bottom: 20px;
}

#qr-song-info h3 {
  margin-bottom: 5px;
}

#qr-song-info p {
  color: #666;
  margin-top: 0;
}

#qr-code-container {
  margin: 0 auto;
  display: inline-block;
}

@media (max-width: 550px) {
  .qr-modal-content {
    width: 90%;
    margin: 20% auto;
  }
}

/* Wide Devices */

@media (min-width: 550px) {
  .container {
    width: 80%;
  }

  .navbar {
    width: 80%;
  }

  .navbar-top {
    width: 100%;
  }
}

@media (min-width: 1200px) {
  .container {
    width: 960px;
  }

  .navbar {
    width: 960px;
  }
}

/* Broadcast Toast */
.broadcast-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 300px;
  max-width: calc(100% - 2rem);
}

.broadcast-toast {
  background: #1a1a2e;
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.broadcast-toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.broadcast-toast-hiding {
  opacity: 0;
  transform: translateY(-20px);
}

.broadcast-toast-content {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.broadcast-toast-text {
  min-width: 0;
}

.broadcast-toast-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.broadcast-toast-artist {
  font-size: 12px;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.broadcast-toast-dismiss {
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 8px;
  flex-shrink: 0;
  line-height: 1;
}

.broadcast-toast-dismiss:hover {
  color: #fff;
}

.broadcast-sent {
  background-color: #d4edda !important;
  transition: background-color 0.3s ease;
}

/* Share confirmation toast */
.share-confirmation {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #2e7d32;
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 2500;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.share-confirmation-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Hide artist column on narrow screens */
@media (max-width: 550px) {
  #songs tr td:nth-child(2) {
    display: none;
  }
  .song-title-text {
    font-size: 1.5em;
  }

  .song-artist-sub-text {
    display: block;
    font-size: 0.9em;
    color: #666;
    padding-left: 0;
    padding-top: 0;
    margin-top: -5px;
  }

  .broadcast-toast-container {
    top: 1rem;
    right: 0.5rem;
    width: calc(100% - 1rem);
  }
}
