/* Visio Thérapeute - Design épuré v3.1 - Corrections UX */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Container principal - CENTRÉ ET PLUS LARGE */
.visio-container {
    max-width: 1600px;
    width: 95%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.visio-header {
    text-align: center;
    padding: 15px 0;
    margin-bottom: 20px;
}

.visio-header h2 {
    font-size: 24px;
    color: #333;
    font-weight: 400;
}

/* Zone d'initialisation */
.session-init {
    text-align: center;
    padding: 20px;
}

/* Informations de session */
.session-info {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.session-info span {
    font-size: 16px;
    color: #666;
}

.room-code {
    font-size: 32px;
    font-weight: bold;
    color: #2c5282;
    letter-spacing: 3px;
    margin: 0 15px;
    font-family: monospace;
}

/* Zone vidéo - DIMENSIONS FIXES */
.video-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.video-wrapper {
    position: relative;
    width: 100%;
    /* Ratio 16:9 fixe */
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

/* Vidéo principale - TOUJOURS MÊME TAILLE */
.main-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Vidéo PiP (Picture in Picture) - INCRUSTATION BAS DROITE BIEN VISIBLE */
.pip-video {
    position: absolute !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 200px !important;
    height: 150px !important;
    max-width: 200px !important;
    max-height: 150px !important;
    object-fit: cover !important;
    border-radius: 10px;
    border: 3px solid white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    z-index: 20;
    display: none !important;
}

.pip-video.visible {
    display: block !important;
}

/* Message caméra en pause */
.camera-paused {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    z-index: 10;
}

/* Wrapper des contrôles */
.controls-wrapper {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Contrôles vidéo - ICÔNES VISIBLES ET GRANDES */
.video-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.control-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid #d0d0d0;
    background: white;
    color: #1a365d;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.control-btn:hover {
    background: #f8f9fa;
    border-color: #2c5282;
    transform: scale(1.08);
}

.control-btn.active {
    background: #2c5282;
    color: white;
    border-color: #2c5282;
}

.control-btn.muted {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
}

/* SVG dans les boutons - TAILLE VISIBLE ET COULEUR FORCÉE */
.control-btn svg {
    width: 36px;
    height: 36px;
    fill: #1a365d;
}

.control-btn:hover svg {
    fill: #2c5282;
}

.control-btn.active svg,
.control-btn.muted svg {
    fill: white;
}

/* Images dans les boutons (si utilisées) */
.control-btn img {
    width: 36px;
    height: 36px;
    opacity: 0.9;
}

.control-btn:hover img,
.control-btn.active img {
    opacity: 1;
}

/* Bouton terminer */
.control-btn.end-btn {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
    margin-left: 20px;
}

.control-btn.end-btn:hover {
    background: #c82333;
    border-color: #c82333;
}

.control-btn.end-btn svg {
    fill: white;
}

/* Bouton enregistrement */
.record-btn.recording {
    background: #ff0000;
    color: white;
    border-color: #ff0000;
    animation: pulse-record 1.5s infinite;
}

.record-btn.recording svg {
    fill: white;
}

@keyframes pulse-record {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

/* Bouton terminer consultant (texte) */
.btn-small.end-session-consultant {
    background-color: #e74c3c;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-small.end-session-consultant:hover {
    background-color: #c82333;
    transform: scale(1.08);
}

/* Timer de session */
.session-timer {
    text-align: center;
    margin-top: 12px;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

#timer-display {
    font-family: monospace;
    font-weight: bold;
    font-size: 18px;
    color: #2c5282;
}

/* Formulaire de connexion consultant - CENTRÉ ET BIEN VISIBLE */
.join-interface {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.join-form {
    background: white;
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.join-form label {
    display: block;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    font-weight: 500;
}

.code-input {
    width: 100%;
    padding: 18px;
    font-size: 28px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 25px;
    letter-spacing: 5px;
    font-family: monospace;
    font-weight: bold;
}

.code-input:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

/* Boutons principaux */
.visio-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.visio-btn.primary {
    background: #2c5282;
    color: white;
}

.visio-btn.primary:hover {
    background: #2a4e7c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
}

.visio-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Petits boutons */
.btn-small {
    padding: 8px 16px;
    border: 2px solid #2c5282;
    background: white;
    color: #2c5282;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #2c5282;
    color: white;
    transform: scale(1.05);
}

/* Messages de statut */
.status-display {
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    display: none;
    max-width: 400px;
    margin: 10px auto;
}

.status-display.show {
    display: block;
}

.status-display.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-display.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-display.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Mode plein écran */
.video-area:fullscreen {
    background: black;
    padding: 0;
}

.video-area:fullscreen .video-wrapper {
    border-radius: 0;
    padding-bottom: 0;
    height: 100vh;
}

.video-area:fullscreen .controls-wrapper {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    z-index: 100;
}

.video-area:fullscreen .control-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border-color: rgba(255,255,255,0.3);
}

.video-area:fullscreen .control-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Écran de fin de session */
.session-ended-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
}

.session-ended-screen.show {
    display: flex !important;
}

.session-ended-icon {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.session-ended-icon svg {
    width: 50px;
    height: 50px;
    fill: white;
}

.session-ended-title {
    font-size: 32px;
    font-weight: 600;
    color: white;
    margin-bottom: 15px;
    line-height: 1.3;
}

.session-ended-message {
    font-size: 18px;
    color: rgba(255,255,255,0.95);
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 500px;
}

.session-ended-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 350px;
}

.session-ended-btn {
    padding: 16px 32px;
    border: 2px solid white;
    background: white;
    color: #667eea;
    border-radius: 10px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    transition: all 0.2s;
}

.session-ended-btn:hover {
    background: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.session-ended-btn.secondary {
    background: transparent;
    color: white;
}

.session-ended-btn.secondary:hover {
    background: white;
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .visio-container {
        padding: 10px;
        width: 98%;
    }
    
    .visio-header h2 {
        font-size: 20px;
    }
    
    .pip-video {
        width: 140px;
        height: 105px;
        bottom: 15px;
        right: 15px;
    }
    
    .control-btn {
        width: 60px;
        height: 60px;
    }
    
    .control-btn svg,
    .control-btn img {
        width: 30px;
        height: 30px;
    }
    
    .room-code {
        font-size: 24px;
        letter-spacing: 2px;
    }
    
    .code-input {
        font-size: 20px;
        letter-spacing: 2px;
    }
    
    .video-controls {
        gap: 10px;
    }
    
    .session-ended-screen {
        padding: 30px 20px;
        min-height: 400px;
    }
    
    .session-ended-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }
    
    .session-ended-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .session-ended-title {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .session-ended-message {
        font-size: 16px;
        margin-bottom: 30px;
    }
    
    .session-ended-btn {
        font-size: 16px;
        padding: 14px 24px;
    }
    
    .btn-small.end-session-consultant {
        font-size: 14px;
        padding: 0.6rem 1rem;
    }
}