/* Custom styles for the podcast player */
.audio-player {
    --plyr-color-main: #5d5d5d;
    --plyr-audio-controls-background: #e7e7e7;
    --plyr-audio-control-color: #374151;
    --plyr-audio-control-color-hover: #7c7c7c;
    margin-top: 1rem;
    position: relative;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 0.5rem !important; /* Reduced padding */
    margin-top: 5px !important; /* Reduced margin */
    min-height: 60px !important; /* Compact height */
    margin: 0.5rem 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-height: 40px;
    margin-bottom: 0 !important;
}

.plyr--audio {
    background: #1a1a1a !important;
    border-radius: 8px;
    overflow: hidden;
}

.plyr--audio .plyr__controls {
    background: #1a1a1a !important;
    color: #ffffff !important;
    padding: 12px !important;
    border-radius: 8px;
}

.plyr--audio .plyr__control {
    background: transparent;
    color: #ffffff;
}

.plyr--audio .plyr__control:hover {
    background: #333333;
}

.plyr--audio .plyr__progress__container {
    margin: 8px 0;
}

/* Custom progress bar with wave effect */
.plyr--audio .plyr__progress__bar {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.8) 0%, 
        rgba(255,255,255,0.6) 50%, 
        rgba(255,255,255,0.8) 100%);
    height: 4px;
    position: relative;
}

.plyr--audio .plyr__progress__bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.2) 2px,
        rgba(255,255,255,0.2) 4px
    );
    animation: wave 1s linear infinite;
}

@keyframes wave {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 12px 0;
    }
}

/* Preloader Animation */
.animate-letter {
    opacity: 0;
    transform: translateX(-20px);
    display: inline-block;
    animation: fadeInLeft 0.3s forwards;
    animation-delay: var(--delay);
}

@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Share Notification */
.share-notification-show {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

/* Remove progress bar elements */
.progress-bar,
.progress-bar-fill {
    display: none !important;
}

/* Custom scrollbar for podcast list */
.podcast-list::-webkit-scrollbar {
    width: 6px;
}

.podcast-list::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.podcast-list::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}

/* Loading animation for upload */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    top: 50%;
    left: 50%;
    margin: -0.625rem 0 0 -0.625rem;
    border: 2px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .plyr--audio .plyr__controls {
        padding: 0.5rem;
    }
    
    .audio-player {
        margin: 0 -1rem;
    }
}

/* Custom styles for the upload form */
.upload-zone {
    border: 2px dashed #e5e7eb;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-zone.dragover {
    border-color: #767676;
    background-color: #eef2ff;
}

/* Progress bar styles */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: #6f6f6f;
    transition: width 0.3s ease;
}
/* Preloader Animation */
.animate-letter {
    opacity: 0;
    transform: translateX(-20px);
    display: inline-block;
    animation: fadeInLeft 0.5s forwards;
    animation-delay: var(--delay);
}
/* styles.css */
/* WaveSurfer Styles */
.waveform-container {
    height: 40px !important; /* Reduced height */
    min-width: 200px;
    background: transparent;
    border-radius: 4px;
    padding: 5px !important; /* Reduced padding */
    margin: 5px 0 !important; /* Reduced margin */
    position: relative;
    cursor: pointer;
    transition: opacity 0.3s ease;
    width: 100%;
    height: 80px; /* Adjust height as needed */
    background-color: #1a1a1a; /* Background color for the waveform container */
    overflow: hidden;
    flex: 1;
    min-width: 0; /* Prevent flex item overflow */
    height: 40px;
    position: relative;
    margin: 0 8px;
    background: transparent;
}

.waveform-container canvas {
    width: 100% !important;
    height: 40px !important; /* Match container height */
    height: 100% !important;
    max-width: 100%;
}

.waveform-container:hover #hover {
    opacity: 1;
}

/* Custom Player Controls */
.audio-player {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 0.5rem !important; /* Reduced padding */
    margin-top: 5px !important; /* Reduced margin */
    min-height: 60px !important; /* Compact height */
    position: relative;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 0.5rem;
    margin: 0.5rem 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-height: 40px;
    margin-bottom: 0 !important;
}

.controls {
    display: flex;
    align-items: center;
    gap: 0.5rem !important; /* Reduced gap */
    padding: 0.25rem !important; /* Reduced padding */
    justify-content: space-between;
    align-items: center;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 0 4px;
    height: 40px;
}

.play-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px !important; /* Reduced padding */
    border-radius: 50%;
    transition: background-color 0.3s ease;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.play-button svg {
    width: 20px !important; /* Smaller icons */
    height: 20px !important;
    fill: #A4A5A6;
    width: 20px;
    height: 20px;
}

.play-button .play-icon,
.play-button .pause-icon {
    fill: #656666; /* Default color */
}

.play-button .pause-icon {
    fill: #333333; /* Dark gray color when playing */
}

/* Time Display */
.time-display {
    font-family: monospace;
    font-size: 12px;
    color: #A4A5A6;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: #4a4a4a;
    border-radius: 2px;
    outline: none;
    flex-shrink: 0;
    width: 60px;
    max-width: 60px;
    height: 4px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #A4A5A6;
    border-radius: 50%;
    cursor: pointer;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 4px;
    background: #4a4a4a;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: #A4A5A6;
    border-radius: 2px;
    transition: width 0.1s linear;
}

/* Like and Share Buttons */
.like-btn, .share-btn {
    padding: 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.like-btn:hover, .share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.like-btn svg,
.share-btn svg,
.embed-btn svg {
    width: 12px !important;
    height: 12px !important;
    transition: transform 0.2s ease;
}

/* Adjust the button padding to accommodate smaller icons */
.like-btn, 
.share-btn,
.embed-btn {
    padding: 0px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

/* Like count text size */
.likes-count {
    font-size: 12px;
    margin-right: 2px;
}

/* Button container spacing */
.flex.space-x-2 {
    gap: 4px; /* Reduce space between buttons */
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .audio-player {
        padding: 10px;
    }
    
    .volume-control {
        display: none;
    }
    .audio-player {
        padding: 0.25rem;
    }
    
    .controls {
        gap: 4px;
    }
}

/* Animation for play button */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.playing .play-button {
    animation: pulse 2s infinite;
}

/* Add this to your CSS file */
#waveform {
    cursor: pointer;
    position: relative;
}
#hover {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    pointer-events: none;
    height: 100%;
    width: 0;
    mix-blend-mode: overlay;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    transition: opacity 0.2s ease;
}
#waveform:hover #hover {
    opacity: 1;
}
#time, #duration {
    position: absolute;
    z-index: 11;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    padding: 2px;
    color: #A4A5A6;  /* Light gray color */
    background: transparent;  /* Remove black background */
    font-family: monospace;  /* For better number alignment */
    position: absolute;
    z-index: 11;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #A4A5A6;
    background: transparent;
    padding: 2px 4px;
    font-family: monospace;
    pointer-events: none;
}

#time {
    left: 4px;  /* Slight padding from edge */
    left: 4px;
}

#duration {
    right: 4px;  /* Slight padding from edge */
    right: 4px;
}

/* Update WaveSurfer colors */
wave {
    height: 40px !important;
}

.toast-notification {
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease-in-out;
    background-color: black !important; /* Force black background */
    color: #A4A5A6 !important; /* Use the app's standard gray text color */
    border: 1px solid #333333; /* Add subtle border */
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Override error state */
.toast-notification.bg-red-500 {
    background-color: black !important;
    border-color: #EF4444; /* Red border for error state */
}

/* Override success state */
.toast-notification.bg-green-500 {
    background-color: black !important;
    border-color: #10B981; /* Green border for success state */
}

.embed-btn:hover svg {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Add to styles.css */
.audio-player + .flex {
    margin-top: 8px;
    padding-left: 4px;
}

/* Preloader styles */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.rooster-head {
    width: 120px;
    height: 120px;
    animation: heartbeat 1s infinite ease-in-out;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.3));
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.15);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.15);
    }
    70% {
        transform: scale(1);
    }
}