/* ========================================
   TRUSSTTY — MICROPHONE RECORDING UI
======================================== */

/* Recording controls container */
.mic-recording-controls {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 44px;
    box-sizing: border-box;
    flex-shrink: 1;
}

/* Cancel and stop buttons */
.mic-cancel-button,
.mic-stop-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Cancel button */
.mic-cancel-button {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    color: #111111;
    font-size: 28px;
    line-height: 1;
}

/* Stop button */
.mic-stop-button {
    position: relative;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #111111;
}

/* White square inside stop button */
.mic-stop-button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: #ffffff;
    transform: translate(-50%, -50%);
}

/* Button press effect */
.mic-cancel-button:active,
.mic-stop-button:active {
    transform: scale(0.9);
}

/* Disabled buttons */
.mic-cancel-button:disabled,
.mic-stop-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Waveform container */
.mic-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    overflow: hidden;
}

/* Monochrome waveform bars */
.mic-waveform-bar {
    display: block;
    flex: 1 1 3px;
    width: 3px;
    min-width: 2px;
    max-width: 5px;
    height: 4px;
    border-radius: 5px;
    background: #111111;
    transform-origin: center;
    transition: height 70ms ease;
    will-change: height;
}

/* Recording animation */
.mic-button.is-recording {
    background: #ffffff;
    animation: micRecordingPulse 1s ease-in-out infinite alternate;
}

@keyframes micRecordingPulse {
    from {
        box-shadow: 0 0 2px rgba(0, 0, 0, 0.15);
    }

    to {
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
    }
}

/* Recording status */
.mic-recording-status {
    font-size: 12px;
    color: #666666;
    white-space: nowrap;
}

/* Recording elapsed time */
.mic-recording-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    color: #111111;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Trusstty microphone button: white circle, black border */
#micButton.mic-button {
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;
    color: #000000;
    border: 1px solid #000000;
    border-radius: 50%;

    box-shadow: none;
    outline: none;
    flex-shrink: 0;
}

/* Microphone SVG icon */
#micButton.mic-button svg {
    display: block;
    visibility: visible;
    opacity: 1;

    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;

    fill: none;
    stroke: #000000;
    stroke-width: 1.8;

    overflow: visible;
    flex-shrink: 0;
}

/* Remove decorative square pseudo-elements */
#micButton.mic-button::before,
#micButton.mic-button::after {
    content: none;
    display: none;
}

/* Accessible keyboard focus */
#micButton.mic-button:focus-visible {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

/* Mobile layout */
@media (max-width: 480px) {
    .mic-recording-controls {
        gap: 6px;
    }

    .mic-waveform {
        gap: 1px;
    }

    .mic-waveform-bar {
        max-width: 4px;
    }
}

/* Reduced-motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .mic-button.is-recording {
        animation: none;
    }

    .mic-cancel-button,
    .mic-stop-button {
        transition: none;
    }
}