/* ============================================
   SURCHARGE SPÉCIFIQUE POUR LE THÈME SOMBRE
   Appliqué uniquement sur l'espace /members/
   ============================================ */

/* Page register - formulaire avec texte clair */
.registration-wrapper {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%) !important;
}

/* Bloc du formulaire - fond sombre */
.registration-right {
    background: var(--bg-primary) !important;
}

/* Labels et textes du formulaire */
.form-label-enhanced {
    color: #e2e8f0 !important;
}

.label-icon {
    color: #cbd5e0 !important;
}

/* Inputs */
.form-input-enhanced {
    background: var(--bg-secondary) !important;
    color: #e2e8f0 !important;
    border-color: var(--border-dark) !important;
}

.form-input-enhanced::placeholder {
    color: #a0aec0 !important;
}

/* Hints et aides */
.input-hint {
    color: #cbd5e0 !important;
}

/* Security badges */
.security-badges {
    background: var(--bg-secondary) !important;
    border-color: var(--border-dark) !important;
}

.security-badge i {
    color: #cbd5e0 !important;
}

.security-badge-text {
    color: #e2e8f0 !important;
}

/* Erreurs de formulaire */
.form-error {
    color: #fc8181 !important;
}

/* Boutons auth-actions */
.auth-actions-group a {
    color: #e2e8f0 !important;
}

/* Login page - auth card */
.auth-card {
    background: var(--bg-primary) !important;
}

.auth-body {
    background: var(--bg-primary) !important;
}

.form-label {
    color: #e2e8f0 !important;
}

.form-input,
.form-control {
    background: var(--bg-secondary) !important;
    color: #e2e8f0 !important;
    border-color: var(--border-dark) !important;
}

.form-input::placeholder,
.form-control::placeholder {
    color: #a0aec0 !important;
}

.auth-footer {
    background: var(--bg-secondary) !important;
}

.auth-footer-text {
    color: #cbd5e0 !important;
}

/* Textes de la privacy notice */
.privacy-notice {
    color: #e2e8f0 !important;
}

.privacy-title {
    color: #f7fafc !important;
}

.privacy-text {
    color: #cbd5e0 !important;
}

.privacy-warning {
    color: #e2e8f0 !important;
}

/* Checkbox */
.checkbox-text {
    color: #cbd5e0 !important;
}

/* ============================================
   COMPOSANTS GÉNÉRIQUES — fond blanc hardcodé
   ============================================ */

/* Modales */
.modal-content,
.modal-body,
.modal-dialog .modal-content {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

.modal-header,
.modal-footer {
    background: var(--bg-primary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.modal-title {
    color: var(--text-primary) !important;
}

.modal-close,
.btn-close {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    border: none !important;
    opacity: 1 !important;
}

.modal-close:hover,
.btn-close:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* Cartes génériques */
.card,
.item-card,
.result-card,
.content-card {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Sections à fond blanc */
.filters-section,
.empty-state,
.items-table,
.white-section,
.panel,
.panel-body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Textes secondaires/muets hardcodés */
.item-detail,
.item-description,
.text-muted-custom,
.empty-state h3,
.empty-state p {
    color: var(--text-secondary) !important;
}

/* Inputs, selects et textareas dans tous les contextes */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
textarea,
select,
.form-control,
.filter-select,
.search-box input {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted) !important;
}

/* Labels de formulaire */
label,
.form-label,
.control-label {
    color: var(--text-primary) !important;
}

/* Tableaux */
.styled-table td,
table td,
table th {
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

table tbody tr:hover {
    background: var(--bg-secondary) !important;
}

/* Boutons d'icônes dans les cartes */
.btn-edit {
    background: var(--bg-secondary) !important;
    color: var(--accent-light) !important;
}

.btn-delete {
    background: rgba(245, 101, 101, 0.15) !important;
    color: #fc8181 !important;
}

/* Badges de priorité : fond pastel → adapter pour le thème sombre */
.priority-badge.urgent {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fc8181 !important;
}

.priority-badge.ne-pas-oublier {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
}

.priority-badge.a-loccasion {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
}

.priority-badge.encore-en-stock {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #6ee7b7 !important;
}

/* View toggle buttons */
.view-btn {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.view-btn:hover:not(.active) {
    background: var(--bg-tertiary) !important;
}

/* ============================================
   FORMULAIRES GÉNÉRIQUES (weapon/form, etc.)
   ============================================ */

.form-container {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

.section-title {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.form-help,
small.form-help,
.form-text {
    color: var(--text-secondary) !important;
}

.current-photo {
    background-color: var(--bg-secondary) !important;
}

.photo-caption {
    color: var(--text-secondary) !important;
}

.form-actions {
    border-color: var(--border-color) !important;
}

.btn-secondary {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Conteneurs génériques à fond blanc */
.content-card,
.white-box,
.box,
.panel,
.panel-body,
.card-body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Textes génériques hardcodés */
.text-dark,
.text-body {
    color: var(--text-primary) !important;
}

.text-secondary,
.text-muted {
    color: var(--text-secondary) !important;
}

/* Séparateurs */
hr {
    border-color: var(--border-color) !important;
}

/* ============================================
   SESSIONS / BLOCS / EXPORTS (pattern répétitif)
   ============================================ */

/* Conteneurs principaux avec fond blanc hardcodé */
.form-container,
.session-container,
.block-container,
.export-container,
.photo-container,
.actions-and-form-container,
.content-main,
.list-container,
.profil-container,
.visibilite-container,
.recipe-container,
.pas-de-tir-container {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Fonds secondaires (hover, alternance) */
.actions-and-form-container,
.placeholder-image,
table th,
thead th {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Titres dans les conteneurs de formulaires/cartes */
.form-container h1, .form-container h2, .form-container h3,
.card h1, .card h2, .card h3,
.item-card h1, .item-card h2, .item-card h3,
.content-card h1, .content-card h2, .content-card h3,
.modal-content h1, .modal-content h2, .modal-content h3 {
    color: var(--text-primary) !important;
}

/* Surcharge explicite des couleurs foncées hardcodées en style inline */
[style*="color: #1a1a1a"],
[style*="color: #1f2937"],
[style*="color: #374151"],
[style*="color: #333"],
[style*="color: #000"] {
    color: var(--text-primary) !important;
}

[style*="color: #6b7280"],
[style*="color: #9ca3af"],
[style*="color: #6c757d"],
[style*="color: #555"] {
    color: var(--text-secondary) !important;
}

[style*="background-color: #fff"],
[style*="background-color: white"],
[style*="background: white"],
[style*="background: #fff"] {
    background-color: var(--bg-primary) !important;
}

[style*="background-color: #f9fafb"],
[style*="background-color: #f8f9fa"],
[style*="background-color: #f1f5f9"],
[style*="background: #f9fafb"] {
    background-color: var(--bg-secondary) !important;
}

[style*="border: 1px solid #e9ecef"],
[style*="border-right: 1px solid #e9ecef"],
[style*="border: 1px solid #e5e7eb"] {
    border-color: var(--border-color) !important;
}

/* ============================================
   FILS D'ACTUALITÉ / POSTS / COMMENTAIRES
   ============================================ */

.post-interactions {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

.comment-author {
    color: var(--text-primary) !important;
}

.comment-date {
    color: var(--text-secondary) !important;
}

.comment-form .form-control {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* ============================================
   OUTILS BALISTIQUES (5 templates similaires)
   ============================================ */

/* Les pages outils utilisent h2, label, th avec des couleurs hardcodées */
.tool-page h2 {
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color) !important;
}

.tool-page label {
    color: var(--text-primary) !important;
}

.tool-page th {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.tool-page .info {
    color: var(--text-secondary) !important;
    border-top-color: var(--border-color) !important;
}

/* ============================================
   NEWS / MODAL D'ARTICLES
   ============================================ */

#modal-title {
    color: var(--text-primary) !important;
}

#modal-date {
    color: var(--text-secondary) !important;
    border-bottom-color: var(--border-color) !important;
}

#modal-body {
    color: var(--text-primary) !important;
}

.news-block-date {
    color: var(--text-secondary) !important;
}

.news-block-title {
    color: var(--text-primary) !important;
}

/* ============================================
   PETITES ANNONCES / SEARCH
   ============================================ */

.card-title {
    color: var(--text-primary) !important;
}

/* ============================================
   PROFIL / CONNEXIONS
   ============================================ */

/* Bootstrap .table écrase les couleurs via ses propres CSS variables */
.table {
    --bs-table-color: var(--text-primary) !important;
    --bs-table-bg: transparent !important;
    --bs-table-border-color: var(--border-color) !important;
    --bs-table-striped-color: var(--text-primary) !important;
    --bs-table-striped-bg: var(--bg-secondary) !important;
    --bs-table-hover-color: var(--text-primary) !important;
    --bs-table-hover-bg: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.details-table th {
    background-color: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
}

.details-table td {
    color: var(--text-primary) !important;
    background-color: transparent !important;
}

.comment-box {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* ============================================
   NOTIFICATIONS / TOGGLES
   ============================================ */

.slider {
    background-color: var(--bg-secondary) !important;
}

.slider:before {
    background-color: var(--text-muted) !important;
}

/* Tool cards - style sombre */
.tool-card {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-dark) !important;
    color: #e2e8f0 !important;
}

.tool-card:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--primary-light) !important;
}

.tool-card h3,
.tool-card .card-title {
    color: #f7fafc !important;
}

.tool-card p,
.tool-card .card-description {
    color: #cbd5e0 !important;
}

.tool-card i,
.tool-card .card-icon {
    color: var(--accent-light) !important;
}

.tool-card .card-info p {
    color: #a0aec0 !important;
}
