/* ==========================================================================
   GIO Speaking Recorder Styles
   ========================================================================== */

.speaking-recorder {
    padding: 20px;
}

/* ---------- Shared ---------- */
.sr-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 12px 0 4px;
}
.sr-sublabel {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}
.sr-hint {
    font-size: 12px;
    color: #aaa;
    margin-top: 12px;
}
.sr-instruction {
    font-size: 14px;
    color: #555;
    margin: 16px 0;
}

/* ---------- Buttons ---------- */
.sr-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.sr-btn-record {
    background: var(--gio-color-action);
    color: #fff;
}
.sr-btn-record:hover {
    background: var(--gio-color-action-hover);
    transform: translateY(-1px);
}
.sr-btn-stop {
    background: #e53935;
    color: #fff;
}
.sr-btn-stop:hover {
    background: #c62828;
}
.sr-btn-skip {
    background: transparent;
    color: var(--gio-color-action);
    border: 1px solid var(--gio-color-action);
    font-size: 13px;
    padding: 8px 20px;
}
.sr-btn-skip:hover {
    background: rgba(127, 0, 255, 0.06);
}
.sr-btn-rerecord {
    background: #fff;
    color: #555;
    border: 1px solid #ddd;
}
.sr-btn-rerecord:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

/* ---------- IDLE State ---------- */
.sr-idle {
    text-align: center;
    padding: 32px 16px;
}
.sr-mic-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(127,0,255,0.1), rgba(127,0,255,0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.sr-mic-icon i {
    font-size: 36px;
    color: var(--gio-color-action);
}

/* ---------- PREPARATION State ---------- */
.sr-preparation {
    text-align: center;
    padding: 24px 16px;
}
.sr-countdown-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}
.sr-countdown-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.sr-ring-bg {
    fill: none;
    stroke: #e8e8e8;
    stroke-width: 6;
}
.sr-ring-fg {
    fill: none;
    stroke: var(--gio-color-action);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}
.sr-countdown-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: 700;
    color: var(--gio-color-action);
}

/* ---------- RECORDING State ---------- */
.sr-recording {
    text-align: center;
    padding: 24px 16px;
}
.sr-recording-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(229, 57, 53, 0.08);
    border-radius: 20px;
    margin-bottom: 20px;
}
.sr-rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e53935;
    animation: sr-pulse 1s ease-in-out infinite;
}
@keyframes sr-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.sr-rec-text {
    font-size: 13px;
    font-weight: 600;
    color: #e53935;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Waveform canvas */
.sr-waveform {
    display: block;
    margin: 16px auto;
    border-radius: 8px;
    background: #fafafa;
}

/* Timer */
.sr-timer {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    font-variant-numeric: tabular-nums;
    margin: 8px 0;
}
.sr-timer-bar {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
    overflow: hidden;
    margin: 8px auto 20px;
}
.sr-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gio-color-action), #e53935);
    border-radius: 2px;
    width: 0%;
    transition: width 1s linear;
}

/* ---------- COMPLETED State ---------- */
.sr-completed {
    text-align: center;
    padding: 24px 16px;
}
.sr-check-icon {
    margin-bottom: 8px;
}
.sr-check-icon i {
    font-size: 48px;
    color: #198754;
}
.sr-audio-player {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 16px auto;
    border-radius: 8px;
}
.sr-completed-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
    .speaking-recorder { padding: 12px; }
    .sr-countdown-ring { width: 100px; height: 100px; }
    .sr-countdown-number { font-size: 28px; }
    .sr-waveform { width: 240px; height: 48px; }
    .sr-timer { font-size: 24px; }
}
