/* 
Bunny Player 2 - Frontend Styles (Mobile-First & Hybrid Theme)
*/

/* --- Base & Mobile Styles --- */
.bp2-wrap {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;

  /* Color Palette from Accordion Menu */
  --bg: #0f1115;
  --card: #171a21;
  --fg: #e9eef5;
  --muted: #9aa4b2;
  --accent: #0b57d0;
  --border-color: rgba(255, 255, 255, 0.1);
}

/* LAYOUT: White background as requested */
.bp2-layout {
  display: flex;
  flex-direction: column; /* Mobile: player on top */
  gap: 20px;
  padding: 0;
  background-color: #ffffff;
  color: #111111;
}

/* HEADER: Dark theme */
.bp2-header {
  background-color: var(--card);
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}

.bp2-search-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  max-width: 800px;
  margin: 0 auto 15px auto;
}

.bp2-search-container .search-logo {
  height: 32px;
  flex-shrink: 0;
  display: block;
  margin: 0 auto;
}

.bp2-search-container .search-wrapper {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
  background-color: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 0 15px;
}

.bp2-search-input {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  padding: 5px 5px;
  padding-right: 70px;
  font-size: 16px;
  background: transparent;
  color: var(--fg);
}

.bp2-clear-search-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: none;
  background: none;
  font-size: 15px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  padding: 0 10px;
  text-align: center;
  border-radius: 9999px;
  opacity: 0.45;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.bp2-clear-search-btn:hover,
.bp2-clear-search-btn.is-active:hover {
  background: rgba(0,0,0,0.05);
}

.bp2-clear-search-btn.is-active {
  opacity: 1;
}

.bp2-clear-search-btn:disabled {
  pointer-events: none;
}

.bp2-search-input::-webkit-search-cancel-button,
.bp2-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
}

.bp2-search-input::-ms-clear,
.bp2-search-input::-ms-reveal {
  display: none;
}
}

.bp2-count {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  width: 100%;
}

.bp2-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  margin-bottom: 15px;
}

.bp2-tab {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  background-color: var(--card);
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.2s ease;
  color: var(--fg);
}

.bp2-tab:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.bp2-tab.active {
  color: #fff;
  background-color: var(--accent);
  border-color: var(--accent);
}

.bp2-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-style: normal;
  color: #ffd400;
}

.bp2-ic,
.bp2-ic:before {
    color: #ffd400 !important;
}

.bp2-ic i {
  color: inherit;
  font-size: 16px;
  line-height: 1;
}


.bp2-tab-label {
  font-weight: 700;
}

.bp2-player-col {
  flex: 1;
  min-width: 0;
  display: none;
}
.bp2-player-col.is-active-player {
  display: flex;
}

@media (max-width: 991px) {
  .bp2-player-col.is-active-player {
    display: flex;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 999;
    border: 1px solid #e0e0e0;
  }
}

.bp2-player {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.bp2-player-inner, .bp2-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.bp2-player-thumb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 2;
}

.bp2-player-thumb-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.bp2-iframe { z-index: 1; }

.bp2-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #666;
  font-size: 18px;
  background-color: #f0f0f0;
}

.bp2-meta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  padding: 15px 5px;
  background: #fff;
}

.bp2-title {
  font-size: 20px;
  font-weight: 600;
  color: #111;
  flex-grow: 1;
  margin: 0;
  display: block;
  align-self: stretch;
  min-width: 0;
  overflow: hidden;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.bp2-title.is-expanded {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

/* --- Meta Buttons & Panels --- */
.bp2-actions {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-shrink: 0;
}

.bp2-actions button {
  padding: 4px 14px;
  border-radius: 10px;
  border: 1px solid #d0d0d0;
  background: #f0f0f0;
  color: #333;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bp2-actions button:hover {
  background: #e0e0e0;
  border-color: #c0c0c0;
}

.bp2-top-menu {
  background: #0b57d0 !important;
  border-color: #0b57d0 !important;
  color: #fff !important;
}

.bp2-top-menu:hover {
  background: #0a4cc0 !important;
  border-color: #0a4cc0 !important;
}

/* Info button as a text link */
#bp2-info {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  font-weight: 500;
  text-decoration: underline;
}
#bp2-info:hover {
  color: #333;
}

.bp2-desc {
  font-size: 15px;
  color: #000000;
  line-height: 1.6;
  white-space: pre-line;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  margin-top: 0;
}

@media (max-width: 767px) {
  .bp2-desc {
    max-height: 250px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.bp2-share-panel {
  display: none !important; /* Obsolete, hide permanently */
}

.bp2-list-col { width: 100%; }
.bp2-list {
  overflow-y: auto;
  padding-right: 5px;
}

.bp2-empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.bp2-item {
  display: flex;
  gap: 12px;
  align-items: center; /* Mobile: center align */
  width: 100%;
  padding: 4px;
  margin-bottom: 0;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.2s ease;
}

.bp2-item:hover { background-color: #f5f5f5; }
.bp2-item.is-active { 
  background-color: #e9f5ff;
  border-color: #0b57d0;
}

.bp2-thumb {
  width: 40%; /* Mobile: larger thumb */
  height: 94px;
  --bp2-vertical-scale: 1.6;
  flex-shrink: 0;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background-color: #000;
}

.bp2-thumb img {
  width: 100%;
  height: 94px;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}

.bp2-thumb.is-vertical-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp2-thumb.is-vertical-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(var(--bp2-vertical-scale));
  transform-origin: center;
}

.bp2-item:hover .bp2-thumb img { opacity: 0.8; }

.bp2-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.bp2-info { flex: 1; min-width: 0; }

.bp2-ttl {
  font-size: 14px; /* Mobile: smaller font */
  font-weight: 500;
  line-height: 1.4;
  color: #000000; /* Black color for titles */
  display: -webkit-box;
  -webkit-line-clamp: 3; /* 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 4.2em; /* 1.4 * 3 */
}

/* --- Sticky Player Styles (Mobile) --- */
.bp2-player-placeholder {
  display: none;
}
    .bp2-wrap.has-played .bp2-player.is-sticky {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      width: 100%;
      z-index: 1000;
      border-radius: 0;
      box-shadow: 0 2px 10px rgba(0,0,0,0.5);
      padding-bottom: 56.25%;
      margin-left: 0;
      margin-right: 0;
    }
.bp2-wrap.has-played .bp2-player-placeholder.is-active {
  display: block;
  height: var(--sticky-height, 200px);
}


/* --- Desktop Overrides --- */
@media (min-width: 992px) {
  .bp2-layout {
    flex-direction: row; /* Desktop: player on left */
    padding: 15px;
  }

  .bp2-meta {
    flex-direction: column; /* Desktop: horizontal */
  }

  .bp2-player-col {
    display: flex;
  }

  .bp2-player-sticky {
    position: sticky;
    top: 20px;
    width: 100%; /* Added */
  }

  .bp2-list-col {
    width: 400px;
    flex-shrink: 0;
  }

  .bp2-list { /* No max-height for desktop */ }

  .bp2-item { align-items: flex-start; }

  .bp2-thumb { width: 168px; }

  .bp2-ttl { font-size: 15px; }
}
