/* ============================================
   PARAMETRES.CSS - VERSION SIMPLIFIÉE & NETTOYÉE
   Interface paramètres + Mode économique
   ============================================ */

/* =============================================
   PARTIE 1 : INTERFACE LIGHTBOX PARAMÈTRES
   ============================================= */

/* Container principal */
.param_container {
    width: 98%;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* Header */
.param_header {
    padding: 25px 35px;
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.param_header h2 {
    margin: 0 0 8px 0;
    font-size: 26px;
    font-weight: 700;
    color: #333;
}

.param_subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Body */
.param_body {
    padding: 35px;
    overflow-y: auto;
    flex: 1;
}

/* Grille 3 colonnes */
.param_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Sections */
.param_section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    margin-bottom: 25px;
}

.param_section h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #007bff;
    color: #333;
}

/* Items */
.param_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    gap: 20px;
}

.param_item label {
    font-size: 15px;
    color: #555;
    font-weight: 500;
}

/* Select */
.param_select {
    padding: 9px 32px 9px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    min-width: 170px;
    appearance: none;
    background-image: url('/images/select-arrow-light.svg');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
    transition: all 0.2s ease;
}

.param_select:hover {
    border-color: #999;
}

.param_select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.4);  /* 40% au lieu de 10% */
}

/* Cartes de mode */
.param_modes {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.param_mode_card {
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: block;
    background: white;
}

.param_mode_card:hover {
    border-color: #007bff;
    background: #f0f8ff;
    transform: translateX(3px);
}

.param_mode_card.active {
    border-color: #007bff;
    background: #e7f3ff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.param_mode_card input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.param_mode_content {
    display: flex;
    gap: 15px;
    align-items: center;
}

.param_mode_icon {
    font-size: 36px;
    flex-shrink: 0;
}

.param_mode_info {
    flex: 1;
}

.param_mode_title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.param_mode_desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Info box */
.param_info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 13px;
    color: #856404;
    margin-top: 15px;
    line-height: 1.5;
}

/* Placeholder colonne vide */
.param_placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    opacity: 0.5;
    min-height: 200px;
}

.param_placeholder_icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.param_placeholder_text {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* Footer */
.param_footer {
    padding: 20px 35px;
    border-top: 2px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.param_btn_save,
.param_btn_reset {
    padding: 13px 28px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.param_btn_save {
    background: #007bff;
    color: white;
}

.param_btn_save:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.param_btn_reset {
    background: #6c757d;
    color: white;
}

.param_btn_reset:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* =============================================
   PARTIE 2 : MODE ÉCONOMIQUE
   ============================================= */

/* Masquer les images en mode éco (avec toutes les exceptions) */
body[data-mode="eco"] img:not(.carousel img):not([class*="slide"]):not([class*="slider"]):not(.mode_img_loaded):not(.no-eco img):not(.no-eco *) {
    display: none !important;
}

/* Carousel toujours visible */
body[data-mode="eco"] .carousel img {
    display: block !important;
}

/* Image chargée via bouton */
body[data-mode="eco"] img.mode_img_loaded {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Placeholder d'image */
.mode_img_placeholder {
    display: none;
}

body[data-mode="eco"] .mode_img_placeholder {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    position: relative;
    z-index: 2;
    margin-top: 5px;
}

.mode_img_placeholder_icon {
    font-size: 20px;
    opacity: 0.6;
}

.mode_img_placeholder_text {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.mode_img_load_btn {
    padding: 6px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mode_img_load_btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Placeholder pour backgrounds */
.mode_bg_placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 245, 245, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
    z-index: 1;
}

.mode_bg_placeholder:hover {
    background: rgba(240, 240, 240, 1);
}

.mode_bg_placeholder_content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    pointer-events: none;
}

.mode_bg_placeholder_icon {
    font-size: 48px;
    opacity: 0.6;
}

.mode_bg_placeholder_text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    line-height: 1.4;
}

/* Liens avec images traitées */
body[data-mode="eco"] a:has(img.mode_img_processed) {
    position: relative;
    z-index: 1;
}

body[data-mode="eco"] a {
    position: relative;
    z-index: 2;
}

body[data-mode="eco"] a img.mode_img_processed {
    pointer-events: none;
}

/* =============================================
   PARTIE 3 : EXCEPTIONS MODE ÉCO
   ============================================= */

/* Conteneur .no-eco : Images TOUJOURS visibles */
.no-eco img,
.no-eco img[data-eco-id],
body[data-mode="eco"] .no-eco img {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
}

/* Aucun placeholder dans .no-eco */
.no-eco .mode_img_placeholder,
body[data-mode="eco"] .no-eco .mode_img_placeholder {
    display: none !important;
}

/* =============================================
   PARTIE 4 : RESPONSIVE
   ============================================= */

@media (max-width: 1024px) {
    .param_grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .param_section {
        min-height: auto;
    }
}

@media (max-width: 639px) {
    .param_container {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .param_header,
    .param_body,
    .param_footer {
        padding: 20px;
    }
    
    .param_item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    
    .param_footer {
        flex-direction: column;
    }
    
    .param_btn_save,
    .param_btn_reset {
        width: 100%;
    }
}

/* =============================================
   PARTIE 5 : DARK MODE
   ============================================= */

/* Lightbox paramètres */
body.dark-mode .param_container {
    background: #2a2a2a;
}

body.dark-mode .param_header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-color: #444;
}

body.dark-mode .param_header h2 {
    color: #e0e0e0;
}

body.dark-mode .param_subtitle {
    color: #999;
}

body.dark-mode .param_section {
    background: #1a1a1a;
    border-color: #444;
}

body.dark-mode .param_section h3 {
    color: #e0e0e0;
    border-color: #4da3ff;
}

body.dark-mode .param_item label {
    color: #ccc;
}

body.dark-mode .param_select {
    background-color: #333;
    color: #e0e0e0;
    border-color: #555;
    background-image: url('/images/select-arrow-dark.svg');
}

body.dark-mode .param_mode_card {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode .param_mode_card:hover {
    border-color: #4da3ff;
    background: #2a3a4a;
}

body.dark-mode .param_mode_card.active {
    border-color: #4da3ff;
    background: #1a3a5a;
}

body.dark-mode .param_mode_title {
    color: #e0e0e0;
}

body.dark-mode .param_mode_desc {
    color: #aaa;
}

body.dark-mode .param_info {
    background: #3a3520;
    border-color: #6c5d1e;
    color: #d4c894;
}

body.dark-mode .param_footer {
    background: #1a1a1a;
    border-color: #444;
}

/* Mode économique en dark */
body.dark-mode[data-mode="eco"] .mode_img_placeholder {
    background: #2a2a2a;
    border-color: #555;
}

body.dark-mode[data-mode="eco"] .mode_img_placeholder_text {
    color: #ccc;
}

body.dark-mode .mode_bg_placeholder {
    background: rgba(42, 42, 42, 0.98);
}

body.dark-mode .mode_bg_placeholder:hover {
    background: rgba(50, 50, 50, 1);
}

body.dark-mode .mode_bg_placeholder_text {
    color: #ccc;
}