* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0b141a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #d1d7db;
    overflow-x: hidden;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Chat container */
.chat-container {
    height: 100vh;
    background: #0b141a;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgcj0iMSIgZmlsbD0iIzFhMjUyZiIgb3BhY2l0eT0iMC4zIi8+PC9zdmc+');
    background-size: 100px 100px;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    justify-content: center;
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 24px;
    max-width: 600px;
    width: 100%;
}

/* WhatsApp message bubble */
.voice-message {
    background: #005c4b;
    border-radius: 7.5px;
    padding: 10px 12px 12px 12px;
    margin: 4px 0;
    max-width: 480px;
    min-width: 320px;
    align-self: flex-end;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.voice-message::before {
    content: '';
    position: absolute;
    top: 0;
    right: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-left-color: #005c4b;
    border-right: 0;
    border-top: 0;
    margin-top: 0;
}

/* Message metadata */
.message-meta {
    margin-bottom: 10px;
}

.message-title {
    color: #8696a0;
    font-size: 12px;
    font-weight: 500;
}

/* Voice message controls */
.voice-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.play-button {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.play-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.play-button:active {
    background: rgba(255, 255, 255, 0.35);
}

.play-icon {
    width: 0;
    height: 0;
    border-left: 8px solid #e9edef;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    margin-left: 2px;
}

.pause-icon {
    display: none;
    width: 10px;
    height: 12px;
    position: relative;
}

.pause-icon::before,
.pause-icon::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 12px;
    background: #e9edef;
    border-radius: 1px;
}

.pause-icon::before {
    left: 0;
}

.pause-icon::after {
    right: 0;
}

.voice-message.playing .play-icon {
    display: none;
}

.voice-message.playing .pause-icon {
    display: block;
}

/* WhatsApp-style waveform */
.waveform-container {
    flex: 1;
    height: 34px;
    display: flex;
    align-items: center;
    gap: 2px;
    position: relative;
    cursor: pointer;
    margin: 0 6px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.waveform-container:hover {
    background: rgba(255, 255, 255, 0.05);
}

.waveform-container:active {
    background: rgba(255, 255, 255, 0.1);
}

.waveform-bar {
    width: 3px;
    background: rgba(233, 237, 239, 0.6);
    border-radius: 1.5px;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.voice-message.playing .waveform-bar {
    background: rgba(233, 237, 239, 0.85);
}

/* More bars for better scrubbing precision - like real WhatsApp */
.waveform-bar:nth-child(1) { height: 6px; }
.waveform-bar:nth-child(2) { height: 14px; }
.waveform-bar:nth-child(3) { height: 10px; }
.waveform-bar:nth-child(4) { height: 18px; }
.waveform-bar:nth-child(5) { height: 12px; }
.waveform-bar:nth-child(6) { height: 16px; }
.waveform-bar:nth-child(7) { height: 8px; }
.waveform-bar:nth-child(8) { height: 20px; }
.waveform-bar:nth-child(9) { height: 14px; }
.waveform-bar:nth-child(10) { height: 16px; }
.waveform-bar:nth-child(11) { height: 10px; }
.waveform-bar:nth-child(12) { height: 18px; }
.waveform-bar:nth-child(13) { height: 12px; }
.waveform-bar:nth-child(14) { height: 14px; }
.waveform-bar:nth-child(15) { height: 8px; }
.waveform-bar:nth-child(16) { height: 22px; }
.waveform-bar:nth-child(17) { height: 16px; }
.waveform-bar:nth-child(18) { height: 12px; }
.waveform-bar:nth-child(19) { height: 10px; }
.waveform-bar:nth-child(20) { height: 14px; }
.waveform-bar:nth-child(21) { height: 18px; }
.waveform-bar:nth-child(22) { height: 8px; }
.waveform-bar:nth-child(23) { height: 16px; }
.waveform-bar:nth-child(24) { height: 12px; }
.waveform-bar:nth-child(25) { height: 20px; }
.waveform-bar:nth-child(26) { height: 14px; }
.waveform-bar:nth-child(27) { height: 10px; }
.waveform-bar:nth-child(28) { height: 16px; }
.waveform-bar:nth-child(29) { height: 12px; }
.waveform-bar:nth-child(30) { height: 6px; }

/* Waveform progress highlight */
.waveform-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    border-radius: 4px;
}

.waveform-progress .waveform-bar {
    background: #e9edef !important;
}

/* Timer and duration */
.voice-duration {
    color: #8696a0;
    font-size: 11px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    min-width: 32px;
    text-align: right;
    line-height: 1;
}

/* Effect buttons */
.effect-buttons {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    margin-bottom: 2px;
}

.effect-btn {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    color: rgba(233, 237, 239, 0.7);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.effect-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(233, 237, 239, 0.9);
}

.effect-btn.active {
    background: rgba(255, 255, 255, 0.25);
    color: #e9edef;
    font-weight: 600;
}


/* Responsive design */
@media (max-width: 480px) {
    .voice-message {
        max-width: calc(100vw - 80px);
        min-width: 200px;
    }
    
    .chat-container {
        padding: 4px 0;
    }
    
    .messages-container {
        padding: 0 4px;
    }
}