/* Styles pour l'interface d'administration de WooCommerce Auto Discounts */

.wcad-admin-container {
    max-width: 1200px;
    margin-top: 20px;
}

/* Section d'information */
.wcad-info-section {
    background-color: #f8f9fa;
    border-left: 4px solid #007cba;
    margin-bottom: 30px;
}

.wcad-info-content {
    padding: 0 10px;
}

.wcad-info-list {
    margin: 15px 0;
}

.wcad-info-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.wcad-info-list .dashicons {
    color: #007cba;
    margin-right: 10px;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.wcad-tip {
    background-color: #fff8e5;
    padding: 10px 15px;
    border-left: 4px solid #ffb900;
    margin: 20px 0 10px;
    display: flex;
    align-items: center;
}

.wcad-tip .dashicons {
    color: #ffb900;
    margin-right: 10px;
}

.wcad-admin-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.wcad-rules-table {
    margin-bottom: 30px;
}

.wcad-rules-table th {
    font-weight: 600;
    padding: 10px;
}

.wcad-rules-table td {
    vertical-align: middle;
    padding: 12px 10px;
}

.wcad-rules-table input[type="number"] {
    width: 100%;
}

.wcad-add-rule {
    margin: 15px 0 30px 0 !important;
}

.wcad-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.wcad-section h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.wcad-categories-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    background: #f9f9f9;
    border-radius: 3px;
}

.wcad-category-item {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.wcad-category-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.wcad-category-item label {
    display: flex;
    align-items: center;
}

.wcad-category-item input[type="checkbox"] {
    margin-right: 8px;
}

.wcad-manual-update {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 20px;
    margin-top: 20px;
}

.wcad-manual-update h2 {
    margin-top: 0;
}

.wcad-manual-update p {
    margin-bottom: 15px;
}

/* Tableau de bord */
.wcad-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wcad-stat-box {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
}

.wcad-stat-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
}

.wcad-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 5px;
}

.wcad-stat-description {
    font-size: 12px;
    color: #777;
}

.wcad-usage-table {
    margin-top: 15px;
}

.wcad-run-status {
    border-top: 1px solid #eee;
    margin-top: 10px;
    padding-top: 15px;
}

.wcad-run-status h3 {
    margin: 0 0 8px;
}

.wcad-run-status p {
    margin: 6px 0;
}

.wcad-warning {
    border-left: 4px solid #d63638;
    padding-left: 10px;
    color: #8a2424;
}

/* Prévisualisation */
.wcad-preview-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin: 20px 0;
    align-items: flex-end;
}

.wcad-preview-field {
    display: flex;
    flex-direction: column;
}

.wcad-preview-field label {
    margin-bottom: 5px;
    font-weight: 500;
}

.wcad-preview-field-checkbox {
    justify-content: flex-end;
    min-height: 67px;
}

.wcad-preview-field-checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 9px;
    font-weight: 500;
}

.wcad-preview-field-checkbox input[type="checkbox"] {
    margin: 0;
}

.wcad-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2px;
}

.wcad-preview-container {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
}

.wcad-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.wcad-preview-header h3 {
    margin: 0;
}

.wcad-preview-close {
    color: #666;
    text-decoration: none;
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    display: block;
    width: 20px;
    height: 20px;
    text-align: center;
}

.wcad-preview-close:hover,
.wcad-preview-close:focus {
    color: #d63638;
    text-decoration: none;
}

.wcad-preview-products {
    margin: 0;
    padding-left: 20px;
}

.wcad-preview-more {
    font-style: italic;
    color: #777;
}

.wcad-error {
    color: #d63638;
}

/* Infobulles */
.wcad-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    margin-left: 6px;
    top: -1px;
    vertical-align: baseline;
    line-height: 1;
    width: 16px;
    height: 16px;
}

.wcad-tooltip .dashicons {
    color: #999;
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    vertical-align: middle;
}

.wcad-tooltip:hover .dashicons,
.wcad-tooltip:focus .dashicons {
    color: #646970;
}

.wcad-tooltip-bubble {
    position: fixed;
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    max-width: min(420px, calc(100vw - 32px));
    min-width: 180px;
    overflow-wrap: break-word;
    pointer-events: none;
    text-align: left;
    z-index: 100000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.wcad-tooltip-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: var(--wcad-tooltip-arrow-left, 50%);
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.wcad-tooltip-bubble.is-below::after {
    top: -10px;
    bottom: auto;
    border-top-color: transparent;
    border-bottom-color: #333;
}

/* Ajouter après les styles existants */

.wcad-variation-field {
    padding: 5px;
    margin: 5px 0;
    display: flex;
    align-items: center;
    background: #f9f9f9;
    border-left: 3px solid #0073aa;
}

.wcad-variation-field .description {
    margin-left: 10px !important;
}

/* Styles pour la colonne dans la liste des produits */
.column-exclude_from_discounts {
    width: 120px;
    text-align: center;
}

.column-exclude_from_discounts .dashicons-yes {
    background: #f1f1f1;
    border-radius: 50%;
    padding: 2px;
    color: #f44336;
    font-size: 20px;
}

.column-exclude_from_discounts .dashicons-no {
    background: #f1f1f1;
    border-radius: 50%;
    padding: 2px;
    color: #4CAF50;
    font-size: 20px;
}

/* Style pour le sélecteur de filtre */
#dropdown_wcad_excluded {
    margin-left: 6px;
    margin-right: 6px;
}

/* Amélioration de la visibilité de la checkbox d'exclusion sur la page produit */
#_wcad_exclude_from_discounts_field {
    background: #f7f7f7;
    padding: 10px !important;
    margin: 10px 0 !important;
    border-left: 3px solid #f44336;
    display: flex !important;
    align-items: center;
}

#_wcad_exclude_from_discounts_field .checkbox {
    margin-right: 8px !important;
    transform: scale(1.2);
}

#_wcad_exclude_from_discounts_field label {
    font-weight: 600 !important;
    color: #333 !important;
}

/* Styles pour la checkbox d'exclusion dans les variations */
.wcad-variation-field {
    padding: 8px !important;
    margin: 10px 0 !important;
    background: #f7f7f7 !important;
    border-left: 3px solid #f44336 !important;
}

/* Assurer que les styles de WooCommerce Auto Discounts sont chargés partout */
.woocommerce_options_panel label[for="_wcad_exclude_from_discounts"] {
    font-weight: 600 !important;
    color: #333 !important;
}

/* Amélioration du style de l'info-bulle */
.woocommerce_options_panel .description[data-tip] {
    color: #777 !important;
}

/* Ajout d'un style pour la section de prévisualisation */
.wcad-section:last-of-type {
    margin-top: 30px;
}
