/**
 * Oz Single Beat Shortcode Styles
 * Pixel-perfect styling for single beat layout
 */

.single-beat-container {
    display: flex;
    flex-wrap: wrap;
    background-color: #121212;
    color: #fff;
    padding: 20px;
    border-radius: 4px;
    gap: 20px;
    margin: 20px 0;
    max-width: 100%;
    box-sizing: border-box;
}

.single-beat-cover {
    flex: 0 0 200px;
    width: 200px;
    height: 200px;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    background-color: #1a1a1a;
}

.single-beat-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.single-beat-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
    color: #666;
}

.single-beat-cover-placeholder i {
    font-size: 48px;
}

/* Play/Pause Button */
.single-beat-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #3176CE;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 10;
    border: none;
    padding: 0;
}

.single-beat-play:hover {
    background-color: #2A63AE;
}

.single-beat-play i {
    font-size: 23px;
    color: #fff;
    margin-left: 4px; /* Slight offset for play icon centering */
}

.single-beat-play.playing i.fa-play::before {
    content: "\f04c"; /* Pause icon */
}

.single-beat-info {
    flex: 1 1 auto;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.single-beat-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.2;
    color: #D8D8D8;
    text-transform: uppercase;
}

.single-beat-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #aaa;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.single-beat-meta span {
    display: inline-block;
}

.beat-genre,
.beat-bpm,
.beat-key {
    color: #aaa;
}

.beat-genre-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-bottom: -1px;
    margin-right: 0px;
}

.beat-bpm-icon {
    width: 16px;
    height: 16px;
    margin-right: -3px;
    vertical-align: middle;
    margin-bottom: -1px;
}
.beat-key-icon {
    font-size: 17px;
    margin-bottom: 10px;
    margin-right: -7px;
}
@media (max-width: 768px) {
    .beat-key-icon {
        margin-left: 3px;
    }
}
.beat-age {
    font-size: 14px;
    color: #aaa;
    display: inline-flex;
    align-items: center;
}
.beat-age-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-left: 6px;
    margin-bottom: -2px;
}

/* Meta row flex (genre, bpm, key) */
.single-beat-container .single-beat-meta {
    display: inline-flex;
    flex-wrap: wrap;       /* wrap on smaller screens */
    align-items: center;   /* vertical center icons and text */
    gap: 12px;             /* space between items */
}

/* Description + Toggle */
.single-beat-description {
    margin-top: 25px;
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.7;
    position: relative;
    padding-left: 30px;
    padding-right: 30px;
  }
  

  .single-beat-description .description-heading {
    font-size: 1.2rem;
    color: #D8D8D8;
    margin-bottom: 10px;
    font-weight: 625;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .description-text {
    max-height: 50px; /* only show part of it initially */
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

.description-text {
    padding-right: 0;
}

@media (min-width: 1025px) {
    .description-text {
        padding-right: 200px;
    }
}

  .description-text.collapsed {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;    /* number of visible lines */
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* expanded state shows full text */
.description-text.expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    max-height: 1000px;
}
  
  
  .toggle-description {
    display: inline-flex;
    background: none;
    border: none;
    color: #9e9e9e;
    cursor: pointer;
    margin-top: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    padding: 0;
    outline: none;
    transition: color 0.3s ease;
  }

.toggle-description:hover,
.toggle-description:focus,
.toggle-description:active {
    color: #9e9e9e;       /* keep same color */
    background: none;     
    outline: none;
    box-shadow: none;
}
  
  .toggle-description i {
    transition: transform 0.3s ease;
  }
  
  .toggle-description.active i {
    transform: rotate(180deg);
  }  

/* Each span item */
.single-beat-container .single-beat-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;  /* space between icon and text */
}

/* Icon sizing */
.single-beat-container .single-beat-meta svg,
.single-beat-container .single-beat-meta .beat-key-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
}


/* Wavesurfer Waveform Container */
.single-beat-waveform-container {
    margin: 15px 0;
    position: relative;
}

.single-beat-waveform {
    width: 100%;
    height: 80px;
    cursor: pointer;
    margin-bottom: 8px;
    /* PERFORMANCE FIX: Hardware acceleration for smooth mobile scrolling */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Prevent touch delay on mobile */
    touch-action: pan-x;
    -webkit-tap-highlight-color: transparent;
}

.single-beat-waveform wave {
    display: block;
    width: 100%;
}

.single-beat-time {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #aaa;
    margin-top: 5px;
}

.single-beat-time-current,
.single-beat-time-total {
    font-family: 'Roboto', sans-serif;
}

/* Visual Progress Bar (fallback/backup) */
.single-beat-progress-container {
    position: relative;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 15px 0;
    display: none; /* Hidden by default, shown if wavesurfer fails */
}

.single-beat-progress-container.show {
    display: block;
}

.single-beat-progress {
    width: 0%;
    height: 100%;
    background-color: #D8D8D8;
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* Action Buttons */
.single-beat-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.oz-cart-trigger-shortcode,
.oz-download-btn-shortcode,
.oz-share-btn {
    padding: 8px 16px;
    border-radius: 2px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1.5;
}

.oz-cart-trigger-shortcode {
    background-color: #3176CE;
    color: #fff;
    min-width: 100px;
}

.oz-cart-trigger-shortcode:hover {
    background-color: #2A63AE;
}

.oz-cart-trigger-shortcode:active,
.oz-cart-trigger-shortcode:focus {
    transform: translateY(0);
    background-color: #3176CE;
    outline: none;
    box-shadow: none;
}

.oz-cart-trigger-shortcode:active:hover {
    background-color: #2A63AE;
}

/* Prevent pink/highlight overlay on click and drag */
.oz-cart-trigger-shortcode {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.oz-download-btn-shortcode {
    background: none;
    color: #D8D8D8;
    min-width: 44px;
    padding: 8px 10px;
}

.oz-download-btn-shortcode:hover {
    color: #5C9EFF;
    background: none;
    transform: none;
}

.oz-download-btn-shortcode:active,
.oz-download-btn-shortcode:focus {
    transform: translateY(0);
    background: none;
    outline: none;
    box-shadow: none;
}

/* Prevent pink/highlight overlay on click and drag */
.oz-download-btn-shortcode {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.oz-download-btn-shortcode i {
    font-size: 16px;
}

.oz-share-btn {
    background: none;
    color: #D8D8D8;
    min-width: 44px;
    padding: 8px 10px;
}

.oz-share-btn:hover {
    background: none;
    color: #5C9EFF;
}

.oz-share-btn:active {
    transform: translateY(0);
}

.oz-share-btn svg {
    width: 18px;
    height: 18px;
    transition: stroke 0.3s ease;
}

.oz-share-btn:hover svg {
    stroke: #5C9EFF;
}

/* Share Toast Notification */
.oz-share-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #3176CE;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.oz-share-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Loading State */
.single-beat-container.loading .single-beat-waveform {
    opacity: 0.5;
    pointer-events: none;
}

.single-beat-container.loading .single-beat-play {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .single-beat-container {
        flex-direction: column;
        align-items: center;
        padding: 15px;
        gap: 15px;
    }
    
    .single-beat-cover {
        width: 100%;
        max-width: 300px;
        height: 300px;
    }
    
    
/* Responsive Cover Art On Mobile */
@media (max-width: 767px) {
    .single-beat-cover {
        flex: 0 0 40vw;      /* width = 40% of viewport width */
        width: 40vw;         /* ensures it scales on small screens */
        height: auto;        /* let aspect-ratio handle height */
        aspect-ratio: 1 / 1; /* forces a perfect square */
    }

    .single-beat-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}
    
    .single-beat-title {
        font-size: 24px;
        text-align: center;
    }
    
    .single-beat-meta {
        justify-content: center;
        font-size: 13px;
    }
    
    .single-beat-actions {
        justify-content: center;
        width: 100%;
    }
    
    .oz-cart-trigger-shortcode,
    .oz-download-btn-shortcode,
    .oz-share-btn {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    .single-beat-waveform {
        height: 60px;
    }
}

@media (max-width: 480px) {
    .single-beat-container {
        padding: 12px;
    }
    
    .single-beat-title {
        font-size: 20px;
    }
    
    .single-beat-meta {
        font-size: 12px;
        gap: 10px;
    }
    
    .single-beat-play {
        width: 56px;
        height: 56px;
    }
    
    .single-beat-play i {
        font-size: 24px;
    }
}

/* Accessibility */
.single-beat-play:focus {
    outline: 2px solid #3176CE;
    outline-offset: 2px;
}

/* Keep focus visible for keyboard navigation but prevent pink overlay */
.oz-cart-trigger-shortcode:focus-visible {
    outline: 2px solid #3176CE;
    outline-offset: 2px;
}

.oz-download-btn-shortcode:focus-visible,
.oz-share-btn:focus-visible {
    outline: 2px solid #3176CE;
    outline-offset: 2px;
}

/* Ensure waveform is visible */
.single-beat-waveform wave {
    background: rgba(255, 255, 255, 0.05);
}

.single-beat-waveform wave::-webkit-scrollbar {
    display: none;
}

.single-beat-bulk-deal {
    margin-top: 20px;
    padding: 15px 20px;
    border-left: 4px solid #3176CE; /* brand color highlight */
    background-color: #1e1e1e; /* dark background */
    font-family: 'Arial', sans-serif;
    border-radius: 5px;
    color: #f0f0f0; /* light text for readability */
}
@media (min-width: 1025px) {
    .single-beat-bulk-deal {
        margin-left: 30px;
    }
}

.bulk-deal-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #D8D8D8; /* brand color for the title */
}

.bulk-deal-steps p {
    margin: 4px 0;
    font-size: 0.93rem;
    line-height: 1.4em;
    color: #D8D8D8; /* slightly lighter for steps */
}

.bulk-deal-steps p::before {
    content: "➥ "; /* optional bullet for each step */
    color: #D8D8D8; /* brand color bullet */
    font-weight: bold;
}
