/* ================================
   MARANATHA ÉCOLE HÔTELIÈRE
   Feuille de style complète
   ================================ */

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f4f4;
    color: #222;
    line-height: 1.6;
}

.cachee { display: none !important; }

/* ================================
   EN-TÊTE (HERO)
   ================================ */
.hero {
    background: linear-gradient(135deg, #8B0000, #A50000);
    color: white;
    text-align: center;
    padding: 30px 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.hero .logo {
    width: 110px !important;
    height: 110px !important;
    max-width: 110px !important;
    max-height: 110px !important;
    object-fit: contain;
    margin: 0 auto 10px auto;
    display: block;
    border-radius: 50%;
    background: white;
    padding: 5px;
    border: 3px solid white;
}

.hero h1 {
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.hero p {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ================================
   CONTENEUR PRINCIPAL
   ================================ */
.container {
    max-width: 800px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.container h2 {
    color: #8B0000;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #8B0000;
    padding-bottom: 10px;
    font-size: 1.3rem;
}

.container h3 {
    color: #8B0000;
    margin: 25px 0 10px 0;
    font-size: 1.05rem;
    padding-bottom: 5px;
    border-bottom: 1px dashed #ddd;
}

/* ================================
   FORMULAIRE
   ================================ */
form {
    display: flex;
    flex-direction: column;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.inputBox {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

label {
    margin-top: 10px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border 0.2s, box-shadow 0.2s;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

textarea {
    resize: vertical;
    min-height: 70px;
}

input[type="file"] {
    margin-top: 5px;
    font-size: 0.9rem;
    padding: 8px;
    background: #fafafa;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #8B0000;
    background: #fff5f5;
}

/* ================================
   OPTIONS DE FORMATION
   ================================ */
.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.options label {
    display: flex;
    align-items: center;
    background: #fafafa;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    margin-top: 0;
    flex-wrap: wrap;
}

.options label:hover {
    border-color: #8B0000;
    background: #fff5f5;
}

.options input[type="radio"] {
    margin-right: 12px;
    accent-color: #8B0000;
    transform: scale(1.3);
    cursor: pointer;
}

.options label span {
    margin-left: auto;
    background: #8B0000;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.options label small {
    flex-basis: 100%;
    color: #666;
    font-size: 0.8rem;
    margin-top: 5px;
    padding-left: 30px;
    font-style: italic;
}

/* ================================
   BOUTON PRINCIPAL
   ================================ */
button[type="submit"],
.btn,
.btn-submit {
    margin-top: 25px;
    background: #8B0000;
    color: white;
    border: none;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: background 0.2s, transform 0.1s;
}

button[type="submit"]:hover,
.btn:hover,
.btn-submit:hover {
    background: #A50000;
}

button[type="submit"]:active,
.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    background: #999 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ================================
   BOUTONS GÉNÉRIQUES
   ================================ */
button {
    background: #8B0000;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    margin: 2px;
    font-family: inherit;
}

button:hover {
    background: #A50000;
}

td button {
    padding: 6px 10px;
    font-size: 1rem;
    margin: 2px;
}

/* ================================
   TABLEAU ADMINISTRATION
   ================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

th {
    background: #8B0000;
    color: white;
    padding: 12px;
    font-size: 0.95rem;
    text-align: center;
}

td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
    text-align: center;
}

tr:hover td {
    background: #fff5f5;
}

/* ================================
   BARRE DE RECHERCHE
   ================================ */
#recherche {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border 0.2s;
}

#recherche:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

/* ================================
   MODAL D'ÉDITION
   ================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal.visible { display: flex !important; }

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-content h2 {
    color: #8B0000;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #8B0000;
    padding-bottom: 10px;
}

.modal-content label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 8px 10px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.modal-content .close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 28px;
    font-weight: bold;
    color: #8B0000;
    cursor: pointer;
    line-height: 1;
}

.modal-content .close:hover {
    color: #c62828;
}

/* ================================
   ÉCRAN DE CONNEXION
   ================================ */
.ecran-connexion {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #8B0000, #A50000);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-box .logo {
    width: 100px !important;
    height: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
    object-fit: contain;
    margin: 0 auto 15px auto;
    display: block;
    border-radius: 50%;
    background: white;
    padding: 5px;
    border: 3px solid #8B0000;
}

.login-box h1 {
    color: #8B0000;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.login-box p {
    color: #666;
    margin-bottom: 25px;
}

.login-box form {
    text-align: left;
}

.login-box label {
    display: block;
    margin-top: 15px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.login-box input {
    width: 100%;
    padding: 12px 15px;
    margin-top: 5px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.login-box input:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.login-box button {
    width: 100%;
    margin-top: 25px;
    padding: 14px;
    font-size: 1.05rem;
    font-weight: bold;
}

.login-erreur {
    color: #c62828;
    text-align: center;
    margin-top: 15px;
    font-weight: 600;
    min-height: 20px;
}

/* ================================
   BARRE UTILISATEUR
   ================================ */
.user-bar {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.user-bar span {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: white;
}

.user-bar button {
    padding: 6px 15px;
    font-size: 0.85rem;
    background: #444;
}

/* ================================
   PRÉVISUALISATION PHOTO
   ================================ */
#preview-container {
    margin-top: 15px;
    padding: 15px;
    background: #fafafa;
    border: 2px dashed #8B0000;
    border-radius: 10px;
    text-align: center;
    animation: fadeInMessage 0.3s ease;
}

#preview-img {
    display: block;
    margin: 0 auto 10px auto;
    max-width: 220px;
    max-height: 220px;
    border-radius: 8px;
    border: 2px solid #8B0000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

#preview-info {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin: 0;
}

/* ================================
   MESSAGE SUCCÈS / ERREUR
   ================================ */
#message,
.message {
    margin-top: 25px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    line-height: 1.6;
    animation: fadeInMessage 0.3s ease;
}

#message.success,
.message.success {
    background: #e6f4ea;
    color: #1e7e34;
    border: 2px solid #1e7e34;
}

#message.error,
.message.error {
    background: #fdecea;
    color: #b71c1c;
    border: 2px solid #b71c1c;
}

@keyframes fadeInMessage {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================
   RESPONSIVE (MOBILE)
   ================================ */
@media (max-width: 600px) {
    .container {
        margin: 15px;
        padding: 20px;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.25rem;
    }

    .hero p {
        font-size: 0.85rem;
    }

    .hero .logo {
        width: 90px !important;
        height: 90px !important;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 6px 4px;
    }

    td button {
        padding: 4px 6px;
        font-size: 0.85rem;
    }

    .modal-content {
        padding: 20px;
    }

    .options label {
        font-size: 0.9rem;
    }

    .options label span {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* ================================
   STATISTIQUES ADMIN
   ================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, #8B0000, #A50000);
  color: white;
  padding: 20px 15px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(139, 0, 0, 0.2);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 5px;
}

.stats-options {
  margin-top: 25px;
  padding: 20px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #eee;
}

.stats-options h3 {
  color: #8B0000;
  margin-bottom: 15px;
  border-bottom: 2px solid #8B0000;
  padding-bottom: 8px;
  margin-top: 0;
  font-size: 1.05rem;
}

.stat-bar-container {
  margin-bottom: 12px;
}

.stat-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.stat-bar {
  height: 22px;
  background: #eee;
  border-radius: 11px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8B0000, #c62828);
  color: white;
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  border-radius: 11px;
  transition: width 0.5s ease;
  min-width: 30px;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-value {
    font-size: 1.5rem;
  }
  .stat-icon {
    font-size: 1.5rem;
  }
}

/* ================================
   STATISTIQUES ADMIN
   ================================ */
.stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 15px !important;
  margin-bottom: 30px !important;
  width: 100%;
}

.stat-card {
  background: linear-gradient(135deg, #8B0000, #A50000) !important;
  color: white !important;
  padding: 20px 15px !important;
  border-radius: 12px !important;
  text-align: center !important;
  box-shadow: 0 4px 15px rgba(139, 0, 0, 0.2) !important;
  transition: transform 0.2s;
  display: block !important;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-icon {
  font-size: 2rem !important;
  margin-bottom: 5px !important;
  display: block !important;
}

.stat-value {
  font-size: 2rem !important;
  font-weight: bold !important;
  line-height: 1 !important;
  display: block !important;
  color: white !important;
}

.stat-label {
  font-size: 0.85rem !important;
  opacity: 0.9 !important;
  margin-top: 5px !important;
  display: block !important;
  color: white !important;
}

.stats-options {
  margin-top: 25px !important;
  padding: 20px !important;
  background: #fafafa !important;
  border-radius: 12px !important;
  border: 1px solid #eee !important;
  display: block !important;
}

.stats-options h3 {
  color: #8B0000 !important;
  margin-bottom: 15px !important;
  border-bottom: 2px solid #8B0000 !important;
  padding-bottom: 8px !important;
  margin-top: 0 !important;
  font-size: 1.05rem !important;
  display: block !important;
}

.stat-bar-container {
  margin-bottom: 12px !important;
  display: block !important;
}

.stat-bar-label {
  display: flex !important;
  justify-content: space-between !important;
  margin-bottom: 5px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: #333 !important;
}

.stat-bar {
  height: 22px !important;
  background: #eee !important;
  border-radius: 11px !important;
  overflow: hidden !important;
  display: block !important;
  width: 100% !important;
}

.stat-bar-fill {
  height: 100% !important;
  background: linear-gradient(90deg, #8B0000, #c62828) !important;
  color: white !important;
  padding: 0 10px !important;
  font-size: 0.8rem !important;
  font-weight: bold !important;
  display: flex !important;
  align-items: center !important;
  border-radius: 11px !important;
  transition: width 0.5s ease;
  min-width: 30px !important;
  box-sizing: border-box !important;
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .stat-value { font-size: 1.5rem !important; }
  .stat-icon { font-size: 1.5rem !important; }
}
