/* ============================================================
   PREMIUM AUDIO PLAYER — BiberSA Style Modernized
   Minimalist, Reflection-based, Light & Premium
   ============================================================ */

.custom-audio-player {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: visible;
    color: #333;
    max-width: 100%;
    margin-bottom: 25px;
}

.custom-audio-player:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Compact Mode - Bütünleşik görünüm için */
.custom-audio-player.compact {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    transform: none !important;
}

/* ---- HEADER: Avatar + Info ---- */
.ap-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ap-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #f8f9fa;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    background: #f0f0f0;
    flex-shrink: 0;
}

.ap-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ap-info-stack {
    flex: 1;
    min-width: 0;
}

.ap-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.ap-flag {
    width: 16px;
    display: inline-block;
    border-radius: 2px;
}

.ap-artist-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-demo-title {
    font-size: 0.9rem;
    color: #ff2d2d;
    font-weight: 400;
    margin-bottom: 6px;
}

/* ---- CONTROLS ROW ---- */
.ap-controls-small {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ap-btn-ctrl {
    background: none;
    border: none;
    color: #b5b5b5;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s, transform 0.1s;
}

.ap-btn-ctrl:hover {
    color: #ff2d2d;
}

.ap-btn-ctrl:active {
    transform: scale(0.9);
}

/* ---- MAIN PLAYER ROW (Bottom) ---- */
.ap-main-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.player-btn-play {
    background: none;
    border: none;
    color: #b5b5b5;
    font-size: 38px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.player-btn-play:hover {
    color: #ff2d2d;
    transform: scale(1.05);
}

/* ---- WAVEFORM (REFLECTED) ---- */
.ap-waveform-container {
    flex: 1;
    height: 48px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    position: relative;
    padding-bottom: 2px;
}

.ap-vu-bar {
    flex: 1;
    background: #d0d0d0;
    min-width: 2px;
    border-radius: 1px 1px 0 0;
    height: 8px;
    transition: height 0.1s ease, background 0.2s ease;
}

/* Reflection Effect */
.ap-reflect-wrap {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 24px;
    transform: scaleY(-1);
    opacity: 0.12;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1), transparent);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1), transparent);
}

.ap-reflect-bar {
    flex: 1;
    background: #d0d0d0;
    min-width: 2px;
    height: 8px;
    transition: height 0.1s ease, background 0.2s ease;
}

/* Playing State */
.custom-audio-player.playing .ap-vu-bar,
.custom-audio-player.playing .ap-reflect-bar {
    background: #ff2d2d;
}

.player-btn-play.loading::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #ff2d2d;
    border-radius: 50%;
    animation: ap-spin 0.8s linear infinite;
}

@keyframes ap-spin {
    to {
        transform: rotate(360deg);
    }
}

/* TOP RIGHT ACTIONS */
.ap-top-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #e0e0e0;
}

.ap-action-icon {
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
}

.ap-action-icon:hover {
    color: #aaa;
}

/* ---- DARK THEME SUPPORT ---- */
[data-theme="dark"] .custom-audio-player {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #eee;
}

[data-theme="dark"] .ap-artist-name {
    color: #eee;
}

[data-theme="dark"] .ap-avatar {
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .ap-vu-bar,
[data-theme="dark"] .ap-reflect-bar {
    background: #333;
}

[data-theme="dark"] .ap-btn-ctrl,
[data-theme="dark"] .player-btn-play {
    color: #555;
}