/* Glissonic Flute Plugin Styles - Clean Version */

/* Container */
.glissonic-flute-container {
    margin: 0 auto;
    text-align: center;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    box-sizing: border-box;
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

.flute-instrument {
    position: relative;
    border: none;
    background: transparent;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    display: block;
    width: 100%;
    max-width: 800px;
    z-index: 1;
}

/* Slider and Thumb */
.flute-slider {
    cursor: pointer;
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.flute-instrument > * {
    position: absolute;
}

.flute-instrument > .flute-slider-thumb {
    width: 30px !important;
    height: 30px !important;
}

.flute-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 0;
    height: 0;
    background: transparent;
}

.flute-slider::-moz-range-thumb {
    width: 0;
    height: 0;
    background: transparent;
    border: none;
}

.flute-slider-thumb {
    position: absolute;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #fff, #f0f0f0);
    border: 3px solid #333;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: grab;
    z-index: 10;
    pointer-events: auto;
    transform: translate(-50%, -50%);
    user-select: none;
    will-change: transform, left, top;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    animation: thumbPulse 2s infinite ease-in-out;
}

/* Pulse Animation */
@keyframes thumbPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(180, 4, 52, 0.7);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), 0 0 0 8px rgba(180, 4, 52, 0.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(180, 4, 52, 0);
    }
}

@keyframes thumbPulseMobile {
    0% {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(180, 4, 52, 0.8);
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), 0 0 0 12px rgba(180, 4, 52, 0.3);
        transform: translate(-50%, -50%) scale(1.15);
    }
    100% {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(180, 4, 52, 0);
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Tooltip */
.flute-slider-thumb::before {
    content: 'Play me';
    position: absolute !important;
    bottom: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(0, 0, 0, 0.9) !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    margin-bottom: 8px !important;
    opacity: 1 !important;
    pointer-events: none !important;
    z-index: 999999 !important;
    transition: opacity 0.3s ease !important;
    display: block !important;
    visibility: visible !important;
}

.flute-slider-thumb:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    border-color: #222;
}

.flute-slider-thumb:hover::before {
    opacity: 1;
}

.flute-slider-thumb:active,
.flute-slider-thumb.dragging {
    cursor: grabbing;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    border-color: #000;
}

.flute-slider-thumb.dragging::before {
    opacity: 0 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .glissonic-flute-container {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        margin: 5px;
        padding: 5px;
    }
    
    .flute-instrument {
        order: 1 !important;
        width: 100% !important;
        margin-bottom: 15px !important;
        max-width: 100%;
    }
    
    .flute-slider-thumb {
        width: 35px;
        height: 35px;
        border-width: 4px;
        animation: thumbPulseMobile 2.5s infinite ease-in-out;
    }
    
    .flute-slider-thumb::before {
        font-size: 10px;
        padding: 3px 6px;
        margin-bottom: 6px;
        opacity: 1 !important;
        display: block !important;
    }
    
    .flute-slider-thumb:hover {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

@media (max-width: 480px) {
    .glissonic-flute-container {
        margin: 2px;
        padding: 2px;
    }
    
    .flute-instrument {
        max-width: 100%;
    }
    
    .flute-slider-thumb {
        width: 40px;
        height: 40px;
        border-width: 5px;
    }
    
    .flute-slider-thumb::before {
        font-size: 9px;
        padding: 2px 5px;
        margin-bottom: 5px;
        opacity: 1 !important;
        display: block !important;
    }
}

/* Touch Support */
@media (pointer: coarse) {
    .flute-slider-thumb {
        width: 40px;
        height: 40px;
    }
    
    .flute-slider-thumb::before {
        opacity: 1 !important;
        display: block !important;
        font-size: 10px;
    }
}

/* Buttons Section */
.flute-buttons-section {
    margin-top: 20px !important;
    text-align: right !important;
    padding: 15px 0 !important;
}

.flute-buttons-section-below {
    margin-top: 20px !important;
    text-align: right !important;
    padding: 15px 0 !important;
}

/* Variant Buttons */
.flute-variant-buttons {
    text-align: right;
}

.flute-variant-btn {
    margin: 0 0 10px 10px !important;
    padding: 14px 22px !important;
    border: 3px solid #ccc !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    border: none !important;
    font-family: inherit !important;
    display: inline-block !important;
    text-decoration: none !important;
    box-shadow: none !important;
    min-width: 120px !important;
}

.flute-variant-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: none !important;
}

.flute-variant-btn.active {
    box-shadow: none !important;
}

.flute-variant-btn.active:hover {
    transform: translateY(-2px) !important;
}

/* Text Buttons */
.flute-text-buttons {
    margin-bottom: 15px;
    text-align: right;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.text-buttons-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.text-display-area {
    flex: 1;
    min-height: 50px;
    max-height: 120px;
    margin-bottom: 0;
    padding: 15px;
    font-size: 18px;
    line-height: 1.6;
    border-radius: 8px;
    background-color: transparent;
    border: none;
    color: #FFF;
    text-align: right;
    box-shadow: none;
    overflow-y: auto;
    flex-shrink: 0;
}

.text-buttons-title {
    width: 100%;
    text-align: center;
    color: #FFF;
    font-size: 16px;
    font-weight: 600;
}

.text-display-area:empty {
    background-color: transparent;
    border: none;
    color: transparent;
    font-style: normal;
    min-height: 50px;
    padding: 15px;
    max-height: 120px;
}

.text-display-area:empty:before {
    content: "";
    opacity: 0;
}

.flute-text-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: 2px solid white !important;
    border-color: white !important;
    border-style: solid !important;
    border-width: 2px !important;
    color: white !important;
    padding: 14px 22px !important;
    cursor: pointer !important;
    margin: 5px !important;
    font-size: 17px !important;
    border-radius: 30px !important;
    transition: all 0.3s ease !important;
    font-weight: 600 !important;
    min-width: 120px !important;
    outline: none !important;
    position: relative !important;
    z-index: 999999 !important;
    pointer-events: all !important;
}

.flute-text-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid white !important;
    color: white !important;
    opacity: 0.8 !important;
}

.flute-text-btn:active {
    background: rgba(255, 255, 255, 0.3) !important;
    border: 2px solid white !important;
    color: white !important;
    opacity: 0.9 !important;
}

.flute-text-btn.active {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid white !important;
    color: white !important;
}

/* Comment Bubbles */
.comment-bubble {
    position: fixed;
    background: linear-gradient(135deg, #007cba 0%, #005a8b 100%);
    color: white;
    padding: 14px 14px 0 14px;
    border-radius: 25px 25px 25px 5px;
    font-size: 14px;
    font-weight: 600;
    max-width: min(220px, 30vw);
    min-width: 120px;
    text-align: center;
    word-wrap: break-word;
    top: 20px;
    left: 20px;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    z-index: 99999 !important;
    box-shadow: none !important;
    animation: bubbleFloat 4s ease-in-out infinite;
    cursor: default;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none !important;
    backdrop-filter: none !important;
    letter-spacing: 0.3px;
    text-shadow: none !important;
}

.comment-bubble::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 30%;
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 7px solid transparent;
    border-top: 14px solid white;
    transform: rotate(-15deg);
    filter: none !important;
    z-index: 99998;
}

.comment-bubble::before {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 30%;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 6px solid transparent;
    border-top: 12px solid white;
    transform: rotate(-15deg);
    z-index: 99999;
}

@keyframes bubbleFloat {
    0%, 100% { 
        transform: translate(-50%, -50%) translateY(0px) rotate(0deg);
    }
    33% { 
        transform: translate(-50%, -50%) translateY(-8px) rotate(1deg);
    }
    66% { 
        transform: translate(-50%, -50%) translateY(-15px) rotate(-1deg);
    }
}

.comment-bubble:hover {
    transform: translate(-50%, -50%) scale(1.08) rotate(2deg);
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.4);
}

.comment-bubble-green {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: none;
    z-index: 99999 !important;
}

.comment-bubble-green::after {
    border-top-color: white;
    filter: drop-shadow(0 2px 4px rgba(40, 167, 69, 0.3));
    z-index: 99998 !important;
}

.comment-bubble-green::before {
    border-top-color: white;
    z-index: 99999 !important;
}

.comment-bubble-green:hover {
    box-shadow: none;
}

.comment-bubble-orange {
    background: linear-gradient(135deg, #fd7e14, #ff9b47);
    box-shadow: none;
    z-index: 99999 !important;
}

.comment-bubble-orange::after {
    border-top-color: white;
    filter: drop-shadow(0 2px 4px rgba(253, 126, 20, 0.3));
    z-index: 99998 !important;
}

.comment-bubble-orange::before {
    border-top-color: white;
    z-index: 99999 !important;
}

.comment-bubble-orange:hover {
    box-shadow: none;
}

.comment-bubble-purple {
    background: linear-gradient(135deg, #6f42c1, #8b63d6);
    box-shadow: none;
    z-index: 99999 !important;
}

.comment-bubble-purple::after {
    border-top-color: white;
    filter: drop-shadow(0 2px 4px rgba(111, 66, 193, 0.3));
    z-index: 99998 !important;
}

.comment-bubble-purple::before {
    border-top-color: white;
    z-index: 99999 !important;
}

.comment-bubble-purple:hover {
    box-shadow: none;
}

.comment-bubble-custom {
    box-shadow: none;
}

.comment-bubble-custom:hover {
    box-shadow: none !important;
}

/* Mobile Layout Adjustments */
@media (max-width: 768px) {
    .glissonic-flute-container {
        flex-direction: column !important;
        align-items: center !important;
        display: flex !important;
        position: relative !important;
    }
    
    .flute-buttons-section,
    .flute-buttons-section-below {
        position: static !important;
        text-align: center !important;
        margin-top: 20px !important;
        padding: 15px 0 !important;
        width: 100% !important;
        right: auto !important;
        bottom: auto !important;
        order: 2 !important;
    }
    
    .flute-instrument {
        order: 1 !important;
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    .flute-variant-buttons {
        text-align: center !important;
        margin-bottom: 15px !important;
    }
    
    .text-buttons-title {
        text-align: center !important;
    }
    
    .flute-variant-btn {
        font-size: 16px !important;
        padding: 12px 18px !important;
        margin: 5px !important;
        min-width: 96px !important;
        display: inline-block !important;
    }
    
    .flute-text-btn {
        background: transparent !important;
        background-color: transparent !important;
        border: 2px solid white !important;
        border-color: white !important;
        border-style: solid !important;
        border-width: 2px !important;
        color: white !important;
        margin: 5px !important;
        min-width: 140px !important;
        width: auto !important;
        font-size: 16px !important;
        padding: 12px 18px !important;
        text-align: center !important;
        box-sizing: border-box !important;
        border-radius: 30px !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        font-weight: 600 !important;
        outline: none !important;
        display: inline-block !important;
        position: relative !important;
        z-index: 999999 !important;
        touch-action: manipulation !important;
        pointer-events: all !important;
    }
    
    .flute-text-buttons {
        flex-direction: column !important;
        gap: 15px !important;
        text-align: center !important;
        align-items: center !important;
    }
    
    .flute-text-buttons > div:nth-child(2) {
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px !important;
    }
    
    .text-buttons-title {
        font-size: 16px !important;
        margin-bottom: 10px !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .text-display-area {
        text-align: center !important;
        font-size: 17px !important;
        padding: 15px !important;
        width: 100% !important;
        margin-bottom: 10px !important;
        justify-content: center !important;
    }
    
    .text-buttons-column {
        text-align: center !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 10px !important;
        flex-wrap: wrap !important;
    }
    
    .comment-bubble {
        font-size: 12px;
        padding: 10px 10px 0 10px;
        max-width: 150px;
    }
}

/* Desktop Layout */
@media (min-width: 1025px) {
    .flute-buttons-section,
    .flute-buttons-section-below {
        position: absolute !important;
        right: 0 !important;
        bottom: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        text-align: right !important;
        padding: 20px 0 !important;
        width: auto !important;
        z-index: 10 !important;
    }
    
    .flute-text-buttons {
        max-width: 500px !important;
        width: auto !important;
    }
    
    .text-display-area {
        max-width: 300px !important;
        min-width: 250px !important;
    }
    
    .text-buttons-column {
        min-width: 150px !important;
    }
    
    .glissonic-flute-container {
        position: relative !important;
    }
}
