/* CSS Spécifique au simulateur Chronophotographies (Mouvement Système) */
/* Les classes globales et le thème sont dans _SharedResources/theme_global.css */

#canvas_container_1:fullscreen { background-color: var(--bg-main) !important; }
#canvas_container_1:-webkit-full-screen { background-color: var(--bg-main) !important; }
#canvas_container_1:-ms-fullscreen { background-color: var(--bg-main) !important; }

#bottom_info_bar { display: flex; justify-content: space-around; align-items: center; padding: 10px; background: var(--param-box); border-top: 1px solid var(--border-gold); flex-shrink: 0; font-size: 0.95rem; flex-wrap: wrap; gap: 10px; }
#info_tau { font-family: 'Courier New', Courier, monospace; font-size: 1.1em; }



.controls-main-container { display: flex; flex-wrap: wrap; gap: 15px; flex-grow: 1; align-items: stretch; }
.control-main-group { flex: 1; min-width: 250px; display: flex; flex-direction: column; gap: 10px; background-color: var(--param-box); padding: 15px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); }
.main-group-title { font-size: 1.1rem; color: var(--text-highlight); text-align: center; margin: 0 0 10px 0; border-bottom: 1px solid var(--border-gold); padding-bottom: 8px; font-weight: 600; }

@media screen and (max-width: 724px) {
    body { overflow-y: auto; min-height: 100vh; }
    #banner { flex-direction: column; text-align: center; padding: 15px; }
    .banner-right { justify-content: center; width: 100%; margin-top: 5px; } 
    .banner-left { align-items: center; text-align: center; width: 100%; } 
    .modes-container { width: 100%; margin-top: 5px; text-shadow: none; font-size: 0.9em; }
    
    .mobile-tabs-header { display: flex; width: 100%; margin-bottom: 10px; }
    .mobile-tab-btn { flex: 1; padding: 10px; background: var(--panel-bg-2); color: var(--text-muted); border: 1px solid var(--border-gold); font-weight: bold; cursor: pointer; text-align: center; }
    .mobile-tab-btn.active { background: var(--border-gold); filter: brightness(1.2); color: #fff; border-bottom: none; }
    .mobile-tab-content { display: none !important; width: 100%; }
    #simView.active { display: flex !important; flex-direction: column; }
    #settingsView.active { display: block !important; }

    #conteneur_simulation { display: flex; flex-direction: column; padding: 10px; gap: 10px; }
    #fenetre2 { order: 1; margin-bottom: 5px; min-height: 350px; } 
    #fenetre_controles { flex-direction: column; order: 2; } 
    #fenetre1 { order: 3; }
}

@media screen and (min-width: 725px) and (max-width: 1024px) {
    body { overflow: hidden; height: 100vh; }
    .mobile-tabs-header { display: none !important; }
    .mobile-tab-content { display: contents !important; }
    
    #conteneur_simulation { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; column-gap: 15px; row-gap: 15px; height: calc(100vh - 140px); padding: 15px; }
    #fenetre2 { grid-column: 1 / 2; grid-row: 1 / 2; display: flex; flex-direction: column; overflow: hidden; } 
    #fenetre_controles { grid-column: 1 / 2; grid-row: 2 / 3; }
    #fenetre1 { grid-column: 2 / 3; grid-row: 1 / 3; overflow-y: auto; } 
    .fenetre-contenu { overflow-y: auto; } 
    #fenetre1 .fenetre-contenu { overflow-y: visible !important; flex-grow: 0 !important; height: auto !important; }
}

@media screen and (min-width: 1025px) {
    body { overflow: hidden; height: 100vh; } 
    .mobile-tabs-header { display: none !important; }
    .mobile-tab-content { display: contents !important; }
    
    #conteneur_simulation { display: grid; grid-template-columns: 1.2fr 1fr; grid-template-rows: 1fr auto; column-gap: 20px; row-gap: 15px; height: calc(100vh - 140px); padding: 15px; }
    #fenetre2 { grid-column: 1 / 2; grid-row: 1 / 2; display: flex; flex-direction: column; overflow: hidden; } 
    #fenetre_controles { grid-column: 1 / 2; grid-row: 2 / 3; overflow: hidden; }
    #fenetre1 { grid-column: 2 / 3; grid-row: 1 / 3; overflow-y: auto; } 
    .fenetre-contenu { overflow-y: auto; overflow-x: hidden; } 
    #fenetre1 .fenetre-contenu { overflow-y: visible !important; flex-grow: 0 !important; height: auto !important; }
}

body.maximized-active { overflow: hidden !important; }

#fenetre2.maximized {
    position: fixed !important; top: 0; left: 0; width: 100vw !important; height: 100vh !important;
    z-index: 9999; margin: 0 !important; border-radius: 0 !important; border: none !important;
    background-color: var(--bg-main) !important;
}
#fenetre2.maximized #conditions_initiales_wrapper { display: none !important; }

.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(3px); }
.modal-content { background-color: var(--panel-bg-1); margin: 10% auto; padding: 25px; border: 1px solid var(--border-gold); border-radius: 12px; width: 90%; max-width: 600px; color: var(--text-main); box-shadow: 0 10px 30px rgba(0,0,0,0.8); position: relative; line-height: 1.5; }
.modal-content ul { margin-top: 5px; padding-left: 20px; }
.modal-content li { margin-bottom: 8px; }
.close-btn { color: var(--text-muted); position: absolute; right: 20px; top: 15px; font-size: 28px; font-weight: bold; cursor: pointer; line-height: 1; transition: color 0.2s; }
.close-btn:hover, .close-btn:focus { color: #e74c3c; text-decoration: none; }
.modal-title { color: var(--text-highlight); font-size: 1.3rem; border-bottom: 1px solid var(--border-gold); padding-bottom: 10px; margin-top: 0; margin-right: 30px; }

@media print {
    @page { size: A4 landscape; margin: 5mm; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    #banner, .mobile-tabs-header, #fenetre1, #fenetre_controles, #conditions_initiales_wrapper, #btn_fullscreen, .modal { display: none !important; }
    body, html { width: 100%; height: 100%; margin: 0; padding: 0; background: white !important; overflow: hidden !important; }
    #conteneur_simulation { display: block !important; padding: 0 !important; margin: 0 !important; height: 100% !important; }
    #simView { display: block !important; height: 100% !important; }
    #fenetre2 { position: absolute; left: 0; top: 0; width: 100vw; height: 98vh; display: flex; flex-direction: column; background: white !important; padding: 0 !important; margin: 0 !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; }
    .fenetre_titre_wrapper { display: flex !important; color: black !important; border-bottom: 2px solid black !important; padding: 10px 15px !important; margin: 0 !important; }
    .fenetre_titre { color: black !important; font-size: 1.4rem !important; font-weight: 600; text-align: left !important; }
    #canvas_container_1 { flex-grow: 1; display: flex; justify-content: center; align-items: center; width: 100%; height: auto; background: white !important; padding: 10px; }
    #canvas_container_1 canvas { width: 100% !important; height: 100% !important; object-fit: contain !important; }
    body:not(.light-mode) canvas { filter: invert(1) hue-rotate(180deg) contrast(120%); }
    #print_scale_section { display: flex !important; }
    #bottom_info_bar { display: flex !important; justify-content: space-between !important; align-items: center; width: 100%; padding: 10px 20px !important; border-top: 2px solid black !important; background: white !important; color: black !important; font-size: 14pt !important; margin: 0 !important; }
}
