
/* Overlay scuro */
#recorderModal {
position: fixed; inset: 0;
background: rgba(0,0,0,.72);
z-index: 9999;
display: none;                /* openRecorder() lo mette a flex */
align-items: center;
justify-content: center;
padding: 1rem;
}

/* Finestra */
.rec-modal-box {
background: #1a1a2e;
border: 1px solid #333355;
border-radius: 16px;
width: min(500px, 100%);
max-height: 90dvh;
display: flex;
flex-direction: column;
overflow: hidden;
box-shadow: 0 24px 64px rgba(0,0,0,.5);
}

/* Header */
.rec-modal-head {
display: flex; align-items: center; justify-content: space-between;
padding: 1rem 1.25rem;
border-bottom: 1px solid #333355;
flex-shrink: 0;
}
.rec-modal-head h3 { margin: 0; font-size: 1rem; font-weight: 700; color: #e0e0f0; }
.rec-close {
background: none; border: none; color: #8888aa;
font-size: 1.2rem; cursor: pointer; padding: .2rem .5rem; border-radius: 6px;
}
.rec-close:hover { background: rgba(255,255,255,.08); }

/* Tabs */
.rec-tabs {
display: flex; gap: .5rem;
padding: .75rem 1.25rem;
border-bottom: 1px solid #333355;
flex-shrink: 0;
}
.rec-tab {
flex: 1; padding: .5rem; border: 1px solid #333355;
border-radius: 8px; background: transparent; color: #8888aa;
font-size: .85rem; cursor: pointer; text-align: center; transition: all .15s;
}
.rec-tab.active { background: #4a90e2; border-color: #4a90e2; color: #fff; font-weight: 600; }

/* Body */
.rec-modal-body {
flex: 1; overflow-y: auto;
padding: 1rem 1.25rem;
display: flex; flex-direction: column; gap: .75rem;
}

#recPreview {
width: 100%; aspect-ratio: 16/9;
background: #000; border-radius: 10px; object-fit: cover;
}

#recResult { display: none; }

#recStatus {
font-size: .82rem; color: #8888aa;
text-align: center; min-height: 1.2em;
}

/* Pulsanti */
.rec-actions {
display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap;
padding: .75rem 1.25rem 1.25rem;
flex-shrink: 0;
}
.rec-actions button {
display: inline-flex; align-items: center; gap: .4rem;
padding: .55rem 1.2rem; border: none; border-radius: 8px;
font-size: .9rem; font-weight: 600; cursor: pointer;
transition: opacity .15s, transform .1s;
}
.rec-actions button:active  { transform: scale(.97); }
.rec-actions button:disabled { opacity: .4; cursor: default; }
#recBtnStart   { background: #4a90e2; color: #fff; }
#recBtnCapture { background: #e74c3c; color: #fff; }
#recBtnStop    { background: #e74c3c; color: #fff; }
#recBtnSave    { background: #27ae60; color: #fff; }

/* Mobile */
@media (max-width: 480px) {
#recorderModal { align-items: flex-end; padding: 0; }
.rec-modal-box { width: 100%; border-radius: 16px 16px 0 0; }
#recPreview    { aspect-ratio: 4/3; }
}
