/**
 * Styles modernes pour le Dashboard Tricot
 */

/* Import des styles principaux */
@import url('main.css');

/* Colonne type */
.column-type {
    width: 10%;
}

/* Style pour l'étiquette de type */
.type-tag {
    display: inline-block;
    padding: 4px 8px;
    background-color: #f0f0f0;
    color: var(--text-color);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Couleurs spécifiques selon le type */
.type-tag.post {
    background-color: #e3f2fd;
    color: #1976d2;
}

.type-tag.page {
    background-color: #e8f5e9;
    color: #388e3c;
}

.type-tag.none {
    background-color: #f5f5f5;
    color: #9e9e9e;
}


/* Header */
.tricot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tricot-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

/* Cards spécifiques au dashboard */
.main-card {
    padding: 0;
    position: relative;
    z-index: 10;
}

/* Filtres et recherche */
.filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.search-container {
    position: relative;
    flex-grow: 1;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 20px;
}

#tricot-links-search, #tricot-medias-search, #status-search {
    width: 100%;
    height: 42px;
    border-radius: 21px;
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    padding: 8px 16px 8px 40px;
    font-size: 14px;
    transition: var(--transition);
}

#tricot-links-search:focus, #tricot-medias-search:focus, #status-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.2);
}

/* Bouton spécifique pour le dropdown */
.tricot-button.dropdown-toggle {
    background: var(--bg-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.tricot-button.dropdown-toggle:hover {
    background: #e6e9f0;
}

/* Dropdown */
.tricot-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000000 !important; /* Z-index encore plus élevé */
    min-width: 220px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 12px;
    margin-top: 8px;
}

.dropdown-content.active {
    display: block !important; /* Force l'affichage */
    visibility: visible !important;
    opacity: 1 !important;
}

.dropdown-content a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    transition: var(--transition);
}

.dropdown-content a i {
    font-size: 18px;
    margin-right: 10px;
    color: var(--text-light);
}

.dropdown-content a:hover {
    background-color: var(--bg-light);
}

/* S'assurer que le dropdown est au-dessus de tout */
.tricot-dashboard-header {
    position: relative;
}

/* Assurer que la carte principale ne cache pas les dropdowns */
.main-card {
    position: relative;
    z-index: 1;
}

/* Styles pour le dropdown de filtres */
.filter-dropdown {
    padding: 16px;
    min-width: 250px;
}

.filter-group {
    position: relative;
    margin: 0 0 15px 0;
    width: 100%;
}

.filter-group label {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.filter-group select {
    width: 100%;
    height: 38px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 0 8px;
    background-color: white;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    width: 100%;
    border-top: 1px solid var(--border-color);
}


/* Étiquette de langue */
.lang-tag {
    display: inline-block;
    padding: 4px 8px;
    background-color: var(--light-primary);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* URL source */
.source-url {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    max-width: 100%;
    overflow: hidden;
}

.source-url i {
    font-size: 18px;
    margin-right: 8px;
    flex-shrink: 0;
}

.url-text {
    white-space: normal;
    word-break: break-word;
}

.source-url:hover {
    color: var(--primary-hover);
}

.source-url.no-source {
    color: var(--text-light);
    cursor: default;
}

/* Date */
.date-cell {
    white-space: nowrap;
    color: var(--text-light);
    font-size: 13px;
}

/* Boutons d'action */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.action-button:hover {
    background-color: var(--bg-light);
    color: var(--text-color);
}

.action-button.edit-translation:hover {
    color: var(--primary-color);
}

.action-button.delete-translation:hover {
    color: var(--error-color);
}

/* Édition en ligne */
.editable-field {
    position: relative;
}

.editable-field .display-text {
    cursor: pointer;
    min-height: 20px;
    transition: var(--transition);
}

.editable-field .display-text:hover {
    background-color: rgba(92, 107, 192, 0.08);
    border-radius: 4px;
}

.edit-mode {
    margin-top: 8px;
}

.edit-control {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 12px;
    resize: vertical;
}

.edit-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.2);
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Pagination */
.tricot-pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.items-count {
    color: var(--text-light);
    font-size: 14px;
}

.pagination {
    display: flex;
    align-items: center;
}

.pagination-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
}

.pagination-button:hover:not(.disabled) {
    background-color: var(--bg-light);
}

.pagination-button.disabled {
    color: #b0bec5;
    cursor: default;
}

.page-input {
    display: flex;
    align-items: center;
    margin: 0 12px;
    font-size: 14px;
}

.current-page {
    width: 40px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    text-align: center;
    font-size: 14px;
    margin: 0 8px;
    padding: 0 4px;
}

.current-page:focus {
    outline: none;
    border-color: var(--primary-color);
}

.page-separator {
    margin: 0 8px;
    color: var(--text-light);
}

/* Style pour les lignes sans source */
.tricot-table tr.no-source-row {
    background-color: #f5f5f5; /* Gris pâle pour tout l'arrière-plan de la ligne */
}

.tricot-table tr.no-source-row:hover {
    background-color: #e9e9e9; /* Un gris légèrement plus sombre au survol */
}

/* Le texte reste en couleur normale */
.tricot-table tr.no-source-row td {
    color: var(--text-color); /* Utilise la couleur de texte par défaut, pas de changement */
}

/* Indicateur visuel "Aucune source" */
.source-url.no-source {
    color: #999;
    font-style: italic;
}

/* Style pour le champ de filtre d'URL source */
#tricot-medias-filter-source-url, #tricot-links-filter-source-url {
    width: 100%;
    height: 38px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 0 8px;
    background-color: white;
    font-size: 14px;
}

/* Style pour les groupes d'options */
#tricot-medias-filter-source-url optgroup, #tricot-links-filter-source-url optgroup {
    font-weight: 600;
    color: var(--primary-color);
    padding: 4px 0;
}

#tricot-medias-filter-source-url option , #tricot-links-filter-source-url option {
    padding: 4px 8px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive */
@media screen and (max-width: 1200px) {
    .column-source-url {
        width: 120px;
    }
}

@media screen and (max-width: 992px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        margin-bottom: 12px;
    }

    .tricot-dropdown {
        width: 100%;
    }

    .tricot-button.dropdown-toggle {
        width: 100%;
    }

    .dropdown-content {
        width: 100%;
    }

    .column-source-url, .column-date {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .column-lang {
        display: none;
    }

    .pagination {
        margin-top: 16px;
    }

    .tricot-pagination-container {
        flex-direction: column;
    }
}

/* Statistiques en haut du dashboard */

.translation-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    margin-bottom: 30px;
    justify-content: space-between;

}

.translation-stats-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: 218px 250px 250px;
}

.translation-stats-summary .tricot-card.fullheight {
    grid-row-start: 1;
    grid-row-end: 3;
}

.stat-value-wrap{
    position: relative;
}

.stat-value-wrap .stat-value{
    display: flex;
    justify-content: center;
    align-items: center;
    align-content: center;
    position: absolute;
    width: 100%;
    height: 100%;
}


.translation-summary .tricot-card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.translation-stats-summary .tricot-card .card-content {
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: space-between;
}

.translation-info {
    display: flex;
}

.translation-info .card-content {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 20px;
}

.card-infos {
    min-width: 300px;
    margin-right: 20px;
}

.card-infos ul li{
    padding-top: 6px;
    margin-bottom: 6px;
    color: rgba(20, 20, 67, 0.65);
    border-top: 0.5px solid #666685;
}

.card-bulle{
    padding: 20px;
    background-color: rgba(201, 222, 255, 0.39);
    border-radius: 8px;
    width: 300px;
    z-index: 2;
    position: relative;
    color: var(--text-light);

    font-size: 15px;
    line-height: 21px;
    font-weight: 500;
}

.card-bulle:after{
    content: "";
    position: absolute;
    top: 10px;
    right: -25px;
    z-index: 1;
    background: url("../images/bulle-pointe.svg");
    width: 33px;
    height: 34px;

}

.stat-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-light);
}

.stat-value {
    font-size: 31px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #97A7FF;
}

/* Responsive statistiques */
@media screen and (max-width: 992px) {
    .translation-stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .translation-stats-summary {
        grid-template-columns: 1fr;
    }
}

/* Coloration conditionnelle des statistiques */
.stat-value.high-value {
    color: #4caf50; /* vert */
}

.stat-value.medium-value {
    color: #ff9800; /* orange */
}

.stat-value.low-value {
    color: #FE6F4D; /* rouge */
}

/* Styles spécifiques à l'import/export */
#import-translations {
    margin-right: 8px;
}

#import-translations i {
    margin-right: 8px;
}

/* Ajoutez ce CSS dans dashboard.css */
.column-toggle-dropdown {
    min-width: 280px;
    padding: 16px;
}

.column-toggle-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.column-toggle-options h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-color);
}

.column-toggle-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.column-toggle-label input[type="checkbox"] {
    margin-right: 10px;
}

.column-toggle-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}


/* S'assurer que la colonne des cases à cocher reste étroite */
.check-column {
    width: 40px;
    white-space: nowrap;
}

/* Définir des largeurs minimales pour les colonnes fixes */
.column-lang {
    width: 80px;
}

.column-type {
    width: 120px;
}

.column-validated {
    width: 80px;
}

.column-date {
    width: 120px;
}

.column-actions {
    width: 100px;
}

/* Donner aux colonnes de contenu une largeur relative plus grande */
.column-original,
.column-translated {
    min-width: 200px;
    width: 50%;
    max-width: 600px;
}

.image-content{
    display: flex;
    gap: 20px;
    align-items: center;
}

.image-content img{
    height: 65px;
}

.image-content .actions-buttons{
    display: flex;
    gap: 10px;
    flex-direction: column;
}


/* Lorsque des colonnes sont masquées, on peut avoir une règle simple */
[data-columns-hidden="true"] .column-original,
[data-columns-hidden="true"] .column-translated {
    width: auto;
}

/* Style pour le sélecteur de lignes par page */
.items-per-page {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.items-per-page label {
    margin-right: 8px;
    font-size: 14px;
    color: var(--text-light);
}

/* Mise en page flexible pour la zone de pagination */
.tricot-pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.pagination-controls {
    display: flex;
    align-items: center;
}

@media screen and (max-width: 768px) {
    .tricot-pagination-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination-controls {
        margin-top: 10px;
        width: 100%;
        justify-content: space-between;
    }
}

/* S'assurer que la colonne des cases à cocher reste étroite */
th.check-column, td.check-column {
    width: 40px;
    white-space: nowrap;
}

/* Définir des largeurs minimales pour les colonnes fixes */
th.column-lang, td.column-lang {
    width: 80px;
}

th.column-type, td.column-type {
    width: 120px;
}

th.column-validated, td.column-validated {
    width: 80px;
}

th.column-date, td.column-date {
    width: 120px;
}

th.column-actions, td.column-actions {
    width: 100px;
}

/* Donner aux colonnes de contenu une largeur relative plus grande */
th.column-original, td.column-original,
th.column-translated, td.column-translated {
    min-width: 200px;
}

/* Lorsque des colonnes sont masquées, on peut avoir une règle simple */
[data-columns-hidden="true"] th.column-original,
[data-columns-hidden="true"] td.column-original,
[data-columns-hidden="true"] th.column-translated,
[data-columns-hidden="true"] td.column-translated {
    width: auto;
}

/* Styles pour la page de licence */
.tricot-license-page {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 30px;
    margin-top: 20px;
}

.tricot-license-page h2 {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid var(--light-primary);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.license-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

.license-status.valid {
    background-color: #e8f5e9;
    color: #388e3c;
}

.license-status.inactive {
    background-color: #fff3e0;
    color: #f57c00;
}

.license-status.invalid {
    background-color: #ffebee;
    color: #d32f2f;
}

.tricot-license-page .form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
    vertical-align: top;
    text-align: left;
    font-weight: 600;
}

.tricot-license-page .regular-text {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.tricot-license-page .description {
    margin-top: 8px;
    color: var(--text-light);
    font-style: italic;
}

.tricot-license-page .submit {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.wrap-source-url{
    width: 100%;
    display: flex;

    justify-content: space-between;
}
.locations{
    position: relative;
    display: inline-block;
}
.locations .locations-count{
    padding: 4px 8px;
    background-color: var(--light-primary);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* locations-popover  */
.locations-popover {
    display: none;
    position: absolute;
    top: -13px;
    right: 0px;
    z-index: 1000000 !important; /* Z-index encore plus élevé */
    padding-right: 25px;
}

.locations-popover-content{
    min-width: 500px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 12px;
    margin-top: 8px;
    max-height: 250px;
    overflow: auto;
}

.tricot-table tbody tr:nth-last-child(-n + 4) .locations-popover {
    top: auto;
    bottom: -13px;
}

.locations-popover.active {
    display: block !important; /* Force l'affichage */
    visibility: visible !important;
    opacity: 1 !important;
}

.tricot-table tbody{
    min-height: 250px;
}

/* Media meta detection button */
.tricot-media-meta-action {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tricot-media-meta-action .tricot-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tricot-meta-progress {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    margin-left: 8px;
}

/* Info tooltip */
.tricot-tooltip-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.tricot-tooltip-info > .material-icons {
    font-size: 18px;
    color: #94a3b8;
}

.tricot-tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 280px;
    padding: 12px 14px;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 100;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
}

.tricot-tooltip-text::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.tricot-tooltip-text a {
    color: #93c5fd;
    text-decoration: underline;
}

.tricot-tooltip-info:hover .tricot-tooltip-text,
.tricot-tooltip-text:hover {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}