/**
 * Influencer Dashboard - WooCommerce Style
 * 
 * Styles additionnels pour utiliser les composants WooCommerce Analytics
 * sur le front-end (hors admin WordPress).
 */

/* ===========================================================================
   CONTENEUR PRINCIPAL
   =========================================================================== */
.infdash-wc-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 13px;
    line-height: 1.4em;
    color: #1e1e1e;
}

/* ===========================================================================
   EN-TÊTE
   =========================================================================== */
.infdash-wc-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.infdash-wc-header h1 {
    font-size: 23px;
    font-weight: 400;
    margin: 0 0 8px 0;
    color: #1e1e1e;
    line-height: 1.3;
}

.infdash-wc-header .infdash-wc-subtitle {
    font-size: 13px;
    color: #757575;
    margin: 0;
}

.infdash-wc-header .infdash-wc-coupon-badge {
    display: inline-block;
    background: #f0f0f1;
    padding: 4px 12px;
    border-radius: 2px;
    font-family: monospace;
    font-size: 13px;
    color: #1e1e1e;
    margin-top: 8px;
}

/* ===========================================================================
   FILTRES DE DATE (style WooCommerce)
   =========================================================================== */
.infdash-wc-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
}

.infdash-wc-filters label {
    font-size: 13px;
    color: #1e1e1e;
    font-weight: 600;
}

.infdash-wc-filters input[type="date"] {
    height: 36px;
    padding: 0 8px;
    border: 1px solid #949494;
    border-radius: 2px;
    font-size: 13px;
    color: #1e1e1e;
    background: #fff;
    min-width: 150px;
}

.infdash-wc-filters input[type="date"]:focus {
    border-color: var(--wp-admin-theme-color, #007cba);
    box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #007cba);
    outline: none;
}

.infdash-wc-filters .infdash-wc-btn {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    background: var(--wp-admin-theme-color, #007cba);
    color: #fff;
    border: none;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.infdash-wc-filters .infdash-wc-btn:hover {
    background: var(--wp-admin-theme-color-darker-10, #006ba1);
}

/* ===========================================================================
   PÉRIODE INFO
   =========================================================================== */
.infdash-wc-period-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 8px 0;
    font-size: 13px;
    color: #757575;
}

.infdash-wc-period-info strong {
    color: #1e1e1e;
}

/* ===========================================================================
   CARTES DE STATISTIQUES (Style WooCommerce Summary)
   =========================================================================== */

/* Conteneur principal - style exact WooCommerce */
.woocommerce-summary {
    display: grid;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    margin-bottom: 24px;
}

.woocommerce-summary.has-2-items {
    grid-template-columns: repeat(2, 1fr);
}

.woocommerce-summary.has-3-items {
    grid-template-columns: repeat(3, 1fr);
}

/* Conteneur de chaque item */
.woocommerce-summary__item-container {
    margin: 0;
}

/* Item individuel */
.woocommerce-summary__item {
    display: flex;
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 1px solid transparent;
    border-right: 1px solid #e0e0e0;
    cursor: default;
    text-decoration: none;
    color: inherit;
    min-height: 100px;
}

.woocommerce-summary__item:last-child {
    border-right: none;
}

.woocommerce-summary__item:hover {
    background: #f6f7f7;
}

/* Label du stat */
.woocommerce-summary__item-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #757575;
    margin-bottom: 8px;
}

/* Conteneur de la valeur */
.woocommerce-summary__item-value {
    display: flex;
    flex-direction: column;
}

/* Valeur principale */
.woocommerce-summary__item-data {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.woocommerce-summary__item-data .woocommerce-summary__item-value__number {
    font-size: 24px;
    font-weight: 400;
    color: #1e1e1e;
    line-height: 1.2;
}

/* Delta (tendance) */
.woocommerce-summary__item-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
}

.woocommerce-summary__item-delta.is-positive {
    background: rgba(0, 124, 77, 0.1);
    color: #007c4d;
}

.woocommerce-summary__item-delta.is-negative {
    background: rgba(204, 24, 24, 0.1);
    color: #cc1818;
}

.woocommerce-summary__item-delta.is-neutral {
    background: #f0f0f1;
    color: #757575;
}

.woocommerce-summary__item-delta svg {
    width: 18px;
    height: 18px;
}

/* Valeur précédente */
.woocommerce-summary__item-prev-value {
    display: block;
    font-size: 12px;
    color: #757575;
    margin-top: 8px;
}

/* ===========================================================================
   GRAPHIQUE (Style WooCommerce Card)
   =========================================================================== */
.woocommerce-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    margin-bottom: 24px;
}

.woocommerce-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.woocommerce-card__title {
    font-size: 16px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0;
}

.woocommerce-card__body {
    padding: 24px;
}

.woocommerce-chart__container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ===========================================================================
   MESSAGE AUCUNE DONNÉE
   =========================================================================== */
.infdash-wc-no-data {
    text-align: center;
    padding: 48px 24px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    margin-bottom: 24px;
}

.infdash-wc-no-data p {
    margin: 0;
    color: #757575;
    font-size: 14px;
}

/* ===========================================================================
   MESSAGES D'ERREUR
   =========================================================================== */
.infdash-wc-error {
    text-align: center;
    padding: 48px 24px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
}

.infdash-wc-error h3 {
    font-size: 16px;
    font-weight: 600;
    color: #cc1818;
    margin: 0 0 8px 0;
}

.infdash-wc-error p {
    margin: 0 0 16px 0;
    color: #757575;
}

.infdash-wc-error .infdash-wc-btn {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    background: var(--wp-admin-theme-color, #007cba);
    color: #fff;
    border: none;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

/* ===========================================================================
   FOOTER
   =========================================================================== */
.infdash-wc-footer {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: #757575;
    border-top: 1px solid #e0e0e0;
    margin-top: 24px;
}

/* ===========================================================================
   RESPONSIVE
   =========================================================================== */
@media (max-width: 782px) {
    .infdash-wc-container {
        margin: 1rem auto;
    }

    .woocommerce-summary.has-2-items,
    .woocommerce-summary.has-3-items {
        grid-template-columns: 1fr;
    }

    .woocommerce-summary__item {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .woocommerce-summary__item:last-child {
        border-bottom: none;
    }

    .infdash-wc-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .infdash-wc-filters input[type="date"] {
        width: 100%;
    }

    .infdash-wc-filters .infdash-wc-btn {
        width: 100%;
        justify-content: center;
    }

    .woocommerce-chart__container {
        height: 250px;
    }
}

/* ===========================================================================
   VARIABLES CSS WORDPRESS ADMIN (fallback pour le front)
   =========================================================================== */
:root {
    --wp-admin-theme-color: #007cba;
    --wp-admin-theme-color-darker-10: #006ba1;
    --wp-admin-theme-color-darker-20: #005a87;
}
