/* Therapy Central Audio Player Styles */
.tc-toggle-switch,
.tc-integrated-play-btn,
.tc-control-icon {
    touch-action: pan-y;
}

.tc-audio-player {
    width: 100%;
    max-width: 460px;
    background: linear-gradient(135deg, #52c0b9, #4db3ac);
    border-radius: 24px;
    padding: 22px;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 40px rgba(82, 192, 185, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0 auto 60px auto;
}

.tc-audio-player:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 48px rgba(82, 192, 185, 0.4);
}

.tc-audio-player.summary-mode {
    background: linear-gradient(135deg, #f0e7e7, #ead9d9);
    box-shadow: 0 12px 40px rgba(240, 231, 231, 0.3);
    color: #2c3e50;
}

.tc-audio-player.summary-mode:hover {
    box-shadow: 0 16px 48px rgba(240, 231, 231, 0.4);
}

.tc-audio-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 200%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,85 C150,65 250,105 400,80 C550,55 650,110 800,85 C950,60 1050,100 1200,85 L1200,120 L0,120 Z' fill='%23ffffff' fill-opacity='0.12'/%3E%3C/svg%3E");
    background-size: 50% 60%;
    background-repeat: repeat-x;
    background-position: 0 bottom;
    animation: wave-animation 20s linear infinite;
    pointer-events: none;
    border-radius: 24px;
}

.tc-audio-player.summary-mode::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,80 C200,60 300,100 500,75 C700,50 800,105 1000,80 C1100,70 1150,90 1200,80 L1200,120 L0,120 Z' fill='%232d7a6b' fill-opacity='0.10'/%3E%3C/svg%3E");
    background-size: 50% 40%;
    animation: wave-animation 15s linear infinite;
}

.tc-audio-player::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 200%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,90 C180,70 320,110 500,85 C680,60 820,115 1000,90 C1100,80 1150,100 1200,90 L1200,120 L0,120 Z' fill='%23ffffff' fill-opacity='0.08'/%3E%3C/svg%3E");
    background-size: 50% 40%;
    background-repeat: repeat-x;
    background-position: 0 bottom;
    animation: wave-animation 15s linear infinite reverse;
    pointer-events: none;
    border-radius: 24px;
}

.tc-audio-player.summary-mode::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,85 C170,65 330,105 500,80 C670,55 830,110 1000,85 C1100,75 1150,95 1200,85 L1200,120 L0,120 Z' fill='%232d7a6b' fill-opacity='0.06'/%3E%3C/svg%3E");
    background-size: 50% 60%;
    animation: wave-animation 20s linear infinite reverse;
}

@keyframes wave-animation {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.tc-top-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.tc-top-toggle.hidden {
    display: none;
}

.tc-toggle-switch {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 420px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    padding: 3px;
}

.tc-toggle-switch:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

.tc-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 50%;
    height: calc(100% - 6px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 23px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    pointer-events: none;
    z-index: 10;
    color: #52c0b9;
}

.tc-toggle-switch.summary-mode .tc-toggle-slider {
    transform: translateX(100%);
    color: #2c3e50;
}

.tc-toggle-labels {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
    z-index: 1;
}

.tc-toggle-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    pointer-events: none;
}

.tc-toggle-label.active {
    opacity: 0;
}

.tc-main-content {
    margin-bottom: 0;
}

.tc-content-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
}

.tc-content-icon {
    width: 68px;
    height: 68px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.tc-content-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tc-content-icon svg {
    width: 28px;
    height: 28px;
    fill: white;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tc-content-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    position: absolute;
    top: 0;
    left: 0;
}

.tc-content-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.tc-content-title-container {
    height: 26px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.tc-content-title-text {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: inline-block;
}

.tc-content-title-text.scrolling {
    animation: scroll-text-title 20s linear infinite;
}

.tc-content-subtitle-container {
    height: 20px;
    overflow: hidden;
    position: relative;
}

.tc-content-subtitle {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-block;
}

.tc-content-subtitle.scrolling {
    animation: scroll-text-subtitle 25s linear infinite;
}

@keyframes scroll-text-title {
    0%, 15% { transform: translateX(0); }
    85%, 100% { transform: translateX(calc(-100% + 200px)); }
}

@keyframes scroll-text-subtitle {
    0%, 15% { transform: translateX(0); }
    85%, 100% { transform: translateX(calc(-100% + 220px)); }
}

.tc-progress-section {
    position: relative;
    z-index: 2;
    margin-bottom: 16px;
}

.tc-progress-container {
    position: relative;
    height: 44px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    outline: none !important;
}

.tc-progress-container:focus {
    outline: none !important;
    box-shadow: none !important;
}

.tc-progress-track-wrapper {
    flex: 1;
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
}

.tc-progress-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    transform: translateY(-50%);
}

.tc-progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.tc-progress-dot {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    cursor: grab;
    transition: transform 0.1s ease-out;
    z-index: 5;
    border: 2px solid rgba(255, 255, 255, 0.8);
    outline: none !important;
}

.tc-progress-dot:hover {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 1);
}

.tc-progress-dot:active,
.tc-progress-dot.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.1);
    transition: none;
}

.tc-progress-dot:focus {
    outline: none !important;
}

.tc-integrated-play-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    outline: none;
    position: relative;
}

.tc-integrated-play-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.tc-integrated-play-btn:active {
    transform: scale(0.95);
}

.tc-integrated-play-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
    transition: all 0.3s ease;
    margin-left: 2px;
}

.tc-integrated-play-btn.playing svg {
    margin-left: 0;
}

.tc-integrated-play-btn.playing .tc-play-icon {
    display: none;
}

.tc-integrated-play-btn:not(.playing) .tc-pause-icon {
    display: none;
}

.tc-control-tooltip {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    transition-delay: 0.8s;
}

.tc-control-tooltip.right {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.tc-inline-control-icons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.tc-control-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    backdrop-filter: blur(10px);
    outline: none;
    position: relative;
}

.tc-control-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.tc-control-icon:hover .tc-control-tooltip {
    opacity: 1;
}

.tc-integrated-play-btn:hover .tc-control-tooltip {
    opacity: 1;
}

.tc-control-icon svg {
    width: 16px !important;
    height: 16px !important;
    fill: currentColor !important;
    display: block !important;
}

.tc-speed-control {
    font-size: 10px;
    font-weight: 700;
    user-select: none;
    letter-spacing: 0.2px;
}

.tc-time-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-weight: 500;
    margin-top: 20px;
    padding: 0 8px 0 16px;
}

.tc-controls-row {
    display: none;
}

.tc-audio-player.playing {
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 12px 40px rgba(82, 192, 185, 0.3); }
    50% { box-shadow: 0 12px 40px rgba(82, 192, 185, 0.5), 0 0 60px rgba(82, 192, 185, 0.3); }
}

.tc-audio-player.playing.summary-mode {
    animation: pulse-glow-pink 3s ease-in-out infinite;
}

@keyframes pulse-glow-pink {
    0%, 100% { box-shadow: 0 12px 40px rgba(240, 231, 231, 0.3); }
    50% { box-shadow: 0 12px 40px rgba(240, 231, 231, 0.5), 0 0 60px rgba(240, 231, 231, 0.3); }
}

.tc-audio-player.summary-mode .tc-content-icon {
    border-color: rgba(44, 62, 80, 0.2);
}

.tc-audio-player.summary-mode .tc-content-icon:hover {
    background: rgba(44, 62, 80, 0.25);
}

.tc-audio-player.summary-mode .tc-content-icon svg,
.tc-audio-player.summary-mode .tc-content-title-text,
.tc-audio-player.summary-mode .tc-content-subtitle,
.tc-audio-player.summary-mode .tc-time-display {
    color: #2c3e50;
}

.tc-audio-player.summary-mode .tc-progress-fill {
    background: rgba(44, 62, 80, 0.9);
}

.tc-audio-player.summary-mode .tc-progress-dot {
    background: #2c3e50;
    border-color: rgba(44, 62, 80, 0.8);
}

.tc-audio-player.summary-mode .tc-progress-track {
    background: rgba(44, 62, 80, 0.25);
}

.tc-audio-player.summary-mode .tc-integrated-play-btn {
    background: rgba(44, 62, 80, 0.12);
    border-color: rgba(44, 62, 80, 0.15);
}

.tc-audio-player.summary-mode .tc-integrated-play-btn:hover {
    background: rgba(44, 62, 80, 0.25);
    border-color: rgba(44, 62, 80, 0.3);
}

.tc-audio-player.summary-mode .tc-integrated-play-btn svg {
    fill: #2c3e50;
}

.tc-audio-player.summary-mode .tc-control-icon {
    background: rgba(44, 62, 80, 0.12);
    border-color: rgba(44, 62, 80, 0.15);
    color: #2c3e50;
}

.tc-audio-player.summary-mode .tc-control-icon:hover {
    background: rgba(44, 62, 80, 0.25);
}

.tc-audio-player.summary-mode .tc-toggle-label {
    color: rgba(44, 62, 80, 0.6);
}

.tc-audio-player.summary-mode .tc-toggle-label.active {
    color: rgba(44, 62, 80, 0.9);
}

.tc-audio-player.summary-mode .tc-toggle-switch {
    border-color: rgba(44, 62, 80, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tc-audio-player {
        padding: 18px;
        max-width: 95%;
        margin: 0 auto 60px auto;
    }
    
    .tc-toggle-switch {
        max-width: 250px;
        height: 48px;
    }
    
    .tc-toggle-slider {
        height: calc(100% - 6px);
        font-size: 15px;
    }
    
    .tc-content-title-text {
        font-size: 20px;
    }
    
    .tc-content-title-container {
        height: 24px;
    }
    
    .tc-content-subtitle {
        font-size: 13px;
    }
    
    .tc-time-display {
        font-size: 11px;
        margin-top: 18px;
        padding: 0 6px 0 14px;
    }
}

@media (max-width: 480px) {
    .tc-audio-player {
        padding: 16px;
        max-width: calc(100% - 20px);
        margin: 0 auto 60px auto;
    }
    
    .tc-toggle-switch {
        max-width: 220px;
        height: 44px;
    }
    
    .tc-toggle-slider {
        height: calc(100% - 6px);
        font-size: 14px;
    }
    
    .tc-content-header {
        gap: 16px;
    }
    
    .tc-content-icon {
        width: 60px;
        height: 60px;
    }
    
    .tc-content-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .tc-content-title-text {
        font-size: 18px;
    }
    
    .tc-content-title-container {
        height: 22px;
    }
}

@media (max-width: 400px) {
    .tc-toggle-switch {
        max-width: 200px;
        height: 42px;
    }
    
    .tc-toggle-slider {
        height: calc(100% - 6px);
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .tc-toggle-switch {
        max-width: 180px;
        height: 40px;
    }
    
    .tc-toggle-slider {
        height: calc(100% - 6px);
        font-size: 12px;
    }
}

@media (max-width: 320px) {
    .tc-audio-player {
        padding: 12px;
    }
}

/* Focus styles for accessibility */
.tc-toggle-switch:focus,
.tc-integrated-play-btn:focus {
    outline: none !important;
}

.tc-progress-container:focus {
    outline: none !important;
}