/* Style interface écran de téléphone pour VC2 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f0f0;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Container principal - simulation écran téléphone */
.phone-container {
    width: 375px;
    height: 667px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid #e0e0e0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header de l'interface pour pages carrefour - fixe */
.app-header {
    background: #fff;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #f0f0f0;
    min-height: 80px;
    flex-shrink: 0;
    z-index: 100;
}

.app-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-logo {
    height: 25px;
    width: auto;
}

.page-title {
    font-size: 16px;
    font-weight: bold;
    color: #1a1a1a;
}

.app-header-center {
    text-align: center;
    font-size: 14px;
    color: #333;
    line-height: 1.3;
}

.dossier-info {
    font-weight: bold;
    color: #007AFF;
}

.date-info {
    color: #666;
    font-size: 13px;
}

.intervenant-info {
    color: #888;
    font-size: 12px;
    margin-top: 2px;
}

.info-button {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #007AFF;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.info-button:hover {
    background: #0056CC;
}

/* Contenu principal - scrollable */
.app-main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Footer transformé en toolbar mobile - dans le container */
.app-footer {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 1px solid #e9ecef;
    padding: 12px 8px 8px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 100;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.toolbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 9px;
    padding: 4px 2px;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 60px;
    min-height: 48px;
    position: relative;
    flex: 1;
    max-width: 75px;
}

.toolbar-item:hover {
    background: rgba(0, 122, 255, 0.1);
    color: #007AFF;
    transform: translateY(-2px);
}

.toolbar-item.active {
    background: #007AFF;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.toolbar-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.toolbar-item:hover .toolbar-icon,
.toolbar-item.active .toolbar-icon {
    opacity: 1;
    transform: scale(1.1);
}

.toolbar-item.active .toolbar-icon {
    filter: brightness(0) invert(1);
}

.toolbar-text {
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
    letter-spacing: -0.1px;
}

/* Animation pour les icônes SVG */
.toolbar-icon svg {
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

.toolbar-item:hover .toolbar-icon svg path,
.toolbar-item:hover .toolbar-icon svg circle {
    stroke: #007AFF;
}

.toolbar-item.active .toolbar-icon svg path,
.toolbar-item.active .toolbar-icon svg circle {
    stroke: white;
}

/* Navigation cachée par défaut */
.navbar {
    display: none;
}

/* Styles pour le contenu */
h1 {
    color: #1a1a1a;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    background: #f8f9fa;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #007AFF;
}

li b {
    color: #007AFF;
    display: block;
    margin-bottom: 5px;
}

/* Zone de dialogue avec boutons centrés */
.dialogue-zone {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px auto;
    min-height: 200px;
    align-items: center;
    width: 100%;
    max-width: 320px;
    padding: 0 20px;
    box-sizing: border-box;
}

.dialogue-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    background: #007AFF;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
    transition: all 0.3s ease;
    min-height: 56px;
    width: 100%;
    max-width: 280px; /* Limite la largeur pour un meilleur aspect */
    text-align: center;
}

.dialogue-button:hover {
    background: #0056CC;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.dialogue-button.secondary {
    background: #6c757d;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.dialogue-button.secondary:hover {
    background: #5a6268;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.dialogue-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    flex-shrink: 0;
}

.welcome-text {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.user-status {
    background: #e8f5e8;
    padding: 10px 15px;
    border-radius: 8px;
    color: #2e7d2e;
    font-size: 13px;
    margin-bottom: 15px;
    text-align: center;
}

/* Styles pour l'historique */
.historique-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #007AFF;
}

.historique-date {
    font-weight: bold;
    color: #007AFF;
    font-size: 14px;
    margin-bottom: 5px;
}

.historique-action {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.historique-details {
    font-size: 13px;
    color: #666;
}

/* Styles pour les alertes */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Amélioration des styles pour les boutons de soumission */
button.dialogue-button {
    background: #007AFF;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

button.dialogue-button:hover {
    background: #0056CC;
    transform: translateY(-1px);
}

/* Styles pour les champs de formulaire spécialisés */
input[type="date"], 
input[type="email"], 
select, 
textarea {
    font-family: inherit;
    font-size: 16px;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

/* === STYLES FORMULAIRES === */
.form-moderne {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #007AFF;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* === CENTRAGE AMÉLIORÉ === */
.dialogue-zone {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px auto;
    min-height: 200px;
    align-items: center;
    width: 100%;
    max-width: 320px;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Assurer que tous les boutons soient centrés */
.dialogue-button {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    text-align: center;
}

/* Pour les pages avec plusieurs boutons */
.dialogue-zone .dialogue-button + .dialogue-button {
    margin-top: 0; /* Le gap s'en charge */
}

/* Responsive pour la toolbar mobile */
@media (max-width: 480px) {
    .toolbar-item {
        min-width: 55px;
        min-height: 44px;
        font-size: 8px;
        padding: 3px 1px;
    }
    
    .toolbar-icon {
        width: 18px;
        height: 18px;
        margin-bottom: 2px;
    }
    
    .toolbar-text {
        line-height: 1;
        font-size: 8px;
    }
}

/* Amélioration pour les écrans plus grands */
@media (min-width: 421px) {
    .phone-container {
        width: 420px;
        height: 720px;
    }
}

/* Debug pour navigation */
.dialogue-zone {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
    min-height: 200px; /* S'assurer qu'il y a de l'espace */
}

/* Debug visuel pour voir si le conteneur est vide */
.dialogue-zone:empty::before {
    content: "Navigation en cours de chargement...";
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Transition douce pour éviter les clignotements */
.dialogue-button {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* === CENTRAGE RENFORCÉ === */

/* S'assurer que le contenu principal est centré */
.app-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Forcer le centrage de tous les éléments dans dialogue-zone */
.dialogue-zone {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin: 20px auto !important;
    width: 100% !important;
    max-width: 320px !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

/* Centrage des formulaires */
.dialogue-zone form {
    width: 100% !important;
    max-width: 280px !important;
    margin: 0 auto !important;
    text-align: left; /* Le texte dans les formulaires doit être aligné à gauche */
}

/* Centrage de tous les boutons */
.dialogue-button {
    width: 100% !important;
    max-width: 280px !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* Centrage des éléments avec style inline */
.dialogue-zone > div,
.dialogue-zone > p,
.dialogue-zone > h1,
.dialogue-zone > h2,
.dialogue-zone > h3 {
    text-align: center !important;
    width: 100% !important;
    max-width: 280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Centrage pour les conteneurs avec background */
.dialogue-zone > div[style*="background"] {
    max-width: 300px !important;
    margin: 15px auto !important;
}

/* S'assurer que welcome-text est centré */
.welcome-text {
    text-align: center !important;
    margin: 15px auto 25px auto !important;
    max-width: 300px !important;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* User status centré */
.user-status {
    text-align: center !important;
    margin: 10px auto 20px auto !important;
    max-width: 300px !important;
    color: #666;
    font-size: 14px;
}

/* Centrage des listes */
.dialogue-zone ul,
.dialogue-zone ol {
    max-width: 280px !important;
    margin: 15px auto !important;
    text-align: left;
}

/* Centrage des images et icônes */
.dialogue-zone img:not(.dialogue-icon) {
    display: block !important;
    margin: 15px auto !important;
}

/* === FORMULAIRES HARMONISÉS === */

/* Styles uniformes pour tous les inputs */
input[type="text"],
input[type="email"], 
input[type="number"],
input[type="password"],
input[type="tel"],
input[type="date"],
textarea,
select {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 15px !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-family: inherit !important;
    transition: all 0.3s ease !important;
    background: #f8f9fa !important;
    box-sizing: border-box !important;
    margin-bottom: 10px !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    outline: none !important;
    border-color: #007AFF !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1) !important;
}

/* Labels uniformes */
label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 14px !important;
    text-align: left !important;
}

/* Groupes de champs uniformes */
.dialogue-zone form > div {
    margin-bottom: 20px !important;
    text-align: left !important;
}

/* === STYLES SPÉCIFIQUES AUX PAGES === */

/* Container de formulaire pour suivi.php et autres */
.form-container {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.form-field {
    margin-bottom: 20px;
    text-align: left;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-sizing: border-box;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #007AFF;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Styles pour l'historique du suivi */
.historique-section {
    width: 100%;
    max-width: 320px;
    margin: 30px auto 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.historique-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.historique-item strong {
    color: #007AFF;
    font-weight: 600;
}

/* Centrage pour les alertes de message */
.alert-container {
    width: 100%;
    max-width: 300px;
    margin: 15px auto;
    text-align: center;
}

/* Styles pour objets_connectes.php */
.info-section {
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.info-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
    text-align: center;
}

/* Amélioration des listes d'historique */
.historique-list {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.historique-date {
    font-weight: 600;
    color: #007AFF;
    font-size: 14px;
}

.historique-action {
    font-weight: 500;
    margin: 5px 0;
    color: #333;
}

.historique-details {
    color: #666;
    font-size: 13px;
    font-style: italic;
}

/* Styles pour les bilans */
.bilan-content {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    text-align: left;
}

.bilan-content h2 {
    text-align: center;
    color: #007AFF;
    margin-bottom: 20px;
}

.bilan-content ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.bilan-content li {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
