/* ========================================================= */
/* 1. BASE & MOBILE FIRST (Toutes tailles d'écran) */
/* ========================================================= */

:root {
    /* Couleurs inspirées du style Prosilver */
    --color-primary: #B00015; /* Bleu standard phpBB pour les liens/accents */
    --color-primary-hover: #0056b3; 
    --color-background: #BF0118; /* Fond gris très clair */
    --color-card-bg: #ffffff; /* Fond blanc pour les cartes/conteneurs */
    --color-border: #dee2e6; /* Gris clair pour les bordures */
    --color-text: #333333; /* Texte foncé */
    --color-success: #28a745; /* Vert pour compatible */
    --color-error: #dc3545; /* Rouge pour non compatible */
    --color-warning: #ffc107; /* Jaune pour mitigé */
}

/* Base de la mise en page */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    padding: 10px; /* Petit padding sur mobile */
}

/* Conteneur principal - Centré sur desktop, plein sur mobile */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Entête */
header {
    text-align: center;
    padding: 15px 0;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.8em; /* Plus petit sur mobile */
    color: #fff;
    margin-bottom: 5px;
}

header p {
    font-size: 0.9em;
    color: #fff;
}

/* Messages de statut (Succès/Erreur/Avertissement) */
.message {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: bold;
    border: 1px solid transparent;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Cartes de contenu (Formulaire et Tableau) */
.form-card, .table-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 15px; /* Padding ajusté pour mobile */
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.form-card h2, .table-card h2 {
    font-size: 1.3em;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* FORMULAIRE */
.ssd-form .form-group {
    margin-bottom: 15px;
}

.ssd-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.95em;
}

.ssd-form input[type="url"],
.ssd-form input[type="text"],
.ssd-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1em;
    background-color: #f8f8f8;
}

.ssd-form textarea {
    resize: vertical;
    min-height: 80px;
}

.form-inline {
    display: flex;
    flex-direction: column; /* Toujours en colonne sur mobile */
}

.form-radio .radio-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin-bottom: 5px;
}

.form-radio input[type="radio"] {
    margin-right: 8px;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: var(--color-primary-hover);
}

.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 10px;
    border-radius: 4px;
    color: #856404;
    font-size: 0.9em;
}

/* TABLEAU DE SYNTHÈSE */
.table-responsive {
    overflow-x: auto; /* Permet le défilement horizontal du tableau sur mobile */
}

.ssd-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Assure que le tableau ne soit pas trop étroit sur mobile */
    font-size: 0.9em;
}

.ssd-table th, .ssd-table td {
    padding: 10px;
    border: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

.ssd-table thead th {
    background-color: #e9ecef; /* Tête de tableau gris clair */
    font-weight: bold;
    color: var(--color-text);
}

/* Couleurs des lignes de statut */
.ssd-table tr.compatible {
    background-color: #e6ffed; /* Fond très léger de succès */
}

.ssd-table tr.incompatible {
    background-color: #ffe6e6; /* Fond très léger d'erreur */
}

.ssd-table tr.mitigated {
    background-color: #fff9e6; /* Fond très léger d'avertissement */
}

.status-icon {
    font-size: 1.2em;
    margin-right: 5px;
}

.status-text {
    font-weight: bold;
}

.asin-badge {
    display: block;
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 3px;
}

.test-oui { color: var(--color-success); font-weight: bold; }
.test-non { color: var(--color-error); font-weight: bold; }
.test-total { font-size: 0.8em; color: #666; }

.btn-details {
    display: inline-block;
    cursor: pointer;
    color: var(--color-primary);
    text-decoration: underline;
    font-size: 0.9em;
}

.btn-amazon {
    display: inline-block;
    padding: 5px 10px;
    background-color: #ff9900; /* Orange Amazon */
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.btn-amazon:hover {
    background-color: #e68a00;
}

/* ========================================================= */
/* MODALE (FENÊTRE POP-UP) */
/* ========================================================= */

.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.4); 
    padding-top: 50px;
}

.modal-content {
    background-color: var(--color-card-bg);
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%; 
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#modalTitle {
    font-size: 1.4em;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #333;
    text-decoration: none;
}

.comment-entry {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
}

.comment-meta {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

.comment-text {
    font-style: italic;
    font-size: 0.95em;
}

.modal-note {
    font-size: 0.8em;
    color: #999;
    text-align: center;
    margin-top: 15px;
}


/* ========================================================= */
/* 2. RESPONSIVE / TABLETTE ET DESKTOP (à partir de 768px) */
/* ========================================================= */
@media (min-width: 768px) {
    
    body {
        padding: 20px;
    }

    .form-card, .table-card {
        padding: 30px;
    }

    /* Formulaire en ligne pour Marque/Modèle */
    .form-group.form-inline {
        display: flex;
        gap: 20px;
    }
    
    .form-group.form-inline > * {
        flex: 1;
    }

    .form-group.form-inline label {
        flex-shrink: 0;
    }

    .btn-submit {
        width: auto; /* Bouton pas plein écran */
        padding: 10px 25px;
        margin-top: 10px;
    }

    /* Tableau - Meilleure apparence sur desktop */
    .ssd-table {
        min-width: 100%;
        font-size: 1em;
    }
}