/* 
 * DL Btn & Audio Player - Styles
 * Version: 1.0.9
 */

/* RESET for consistent styling across themes */
.dl-btn-container {
    display: flex;
    justify-content: center;
    margin: 15px auto;
    width: 100%;
    clear: both;
}

/* Download Button Styles - FIXED LAYOUT */
.dl-btn-box {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--dl-btn-color-from), var(--dl-btn-color-to));
    color: #fff;
    cursor: pointer;
    max-width: var(--dl-btn-width) !important; /* Force small width */
    width: 100% !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    text-decoration: none !important;
    border: none;
    margin: 0 auto !important; /* Center it */
    position: relative;
}

.dl-btn-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.18);
}

.dl-btn-box.busy {
    background: linear-gradient(90deg, #333333, #555555);
    transform: translateY(0);
}

/* Icon on the left - FIXED */
.dl-btn-box .dl-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.dl-btn-box .dl-btn-icon i {
    font-size: 18px;
}

/* Text container - RIGHT BESIDE THE ICON (FIXED) */
.dl-btn-box .dl-btn-text {
    flex-grow: 1;
    text-align: left;
    min-width: 0; /* Prevent overflow */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* DOWNLOAD MP3 text - right beside icon */
.dl-btn-box .dl-btn-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-bottom: 2px;
}

/* File size text - BELOW DOWNLOAD MP3 text */
.dl-btn-box .dl-btn-info {
    font-size: 11px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    line-height: 1.2;
}

/* Arrow on the right - positioned correctly */
.dl-btn-box .dl-btn-arrow {
    margin-left: auto;
    font-size: 16px;
    opacity: 0.7;
    transition: transform 0.15s ease, opacity 0.15s ease;
    flex-shrink: 0;
    padding-left: 8px;
}

.dl-btn-box:hover .dl-btn-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* Professional Audio Player Styles */
.dl-audio-container {
    max-width: var(--dl-player-width) !important;
    margin: 20px auto !important;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #eaeaea;
    clear: both;
}

.dl-audio-player {
    width: 100%;
    height: 50px;
    background: #f8f9fa;
    border-radius: 0;
    outline: none;
}

.dl-audio-header {
    padding: 12px 16px;
    background: linear-gradient(90deg, var(--dl-player-color), var(--dl-player-color-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dl-audio-title {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dl-audio-title i {
    font-size: 16px;
}

.dl-audio-info {
    font-size: 11px;
    opacity: 0.9;
}

.dl-audio-controls {
    padding: 12px 16px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dl-control-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--dl-player-color);
    transition: all 0.2s;
}

.dl-control-btn:hover {
    background: var(--dl-player-color);
    color: white;
    transform: scale(1.05);
}

.dl-progress-container {
    flex: 1;
    height: 5px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.dl-progress-bar {
    height: 100%;
    background: var(--dl-player-color);
    width: 0%;
    transition: width 0.1s;
}

.dl-time {
    font-size: 11px;
    color: #6c757d;
    min-width: 40px;
    text-align: center;
    font-family: monospace;
}

.dl-volume-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dl-volume-slider {
    width: 50px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    cursor: pointer;
}

.dl-volume-level {
    height: 100%;
    background: var(--dl-player-color);
    width: 100%;
}

/* Hide player when only button is enabled */
.dl-audio-container.button-only {
    display: none !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .dl-audio-container {
        max-width: 100% !important;
        margin: 15px auto !important;
    }
    
    .dl-btn-box {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .dl-audio-controls {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .dl-control-btn {
        width: 28px;
        height: 28px;
    }
    
    .dl-volume-slider {
        width: 40px;
    }
    
    .dl-btn-box {
        padding: 10px 14px;
    }
    
    .dl-btn-box .dl-btn-icon {
        width: 36px;
        height: 36px;
    }
    
    .dl-btn-box .dl-btn-title {
        font-size: 13px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .dl-btn-box {
        padding: 8px 12px;
    }
    
    .dl-btn-box .dl-btn-icon {
        width: 32px;
        height: 32px;
        margin-right: 8px;
    }
    
    .dl-btn-box .dl-btn-title {
        font-size: 12px;
    }
    
    .dl-btn-box .dl-btn-info {
        font-size: 10px;
    }
    
    .dl-btn-box .dl-btn-arrow {
        font-size: 14px;
    }
}