/**
 * Styles pour l'éditeur d'articles
 */

#gau-generator-container {
    padding: 10px 0;
}

#gau-generator-container input[type="text"],
#gau-generator-container textarea,
#gau-generator-container select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

#gau-generator-container input[type="text"]:focus,
#gau-generator-container textarea:focus,
#gau-generator-container select:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

#gau-generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

#gau-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#gau-generate-btn:active {
    transform: translateY(0);
}

#gau-generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

#gau-progress {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#gau-result {
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gau-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
}

.gau-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
}

.gau-success strong,
.gau-error strong {
    display: block;
    margin-bottom: 5px;
}

/* Animation du spinner */
.spinner {
    background: url('../../../../../wp-admin/images/spinner.gif') no-repeat;
    background-size: 20px 20px;
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* Style pour la description */
.description {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Checkbox styling */
#gau-generator-container input[type="checkbox"] {
    margin-right: 6px;
}

/* Responsive */
@media screen and (max-width: 782px) {
    #gau-generate-btn {
        height: 40px;
        font-size: 13px;
    }
}

/* Modal pour le navigateur d'images */
.gau-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
}

.gau-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 100001;
    display: flex;
    flex-direction: column;
}

.gau-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gau-modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.gau-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
}

.gau-modal-close:hover {
    color: #000;
}

.gau-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.gau-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gau-image-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
}

.gau-image-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.gau-image-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: #f5f5f5;
}

.gau-image-info {
    padding: 12px;
}

.gau-image-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gau-image-source {
    font-size: 11px;
    color: #666;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gau-image-source a {
    color: #2271b1;
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gau-image-source a:hover {
    text-decoration: underline;
}

.gau-image-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.gau-image-actions button {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.gau-btn-featured {
    background: #2271b1;
    color: white;
}

.gau-btn-featured:hover {
    background: #135e96;
}

.gau-btn-insert {
    background: #50b83c;
    color: white;
}

.gau-btn-insert:hover {
    background: #3f9a2c;
}

.gau-image-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gau-source-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: #f0f0f1;
    color: #666;
}

.gau-source-badge.brand {
    background: #d4edda;
    color: #155724;
}

.gau-source-badge.amazon {
    background: #fff3cd;
    color: #856404;
}

.gau-source-badge.google {
    background: #d1ecf1;
    color: #0c5460;
}

/* Animation de fade in pour les images */
.gau-image-card {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Styles pour le sommaire des articles générés */
.gau-table-of-contents {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
}

.gau-table-of-contents h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.gau-table-of-contents ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.gau-table-of-contents li {
    margin-bottom: 8px;
    color: #555;
}

.gau-table-of-contents a {
    color: #2271b1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.gau-table-of-contents a:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Alignement du sommaire sur desktop */
@media screen and (min-width: 768px) {
    .gau-table-of-contents {
        float: right;
        width: 300px;
        margin-left: 30px;
        margin-bottom: 30px;
    }
    
    /* S'assurer que le contenu principal ne se chevauche pas */
    .entry-content:has(.gau-table-of-contents) {
        overflow: hidden;
    }
}

/* Fallback pour les navigateurs qui ne supportent pas :has() */
@media screen and (min-width: 768px) {
    .gau-table-of-contents {
        float: right;
        width: 300px;
        margin-left: 30px;
        margin-bottom: 30px;
    }
}

/* Styles pour les autres éléments générés */

/* Encadré rouge (points forts) - fond violet */
.gau-encadre-rouge {
    background: #6f42c1;
    border: 2px solid #6f42c1;
    color: #fff;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 500;
}

.gau-encadre-rouge strong {
    color: #fff;
    font-weight: 600;
}

.gau-encadre-rouge p {
    margin: 0;
    color: #fff;
}

.gau-encadre-rouge h4 {
    margin: 0 0 10px 0;
    color: #fff;
    font-weight: 600;
}

.gau-encadre-rouge ul {
    margin: 10px 0;
    padding-left: 20px;
    color: #fff;
}

.gau-encadre-rouge li {
    margin-bottom: 5px;
    color: #fff;
}

/* Encadré gris (prudence) - fond gris clair, texte gris foncé */
.gau-encadre-gris {
    background: #f8f9fa;
    border: 2px solid #6c757d;
    color: #333;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 500;
}

.gau-encadre-gris strong {
    color: #333;
    font-weight: 600;
}

.gau-encadre-gris p {
    margin: 0;
    color: #333;
}

.gau-encadre-gris h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-weight: 600;
}

.gau-encadre-gris ul {
    margin: 10px 0;
    padding-left: 20px;
    color: #333;
}

.gau-encadre-gris li {
    margin-bottom: 5px;
    color: #333;
}

/* Encadré comparatif express (cartouche orange) */
.gau-comparatif-express {
    background: transparent;
    border: 2px solid #ff6b35;
    color: #ff6b35;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 500;
}

.gau-comparatif-express strong {
    color: #ff6b35;
    font-weight: 600;
}

.gau-comparatif-express p {
    margin: 8px 0 0 0;
    color: #ff6b35;
    line-height: 1.5;
}

.gau-comparatif-express h4 {
    color: #ff6b35;
    margin: 10px 0 5px 0;
    font-size: 15px;
    font-weight: 600;
}

.gau-comparatif-express ul {
    margin: 8px 0;
    padding-left: 20px;
}

.gau-comparatif-express li {
    margin-bottom: 5px;
    color: #ff6b35;
}

/* Responsive pour tous les encadrés */
@media screen and (max-width: 768px) {
    .gau-encadre-rouge,
    .gau-encadre-gris,
    .gau-comparatif-express {
        padding: 12px;
        font-size: 14px;
    }
    
}

@media screen and (max-width: 480px) {
    .gau-encadre-rouge,
    .gau-encadre-gris,
    .gau-comparatif-express {
        padding: 10px;
        font-size: 13px;
    }
    
}

/* Champ de recherche personnalisé dans la modal */
#gau-search-form {
    border: 1px solid #ddd;
    background: #f8f9fa !important;
    border-radius: 6px;
    margin-bottom: 20px;
    padding: 15px;
}

#gau-search-form h3 {
    margin: 0 0 10px 0 !important;
    font-size: 14px !important;
    color: #333 !important;
    font-weight: 600;
}

#gau-custom-search-term {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    flex: 1;
    background: white;
}

#gau-custom-search-term:focus {
    border-color: #2271b1 !important;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

#gau-search-submit-btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
    background: #2271b1 !important;
    border-color: #2271b1 !important;
    color: white !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

#gau-search-submit-btn:hover {
    background: #135e96 !important;
    border-color: #135e96 !important;
}

#gau-search-submit-btn:disabled {
    background: #ccc !important;
    border-color: #ccc !important;
    cursor: not-allowed;
}

/* Responsive pour le champ de recherche */
@media screen and (max-width: 768px) {
    #gau-search-form {
        padding: 12px;
    }
    
    #gau-search-form h3 {
        font-size: 13px !important;
    }
    
    #gau-custom-search-term {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
    
    #gau-search-submit-btn {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
}

@media screen and (max-width: 480px) {
    #gau-search-form {
        padding: 10px;
    }
    
    #gau-search-form div {
        flex-direction: column;
        gap: 8px !important;
    }
    
    #gau-custom-search-term {
        width: 100%;
    }
}


.gau-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

.gau-comparison-table thead,
.gau-comparison-table tbody,
.gau-comparison-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.gau-comparison-table th,
.gau-comparison-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
}

.gau-comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.gau-comparison-table tr:nth-child(even) {
    background: #f8f9fa;
}

/* Optimisation mobile - réduire police et ajuster colonnes */
@media screen and (max-width: 768px) {
    .gau-comparison-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
    }
    
    .gau-comparison-table th,
    .gau-comparison-table td {
        padding: 8px 6px;
        min-width: 80px;
    }
    
    /* Colonnes spécifiques pour mobile */
    .gau-comparison-table th:nth-child(1),
    .gau-comparison-table td:nth-child(1) {
        width: 25%; /* Modèle */
        min-width: 100px;
    }
    
    .gau-comparison-table th:nth-child(2),
    .gau-comparison-table td:nth-child(2) {
        width: 35%; /* Robustesse */
        min-width: 120px;
    }
    
    .gau-comparison-table th:nth-child(3),
    .gau-comparison-table td:nth-child(3) {
        width: 25%; /* Autonomie */
        min-width: 100px;
    }
    
    .gau-comparison-table th:nth-child(4),
    .gau-comparison-table td:nth-child(4) {
        width: 15%; /* Prix */
        min-width: 80px;
        font-weight: 600;
        color: #dc3545;
    }
    
    /* Masquer la colonne GPS sur mobile (si elle existe) */
    .gau-comparison-table th:nth-child(5),
    .gau-comparison-table td:nth-child(5) {
        display: none;
    }
}

/* Pour les très petits écrans */
@media screen and (max-width: 480px) {
    .gau-comparison-table {
        font-size: 11px;
    }
    
    .gau-comparison-table th,
    .gau-comparison-table td {
        padding: 6px 4px;
    }
    
    .gau-comparison-table th:nth-child(1),
    .gau-comparison-table td:nth-child(1) {
        width: 30%;
        min-width: 90px;
    }
    
    .gau-comparison-table th:nth-child(2),
    .gau-comparison-table td:nth-child(2) {
        width: 40%;
        min-width: 110px;
    }
    
    .gau-comparison-table th:nth-child(3),
    .gau-comparison-table td:nth-child(3) {
        width: 20%;
        min-width: 80px;
    }
    
    .gau-comparison-table th:nth-child(4),
    .gau-comparison-table td:nth-child(4) {
        width: 10%;
        min-width: 70px;
    }
}

.gau-info-box {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-left: 4px solid #2271b1;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    color: #333;
}

.gau-info-box.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
    color: #333;
}

.gau-info-box.warning strong {
    color: #856404;
    font-weight: 600;
}

.gau-affiliate-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: center;
}

.gau-affiliate-cta h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.gau-affiliate-cta p {
    margin: 0 0 15px 0;
    opacity: 0.9;
}

.gau-affiliate-cta a {
    background: white;
    color: #667eea;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.gau-affiliate-cta a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Encadré comparatif express */
.gau-comparatif-express {
    background: transparent;
    border: 2px solid #ff6b35;
    color: #ff6b35;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 500;
}

.gau-comparatif-express strong {
    color: #ff6b35;
    font-weight: 600;
}

.gau-comparatif-express p {
    margin: 0;
    color: #ff6b35;
}

.gau-comparatif-express h4 {
    margin: 0 0 10px 0;
    color: #ff6b35;
    font-weight: 600;
}

.gau-comparatif-express ul {
    margin: 10px 0;
    padding-left: 20px;
    color: #ff6b35;
}

.gau-comparatif-express li {
    margin-bottom: 5px;
    color: #ff6b35;
}

/* Responsive pour l'encadré comparatif express */
@media screen and (max-width: 768px) {
    .gau-comparatif-express {
        padding: 12px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .gau-comparatif-express {
        padding: 10px;
        font-size: 13px;
    }
}

