/* ============================================
   HÄÄLETÖÖ — STIILID
   ============================================ */

/* Ruumikaardid (index.php) */
.ht-room-card {
    transition: box-shadow 0.2s;
}
.ht-room-card:hover {
    box-shadow: var(--shadow-hover, 0 4px 12px rgba(0,0,0,0.1));
}
.ht-room-inactive {
    opacity: 0.7;
}
.ht-room-title {
    display: block;
    color: var(--text-primary, #363636);
    text-decoration: none;
}
.ht-room-title:hover {
    color: var(--accent-color, #3273dc);
}

/* Ülesannete nimekiri (room.php) */
.ht-task-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.5rem;
    border: 1px solid var(--border-light, #f0f0f0);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: var(--bg-card, #fff);
    transition: box-shadow 0.15s, opacity 0.15s;
    cursor: default;
}
.ht-task-item:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.ht-task-drag-handle {
    cursor: grab;
    color: var(--text-muted, #b5b5b5);
    padding: 0 0.25rem;
}
.ht-task-drag-handle:active {
    cursor: grabbing;
}
.ht-task-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.ht-task-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}
.ht-task-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}
.ht-task-item.ht-dragging {
    opacity: 0.4;
}

/* Salvestised (room.php) */
.ht-recording-item {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-light, #f0f0f0);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: var(--bg-card, #fff);
}
.ht-recording-item audio {
    height: 32px;
}
.ht-recording-new {
    animation: ht-fade-in 0.5s ease;
    border-color: var(--success-color, #48c774);
    box-shadow: 0 0 0 2px rgba(72, 199, 116, 0.2);
}
[data-theme="dark"] .ht-recording-new {
    box-shadow: 0 0 0 2px rgba(72, 199, 116, 0.3);
}
@keyframes ht-fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Jagamisblokk (room.php) */
.ht-share-box {
    border-left: 4px solid #3273dc;
}
.ht-share-code {
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    color: var(--accent-color, #3273dc);
    background: var(--bg-secondary, #f5f5f5);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

/* Klasside valik (room.php sätted) */
.ht-class-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.ht-class-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-light, #f0f0f0);
    border-radius: 6px;
    transition: background 0.15s;
}
.ht-class-option:hover {
    background: var(--bg-hover, #f5f5f5);
}

/* Nimekirjast valimine (join.php) */
.ht-name-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem 0;
}
.ht-name-btn {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border-color, #dbdbdb);
    border-radius: 6px;
    background: var(--bg-card, #fff);
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    width: 100%;
    transition: all 0.15s;
}
.ht-name-btn:hover {
    border-color: var(--accent-color, #3273dc);
    background: var(--bg-hover, #f5f5f5);
}

/* Õpilase vaade (join.php) */
.ht-student-task {
    transition: border-color 0.2s;
}
.ht-student-recording audio {
    display: block;
}

/* Salvestamise animatsioon */
.ht-recording-active {
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 56, 96, 0.05);
    border: 1px solid rgba(255, 56, 96, 0.2);
}
.ht-rec-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--danger-color, #ff3860);
    display: inline-block;
    animation: ht-pulse 1.5s infinite;
}
@keyframes ht-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.ht-rec-timer {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary, #363636);
}

/* Spinner */
.ht-spinner {
    border: 3px solid var(--border-light, #f5f5f5);
    border-top: 3px solid var(--accent-color, #3273dc);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: ht-spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes ht-spin {
    to { transform: rotate(360deg); }
}

/* Peer salvestised */
.ht-peer-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-light, #f0f0f0);
}
.ht-peer-item:last-child {
    border-bottom: none;
}
.ht-peer-item audio {
    height: 28px;
}

/* Tumeda režiimi kohandused */
[data-theme="dark"] .ht-recording-active {
    background: rgba(255, 56, 96, 0.1);
    border-color: rgba(255, 56, 96, 0.3);
}
[data-theme="dark"] .ht-recording-item,
[data-theme="dark"] .ht-task-item {
    border-color: var(--border-color, #444);
}

/* Mobiil */
@media screen and (max-width: 768px) {
    /* Kompaktsem padding */
    .ht-student-task.box {
        padding: 0.75rem;
    }
    .ht-student-recording {
        margin-top: 0.5rem !important;
    }
    .ht-student-recording audio {
        height: 32px;
    }
    /* Õpetaja vaade */
    .ht-task-actions .button span:not(.icon) {
        display: none;
    }
    .ht-recording-item {
        padding: 0.4rem 0.5rem;
    }
    .ht-recording-item audio {
        width: 100%;
        min-width: 0;
    }
    /* Jagamisblokk */
    .ht-share-code {
        font-size: 1.2rem;
        padding: 0.3rem 0.5rem;
    }
}
