﻿/* ===== Layout & page shell ===== */
body {
    padding: 0 100px 100px;
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
}

h1 {
    margin-top: 0;
    padding-top: 10px;
}

.layout-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 60px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.left-controls {
    flex: 1;
    min-width: 320px;
}

.right-status {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-width: 280px;
}

/* ===== Buttons ===== */
button {
    background-color: #007bff;
    color: #fff;
    font-size: 16px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    margin: 4px 6px 12px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    button:hover {
        background-color: #0056b3;
    }

    button:active {
        background-color: #004799;
    }

    button:disabled {
        background-color: #cccccc;
        cursor: not-allowed;
    }

/* ===== Select (dropdown) groups ===== */
.select-row {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.select-group {
    display: flex;
    flex-direction: column;
}

/* ===== Status indicator (big circle) ===== */
#statusIndicator {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: lightblue;
    transition: background 0.3s ease;
}

.listening {
    background: radial-gradient(circle, blue, darkblue);
    box-shadow: 0 0 0 0 rgba(0,0,0,.4);
    animation: pulse-black 2s infinite ease-in-out;
}

.speaking {
    background: radial-gradient(circle, blue, darkblue);
    animation: pulse-black 1.4s infinite ease-in-out;
}

.idle {
    background: linear-gradient(135deg,#999,#666);
    box-shadow: none;
}

/* ===== Pulse animation (status & mic) ===== */
@keyframes pulse-black {
    0% {
        box-shadow: 0 0 0 0 rgba(0,0,0,.4);
    }

    70% {
        box-shadow: 0 0 0 60px rgba(0,0,0,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0,0,0,0);
    }
}

/* ===== Transcript textarea ===== */
textarea {
    width: 100%;
    max-width: 100%;
    min-height: 400px;
    height: 400px;
    box-sizing: border-box;
    resize: vertical;
    padding: 14px;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fdfdfd;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.06);
    transition: border .2s ease, box-shadow .2s ease;
}

    textarea:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0,123,255,.15);
    }

/* ===== Mic indicator row ===== */
.mic-spinner-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

#micIndicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    font-weight: bold;
    font-size: 16px;
}

.mic-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transition: background-color .3s, box-shadow .3s;
}

.mic-on .mic-dot {
    background-color: #e53935;
    animation: mic-pulse 1.2s infinite;
}

.mic-on #micStatusText {
    color: #e53935;
}

.mic-off .mic-dot {
    background-color: #999;
    animation: none;
}

.mic-off #micStatusText {
    color: #666;
}

@keyframes mic-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(229,57,53,.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(229,57,53,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(229,57,53,0);
    }
}


/* ===== Spinner (dot loader) ===== */
#spinner { /* hide on first paint */
    display: none;
}

.spinner-wrapper {
    display: flex;
    justify-content: flex-start;
    min-height: 20px;
}

.dot-loader {
    display: flex;
    flex-direction: row;
    gap: 15px;
    white-space: nowrap;
}

    .dot-loader .dot {
        width: 15px;
        height: 15px;
        background: #007bff;
        border-radius: 50%;
        animation: none;
    }

    /* Start animating when .active is present */
    .dot-loader.active .dot { /* ⬅ NEW selector */
        animation: dot-bounce 1.2s infinite ease-in-out;
    }
        .dot-loader .dot:nth-child(1) {
            animation-delay: 0s;
        }

        .dot-loader .dot:nth-child(2) {
            animation-delay: .1s;
        }

        .dot-loader .dot:nth-child(3) {
            animation-delay: .2s;
        }
        /* …repeat up to 10 dots as in original… */
        .dot-loader .dot:nth-child(4) {
            animation-delay: .3s;
        }

        .dot-loader .dot:nth-child(5) {
            animation-delay: .4s;
        }

        .dot-loader .dot:nth-child(6) {
            animation-delay: .5s;
        }

        .dot-loader .dot:nth-child(7) {
            animation-delay: .6s;
        }

        .dot-loader .dot:nth-child(8) {
            animation-delay: .7s;
        }

        .dot-loader .dot:nth-child(9) {
            animation-delay: .8s;
        }

        .dot-loader .dot:nth-child(10) {
            animation-delay: .9s;
        }

@keyframes dot-bounce {
    0%,80%,100% {
        transform: scale(.7);
        opacity: .5;
    }

    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* ===== Audio player ===== */
audio {
    width: 300px;
}
/* Fully hide settings panel on page load */
#settingsPanel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

    /* Show settings panel when 'show' class is toggled */
    #settingsPanel.show {
        max-height: 230px; /* adjust if needed */
        margin-bottom: 20px; /* ← add this */
    }

.mic-group {
    margin-bottom: 20px;
}

.voice-group {
    margin-bottom: 20px;
}