/* ============================================
   CSS SPÉCIFIQUE À L'APPLICATION USER_ACCOUNTS
   ============================================ */

/* --- STRUCTURE GÉNÉRALE --- */
.user-accounts-header {
    height: 10%;
    padding: 1.5rem;
    display: flex;
    align-items: center;
}

.user-accounts-breadcrumb {
    font-size: 11px;
    color: var(--orange-dark);
}

.user-accounts-breadcrumb a {
    color: var(--orange-dark);
    text-decoration: none;
}

.user-accounts-breadcrumb a:hover {
    text-decoration: underline;
}

.user-accounts-breadcrumb span {
    color: var(--grey-dark);
}

.user-accounts-title {
    height: 10%;
    padding: 1.5rem;
    display: flex;
    align-items: center;
}

.user-accounts-title h1 {
    margin-bottom: 0;
}

.user-accounts-content {
    height: 80%;
    padding: 1.5rem;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.user-accounts-content-centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-accounts-content h3 {
    color: var(--orange-main);
}

.user-accounts-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.user-accounts-card {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 20px;
    min-height: 100px;
}

.user-accounts-logo-container {
    min-height: 100%;
}

.user-accounts-logo-img {
    max-height: 100px;
    max-width: 100%;
    object-fit: contain;
}


/* ============================================
   HARMONISATION DES FORM-CONTROL
   ============================================ */
/* Harmonisation de la taille de police pour tous les form-control */
.user-accounts-content .form-control,
.user-accounts-content .form-control:focus,
.user-accounts-content textarea.form-control,
.user-accounts-content input.form-control,
.user-accounts-content select.form-control {
    font-size: 14px;
    font-weight: 400;
    font-family: 'Axiforma', sans-serif;
}

/* ============================================
   CSS SPÉCIFIQUE PAR PAGE
   ============================================ */

/* --- ACCUEIL --- */
.user-accounts-card-hover {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--grey-dark);
}

.user-accounts-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0px 4px 12px 4px var(--grey-medium);
}

.user-accounts-card-icon {
    height: 48px;
    width: auto;
    object-fit: contain;
}

/* --- AUDIENCES --- */
#analytics-error {
    display: none;
}

#analytics-error.visible {
    display: block;
}

.info-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    flex-shrink: 0;
}

.info-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.info-icon-wrapper:hover .info-icon {
    opacity: 1;
}

.custom-tooltip {
    position: fixed;
    top: var(--tooltip-top, 0);
    left: var(--tooltip-left, 0);
    transform: translateX(-50%);
    padding: 12px;
    background-color: white;
    color: var(--grey-dark);
    width: 280px;
    max-width: 90vw;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s 0.2s;
    z-index: 10000;
}

.custom-tooltip-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
}

.custom-tooltip-title:only-child {
    margin-bottom: 0;
}

.custom-tooltip-body {
    font-size: 12px;
    line-height: 1.4;
}

.custom-tooltip-body:only-child {
    margin-top: 0;
}

.custom-tooltip.measuring {
    visibility: hidden;
    opacity: 0;
}

.custom-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
}

.custom-tooltip-arrow {
    position: fixed;
    top: var(--arrow-top, 0);
    left: var(--arrow-left, 0);
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s 0.2s;
    z-index: 10001;
}

.custom-tooltip-arrow.arrow-up {
    border-top: 6px solid var(--grey-dark);
    border-bottom: none;
}

.custom-tooltip-arrow.arrow-down {
    border-bottom: 6px solid var(--grey-dark);
    border-top: none;
}

.custom-tooltip-arrow.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
}

.date-range-picker-container {
    position: relative;
    display: inline-block;
}

.date-range-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--orange-main);
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.date-range-picker-trigger:hover {
    background-color: var(--orange-hover-dark-bg);
}

.date-range-arrow {
    margin-left: 8px;
}

#dateRangeInput {
    display: none;
}

.audience-tabs {
    display: flex;
    margin-top: 16px;
    gap: 8px;
}

.audience-tab {
    padding: 8px 16px;
    background-color: white;
    border: 1px solid var(--orange-main);
    border-radius: 4px;
    cursor: pointer;
    color: var(--grey-dark);
    transition: all 0.2s ease;
}

.audience-tab:hover {
    background-color: var(--orange-light);
    border-color: var(--orange-main);
}

.audience-tab.active {
    background-color: var(--orange-main);
    border-color: var(--orange-main);
    color: white;
}

.audience-tab-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.flatpickr-calendar {
    line-height: auto !important;
    padding: 10px;
}

.date-range-picker-container .flatpickr-calendar {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    margin-top: 0 !important;
    z-index: 1000;
    transform: none !important;
}

.flatpickr-calendar.rangeMode .flatpickr-months {
    border-bottom: 1px solid var(--grey-medium);
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.flatpickr-calendar .flatpickr-monthDropdown-months,
.flatpickr-calendar .flatpickr-monthDropdown-years {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
}

.flatpickr-calendar .flatpickr-weekday {
    color: var(--grey-dark);
    font-size: 0;
    text-transform: capitalize;
}

.flatpickr-calendar .flatpickr-weekday::first-letter {
    font-size: 12px;
    display: inline-block;
}

.flatpickr-calendar.rangeMode .flatpickr-dayContainer {
    width: 50%;
    padding: 8px;
    box-sizing: border-box;
}

.flatpickr-calendar .flatpickr-day.startRange,
.flatpickr-calendar .flatpickr-day.endRange {
    background-color: var(--orange-main);
    border-color: var(--orange-hover-dark-bg);
    color: white;
}

.flatpickr-calendar .flatpickr-day.startRange:hover,
.flatpickr-calendar .flatpickr-day.endRange:hover {
    background-color: var(--orange-main) !important;
    border-color: var(--orange-hover-dark-bg) !important;
    color: white !important;
}

.flatpickr-calendar .flatpickr-day.inRange {
    background-color: transparent !important;
    background: var(--orange-light) !important;
    border: none !important;
    box-shadow: none !important;
}

.flatpickr-calendar .flatpickr-day.inRange:hover {
    background-color: var(--orange-light) !important;
}

.flatpickr-calendar .flatpickr-day:hover {
    background-color: var(--orange-light) !important;
    border: none !important;
}

.flatpickr-calendar .flatpickr-day.disabled,
.flatpickr-calendar .flatpickr-day.prevMonthDay,
.flatpickr-calendar .flatpickr-day.nextMonthDay {
    color: #ccc;
}

.flatpickr-footer {
    display: none;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--grey-medium);
}

.flatpickr-footer.attached {
    display: flex;
}

.flatpickr-footer-buttons {
    display: flex;
    gap: 8px;
}

.flatpickr-footer-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.flatpickr-footer-button.apply {
    background-color: var(--orange-main);
    border: 1px solid var(--orange-hover-dark-bg);
    color: white;
    display: flex;
    align-items: center;
    gap: 4px;
}

.flatpickr-footer-button.apply:hover {
    background-color: var(--orange-hover-dark-bg);
}

.flatpickr-footer-button.cancel {
    background-color: transparent;
    color: var(--grey-medium);
}

.flatpickr-footer-button.cancel:hover {
    background-color: var(--grey-light);
}

#analytics-data {
    display: none;
}

#analytics-data.loaded {
    display: flex;
}

.datas_analytics {
    flex: 1;
    min-height: 0;
}

.analytics-cards-container {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px;
    height: 100%;
    flex: 1;
    min-height: 0;
}


#chart-section {
    display: block;
}


.user-accounts-chart-container {
    overflow-x: hidden;
}

.user-accounts-chart-wrapper {
    overflow-x: hidden;
    width: 100%;
    min-height: 250px;
}

.chart-donut-wrapper {
    min-height: 200px;
    height: 200px;
}

.user-accounts-chart-canvas {
    max-height: 400px;
    max-width: 100%;
}

#countries-section {
    display: block;
}

.countries-map-table-container {
    align-items: center;
}

.countries-map-table-container .col-6:first-child {
    display: flex;
    align-items: center;
}

#countries-map {
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    height: 500px;
}

.countries-tooltip {
    background-color: var(--white);
    border: 1px solid var(--grey-medium);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.countries-tooltip strong {
    color: var(--orange-main);
    display: block;
    margin-bottom: 4px;
}

#countries-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px;
}

#countries-table th.sortable:hover {
    background-color: var(--grey-light);
}

#countries-table th.sortable::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.3;
}

#countries-table th.sortable.sort-asc::after {
    border-bottom: 6px solid var(--orange-main);
    opacity: 1;
}

#countries-table th.sortable.sort-desc::after {
    border-top: 6px solid var(--orange-main);
    opacity: 1;
}

#audiences-translations {
    display: none;
}

/* --- MY PRODUCTS --- */
.tableau_derivés {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    min-width: 0;
    position: relative;
}

.my-products-table-wrapper.table-responsive {
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
}


.my-products-table {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

.my-products-table-header {
    position: sticky;
    top: 0;
    z-index: 10;
}

.my-products-table-header th {
    background-color: var(--white);
    border-bottom: 2px solid var(--grey-medium);
    font-weight: 600;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

.my-products-table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 0;
    position: relative;
}

.my-products-table td.commentary-cell {
    text-align: center;
}

.my-products-table td.commentary-cell button {
    pointer-events: none;
}

.my-products-table td form {
    width: 100%;
    min-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.my-products-table th:last-child,
.my-products-table td.certifications-cell {
    width: 200px;
    max-width: 200px;
}

.my-products-table td.certifications-cell form {
    width: auto;
    min-width: 0;
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;
}

.my-products-table td.certifications-cell .badge {
    text-align: left;
    background-color: var(--orange-light);
    border-color: var(--orange-main) !important;
    color: var(--orange-main);
}

.my-products-table td .btneditcertif {
    border: none;
    color: var(--orange-main);
}

.my-products-table td input.form-control {
    width: 100%;
    min-width: 250px;
    max-width: none;
    box-sizing: border-box;
    display: block;
    margin: 0 auto;
}

.my-products-table td input.form-control:focus {
    min-width: max(250px, calc(100% + 50px));
    width: auto;
    position: relative;
    z-index: 100;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
}

.my-products-table .dropdown-menu {
    min-width: fit-content;
    white-space: nowrap;
}

.Titredropdowncertif {
    display: block;
    font-size: 12px;
    font-weight: 500;
    background-color: var(--orange-light);
    text-align: center;
}

.my-products-table .certifications-dropdown-list {
    max-height: calc(7 * 2.4rem);
    overflow-y: auto;
    margin-bottom: 0;
}

.my-products-table .dropdown-menu form {
    margin: 0;
}

.my-products-table .dropdown-menu .form-check-input {
    flex-shrink: 0;
    margin: 0;
    margin-right: 0.5rem;
}

.my-products-table .dropdown-menu .form-check-label {
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
}

.my-products-table .dropdown-menu li {
    white-space: nowrap;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    cursor: pointer;
}

.my-products-table .dropdown-menu li:hover {
    background-color: var(--orange-light);
}

.my-products-table .dropdown-menu li:hover .form-check-label {
    color: var(--grey-dark);
}

.my-products-pagination-container {
    width: 100%;
    background-color: transparent;
}

.my-products-pagination {
    margin: 0;
}

.my-products-pagination .page-link {
    color: var(--orange-main);
    border-color: var(--orange-light);
    padding: 0.5rem 0.75rem;
    font-size: 14px;
    transition: all 0.2s ease;
}

.my-products-pagination .page-link:hover {
    color: var(--orange-dark);
    background-color: var(--orange-light);
    border-color: var(--orange-main);
}

.my-products-pagination .page-item.active .page-link {
    background-color: var(--orange-main);
    border-color: var(--orange-main);
    color: var(--white);
}

.my-products-pagination .page-item.disabled .page-link {
    color: var(--grey-medium);
    background-color: var(--white);
    border-color: var(--grey-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.my-products-pagination .page-item.disabled .page-link:hover {
    color: var(--grey-medium);
    background-color: var(--white);
    border-color: var(--grey-light);
}

/* --- DOCUMENTATION --- */
.user-accounts-card-coming-soon {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 80px 40px;
    text-align: center;
    position: relative;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.user-accounts-illustration {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 40px;
}

.user-accounts-illustration img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- MY ACCOUNT --- */
.calendly-widget {
    min-width: 320px;
    flex: 1;
}

/* --- MY PUBLIC DATA --- */
/* Formulaire avec flex pour gérer la hauteur */
.user-accounts-public-data-form {
    flex: 1;
    min-height: 0;
}

/* Contenu scrollable du formulaire */
.user-accounts-public-data-content {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Séparateur pour la section logo */
.logo-preview-separator {
    border-top: 1px solid #e0e0e0;
}

/* Styles pour les images de logo (actuel et prévisualisation) */
.logo-image,
.logo-preview-image {
    max-width: 150px;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    padding: 8px;
}

/* Conteneur de prévisualisation du logo */
.logo-preview-container {
    display: none;
}

.logo-preview-container.visible {
    display: block;
}

/* Placeholder de prévisualisation */
.logo-preview-placeholder {
    display: block;
}

.logo-preview-placeholder.hidden {
    display: none;
}

/* Textarea avec auto-resize */
.auto-resize-textarea {
    overflow-y: hidden;
}


.user-accounts-public-data-footer-buttons {
    justify-content: center;
}

/* Footer de pagination fixé en bas */
.user-accounts-pagination-footer {
    border-top: 1px solid var(--grey-light);
    flex-shrink: 0;
}


/* ============================================
   COULEURS CHART.JS
   ============================================ */
:root {
    --chart-color-impressions: var(--orange-light);
    --chart-color-impressions-bg: var(--grey-medium);
    --chart-color-clicks: var(--orange-main);
    --chart-color-clicks-bg: var(--grey-medium);
    --chart-color-sessions: var(--orange-light);
    --chart-color-sessions-bg: var(--grey-medium);
    --chart-color-users: var(--orange-main);
    --chart-color-users-bg: var(--grey-medium);
    --chart-grid-color: var(--grey-medium);
    
    --device-desktop-color: #FFB89A;
    --device-desktop-bg: rgba(255, 184, 154, 0.1);
    --device-mobile-color: #FFD700;
    --device-mobile-bg: rgba(255, 215, 0, 0.1);
    --device-tablet-color: #FF69B4;
    --device-tablet-bg: rgba(255, 105, 180, 0.1);
    
    --traffic-direct-color: #4A90E2;
    --traffic-direct-bg: rgba(74, 144, 226, 0.1);
    --traffic-organic-color: #50C878;
    --traffic-organic-bg: rgba(80, 200, 120, 0.1);
    --traffic-referral-color: #FF6B6B;
    --traffic-referral-bg: rgba(255, 107, 107, 0.1);
    --traffic-social-color: #9B59B6;
    --traffic-social-bg: rgba(155, 89, 182, 0.1);
    
    --map-country-border-color: var(--grey-medium);
    --map-country-no-data-color: var(--grey-light);
    --map-country-fill-opacity: 0.7;
    --map-country-border-weight: 1;
    --map-country-border-opacity: 0.3;
    --map-country-dash-array: 0;
    --map-gradient-steps: 10;
    --map-ocean-color: white !important;
}

.device-metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background-color: var(--white);
    border-radius: 8px;
    border: 1px solid var(--grey-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.device-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
}

.device-metric-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.device-desktop .device-metric-icon {
    background-color: var(--device-desktop-bg);
    color: var(--device-desktop-color);
}

.device-mobile .device-metric-icon {
    background-color: var(--device-mobile-bg);
    color: var(--device-mobile-color);
}

.device-tablet .device-metric-icon {
    background-color: var(--device-tablet-bg);
    color: var(--device-tablet-color);
}

.device-metric-content {
    flex: 1;
}

.traffic-direct .device-metric-icon {
    background-color: var(--traffic-direct-bg);
    color: var(--traffic-direct-color);
}

.traffic-organic .device-metric-icon {
    background-color: var(--traffic-organic-bg);
    color: var(--traffic-organic-color);
}

.traffic-referral .device-metric-icon {
    background-color: var(--traffic-referral-bg);
    color: var(--traffic-referral-color);
}

.traffic-social .device-metric-icon {
    background-color: var(--traffic-social-bg);
    color: var(--traffic-social-color);
}

.device-metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.leaflet-popup-pane,
.leaflet-popup {
    display: none !important;
}
