/* Kadence ACF Audio Player Stylesheet - Figma Styled (Clean & Transparent) */
.kaap-audio-player-wrapper {
    width: 100%;
    background-color: transparent; /* No background */
    box-sizing: border-box;
    padding: 0; /* No padding */
    color: inherit; /* Inherit color from theme instead of hardcoding #ffffff */
    user-select: none;
    border-radius: 0; /* Flat sharp edges */
}

.kaap-controls-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 0; /* No padding */
}

/* Play/Pause Button */
.kaap-play-pause-btn {
    background: none;
    border: none;
    padding: 0;
    color: inherit; /* Inherit color from theme */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: transform 0.15s ease, opacity 0.15s ease;
    flex-shrink: 0;
}

.kaap-play-pause-btn:hover {
    transform: scale(1.1);
    opacity: 0.95;
}

.kaap-play-pause-btn svg {
    width: 24px;
    height: 24px;
}

/* Progress Slider Container */
.kaap-progress-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    position: relative;
}

/* Figma Style Progress Bar: sharp corners, currentColor border, universal contrast background */
.kaap-progress-bar {
    width: 100%;
    height: 16px; /* Taller rectangular bar */
    background-color: rgba(128, 128, 128, 0.2); /* Universal gray contrast */
    position: relative;
    border: 1px solid currentColor; /* Dynamic border color */
    border-radius: 0; /* Sharp corners */
    box-sizing: border-box;
    overflow: hidden;
}

.kaap-progress-filled {
    height: 100%;
    width: 0%;
    background-color: #e22c38; /* Red accent fill */
    border-radius: 0;
    transition: width 0.05s linear;
}

/* Time Display */
.kaap-time-display {
    font-size: 13px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-variant-numeric: tabular-nums; /* Prevents text shifting */
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    color: inherit; /* Inherit color */
    flex-shrink: 0;
}

.kaap-time-separator {
    opacity: 0.5;
}

/* Volume Wrapper */
.kaap-volume-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
	gap: 8px;
    flex-shrink: 0;
}

/* Volume button trigger */
.kaap-volume-btn {
    background: none;
    border: none;
    padding: 0;
    color: inherit; /* Inherit color */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.kaap-volume-btn:hover {
    opacity: 0.85;
}

.kaap-volume-btn svg {
    width: 26px;
    height: 24px;
}

/* Default (Desktop) Horizontal Volume container next to button */
.kaap-volume-container {
    width: 80px;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    flex-shrink: 0;
    position: static;
    transform: none;
    background-color: transparent;
    border: none;
    box-shadow: none;
    z-index: auto;
}

/* Tooltip pointing arrow - hidden on desktop */
.kaap-volume-container::after {
    display: none;
}

/* Figma Style Volume Bar: sharp corners, currentColor border, universal contrast background */
/* Horizontal track by default (Desktop) */
.kaap-volume-bar {
    width: 100%;
    height: 14px; 
    background-color: rgba(128, 128, 128, 0.2); /* Universal gray contrast */
    position: relative;
    border: 1px solid currentColor; /* Dynamic border color */
    border-radius: 0; /* Sharp corners */
    box-sizing: border-box;
    overflow: hidden;
    cursor: pointer;
}

.kaap-volume-filled {
    height: 100%;
    width: 80%; /* Default volume width */
    background-color: currentColor; /* Matches theme text color */
    border-radius: 0;
    position: static;
}

/* Error Notice (For Admins) */
.kaap-player-error {
    background-color: #fff5f5;
    border-left: 4px solid #e22c38;
    color: #c53030;
    padding: 12px 16px;
    font-size: 13px;
    border-radius: 0 4px 4px 0;
    margin: 10px 0;
    font-family: inherit;
}

/* Mobile Viewport Styles (< 767px wide) */
@media (max-width: 767px) {
    .kaap-controls-bar {
        gap: 12px;
    }
	
	.kaap-progress-bar {
		height: 14px;
	}

    .kaap-volume-wrapper {
        margin-left: 6px; /* Mobile margin left */
    }

    .kaap-time-display {
        display: none !important; /* Hide time display on mobile */
    }

    /* Mobile vertical absolute tooltip override */
    .kaap-volume-container {
        position: absolute !important;
        bottom: 36px !important; /* Positioned directly above the volume button (with 8px spacing) */
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 32px !important;
        height: 110px !important; /* Total vertical height */
        background-color: #1c1c1c !important; /* Solid charcoal background */
        border: 1.5px solid #1f1f1f !important; /* Solid border */
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
        display: none !important; /* Managed dynamically via .kaap-volume-open */
        align-items: center !important;
        justify-content: center !important;
        padding: 15px 0 !important;
        z-index: 100 !important;
        overflow: visible !important;
    }

    /* Show pointing-down tooltip arrow on mobile */
    .kaap-volume-container::after {
        display: block !important;
        content: '' !important;
        position: absolute !important;
        top: 100% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 0 !important;
        height: 0 !important;
        border-left: 6px solid transparent !important;
        border-right: 6px solid transparent !important;
        border-top: 6px solid #1c1c1c !important; /* Matches vertical container background */
    }

    /* Make vertical tooltip slider open */
    .kaap-volume-container.kaap-volume-open {
        display: flex !important;
    }

    /* Mobile Vertical Volume Bar */
    .kaap-volume-bar {
        width: 10px !important;
        height: 80px !important;
        overflow: visible !important;
    }

    /* Mobile Vertical Volume Filled */
    .kaap-volume-filled {
        width: 100% !important;
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        background-color: #e22c38 !important; /* Red accent fill */
        height: 80%; /* Default volume height */
    }
}
