/* ===== STYLES GÉNÉRAUX ===== */

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
}

/* Mode public (interface visiteurs) */
body.mode-public {
    background: #111;
    color: #fff;
}

/* Conteneur principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* ===== HEADER ===== */

header {
    text-align: center;
    margin-bottom: 15px;
}

header h1 {
    margin: 0 0 5px;
    font-size: 2rem;
}

header p {
    margin: 0;
    color: #ccc;
}

/* ===== SECTIONS ===== */

section {
    margin-bottom: 20px;
}

h2 {
    margin: 10px 0;
    font-size: 1.4rem;
}

/* Petite aide / hint */
.hint {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 5px;
}

/* ===== CHOIX DES FONDS ===== */

.backgrounds {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bg-item {
    border: 3px solid transparent;
    cursor: pointer;
    background: #222;
    border-radius: 6px;
    overflow: hidden;
    width: 200px;
}

.bg-item img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.bg-label {
    padding: 5px 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bg-item.selected {
    border-color: #00bcd4;
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.7);
}

.badge-featured {
    font-size: 0.75rem;
    background: #ffc107;
    color: #000;
    border-radius: 10px;
    padding: 1px 6px;
}

/* ===== LIVE STAGE (CAMÉRA + DÉCOR) ===== */

#live-stage {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0 15px;
}

/* Vidéo en mode normal (avant plein écran) */
#live-stage video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 45%;
    height: auto;
    transform: translate(-50%, -50%);
    border: 4px solid #00bcd4;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.7);
    background: #000;
}

/* Boutons */
button {
    background: #00bcd4;
    color: #000;
    border: none;
    padding: 10px 20px;
    margin-top: 8px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
}

button:disabled {
    background: #555;
    color: #999;
    cursor: not-allowed;
}

/* ===== MODE PLEIN ÉCRAN CAMÉRA ===== */

body.fullscreen-cam {
    background: #000;
}

body.fullscreen-cam .container {
    max-width: none;
    padding: 0;
}

/* On peut masquer la liste des fonds et le header si tu veux un vrai mode cabine */
body.fullscreen-cam header,
body.fullscreen-cam #step-select-bg {
    display: none;
}

body.fullscreen-cam #step-camera {
    margin: 0;
}

/* Le live-stage occupe toute la fenêtre */
body.fullscreen-cam #live-stage {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    margin: 0;
}

/* La vidéo remplit alors tout l'écran */
body.fullscreen-cam #live-stage video {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none;
    border: none;
    border-radius: 0;
    object-fit: cover;
    box-shadow: none;
}

/* Bouton capture flottant en bas au centre */
body.fullscreen-cam #btn-capture {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 10;
}

/* ===== PRÉVISUALISATION ===== */

#step-preview {
    margin-top: 20px;
}

#step-preview img {
    max-width: 400px;
    width: 100%;
    display: block;
    margin-bottom: 10px;
    border: 3px solid #fff;
    border-radius: 8px;
}

#email-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

#email-form label {
    min-width: 100px;
}

#email-form input[type="email"] {
    padding: 8px;
    font-size: 16px;
    min-width: 220px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

#status {
    margin-top: 8px;
    font-style: italic;
    color: #ddd;
}

/* ===== UTILITAIRES ===== */

.hidden {
    display: none;
}

/* ===== STYLES DE BASE POUR ADMIN / SECOND ÉCRAN (si utilisés) ===== */

body.mode-admin {
    background: #f2f2f2;
    color: #222;
    font-family: Arial, sans-serif;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

.admin-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.6rem;
}

.admin-header nav a {
    margin-left: 10px;
    text-decoration: none;
    background: #00bcd4;
    color: #000;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.info-msg {
    background: #e0f7fa;
    border-left: 4px solid #00bcd4;
    padding: 8px 10px;
    margin-bottom: 10px;
}

/* Admin tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #fff;
}

.admin-table th,
.admin-table td {
    padding: 6px 8px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

.admin-table th {
    background: #f5f5f5;
}

.admin-table td.center {
    text-align: center;
}

.thumb-bg {
    width: 150px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

/* Admin forms */
.admin-form {
    background: #fff;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.admin-form label {
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
}

.admin-form input[type="text"],
.admin-form input[type="file"] {
    width: 100%;
    max-width: 400px;
    padding: 6px;
    margin-top: 3px;
    font-size: 0.9rem;
}

.admin-form button {
    margin-top: 8px;
}

/* Écran de login admin */
.admin-login-container {
    max-width: 400px;
    margin: 50px auto;
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.admin-login-container h1 {
    text-align: center;
    margin-top: 0;
}

.admin-login-container form label {
    display: block;
    margin-top: 5px;
}

.admin-login-container input[type="password"] {
    width: 100%;
    padding: 8px;
    margin-top: 3px;
    font-size: 1rem;
}

.admin-login-container .error {
    color: #c00;
    margin-top: 8px;
}

/* Mode écran secondaire (screen.php) */
body.mode-screen {
    background: #000;
    color: #fff;
}

.screen-container {
    text-align: center;
    padding: 10px;
}

.screen-photo-wrapper {
    margin: 10px auto;
    max-width: 90vw;
    max-height: 80vh;
}

.screen-photo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    border: 4px solid #00bcd4;
}

