/* Zone sociale droite Publisher Index - cfy-pi-zone */
/* Chargé uniquement pour la page publisher-index */
/* Aligné sur design system Commercify (--pub-index-*, --cfy-*) ; light/dark via variables. */

/* ============================================================================
   Variables locales scopées à .cfy-pi-zone (référence uniquement)
   ============================================================================ */

.cfy-pi-zone {
    /* Bordures, espacements, transitions — coins angulaires (0) */
    --cfy-pi-zone-border: 1px solid var(--pub-index-border);
    --cfy-pi-zone-radius: 0;
    --cfy-pi-zone-radius-lg: 0;
    --cfy-pi-zone-spacing: 1rem;
    --cfy-pi-zone-transition: all 0.25s ease;
    /* Ombres (héritées du thème) */
    --cfy-pi-zone-shadow: var(--pub-index-shadow);
    --cfy-pi-zone-shadow-lg: var(--pub-index-shadow-lg);
}

/* Logs temporaires debug — style minimal avec variables */
.cfy-pi-zone-log-tmp {
    font-size: var(--cfy-font-size-base, 0.875rem);
    color: var(--pub-index-orange, var(--cfy-warning));
    background: var(--pub-index-orange-bg, var(--cfy-gray-100));
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
    border-inline-start: 3px solid var(--pub-index-orange, var(--cfy-warning));
}

.dark-mode .cfy-pi-zone-log-tmp {
    background: var(--pub-index-gold-bg);
    color: var(--pub-index-gold);
    border-inline-start-color: var(--pub-index-gold);
}

/* Colonne zone profil : contenu en flux normal, pas de zone à hauteur limitée */
.cfy-pi-zone-col {
    display: block;
}

.cfy-pi-zone-col .cfy-pi-zone {
    display: block;
    margin-bottom: 0;
}

/* Conteneur principal de la zone : pas de hauteur limitée, pas de scroll interne */
.cfy-pi-zone {
    width: 100%;
    font-family: var(--cfy-font-family);
    font-size: var(--cfy-font-size-base);
    line-height: var(--cfy-line-height);
    color: var(--pub-index-text);
    background: var(--pub-index-bg-card);
    border: var(--cfy-pi-zone-border);
    border-radius: 0;
    box-shadow: var(--cfy-pi-zone-shadow);
    overflow: visible;
    position: relative;
    min-height: 0;
}

.dark-mode .cfy-pi-zone {
    background: var(--pub-index-bg-card);
    border-color: var(--pub-index-border);
    box-shadow: var(--cfy-pi-zone-shadow);
}

/* ============================================================================
   Barre d'onglets — fond discret, cohérent avec les cartes
   ============================================================================ */

.cfy-pi-zone-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: var(--pub-index-bg-subtle);
    border-bottom: var(--cfy-pi-zone-border);
    padding: 0.25rem 0.25rem 0 0.25rem;
}

.cfy-pi-zone-tab {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    background: transparent;
    border: none;
    padding: 0.75rem 0.5rem;
    color: var(--pub-index-text-muted);
    font-family: var(--cfy-font-family);
    font-size: var(--cfy-font-size-base);
    font-weight: var(--cfy-font-weight-medium);
    cursor: pointer;
    transition: var(--cfy-pi-zone-transition);
    text-align: center;
    position: relative;
    border-radius: 0;
}

.cfy-pi-zone-tab:hover {
    background: var(--pub-index-blue-bg);
    color: var(--pub-index-text);
}

.cfy-pi-zone-tab--active {
    background: var(--pub-index-bg-card);
    color: var(--pub-index-blue);
    font-weight: var(--cfy-font-weight-semibold);
    box-shadow: 0 -1px 0 0 var(--pub-index-bg-card);
}

.cfy-pi-zone-tab--active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    height: 3px;
    background: var(--pub-index-blue);
    border-radius: 0;
}

.cfy-pi-zone-tab i {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
}

/* Conteneur des panneaux : pas de scroll interne, hauteur naturelle du contenu */
.cfy-pi-zone-panels {
    position: relative;
    overflow: visible;
    min-height: 0;
    background: var(--pub-index-bg-card);
}

/* Panneaux : pas de hauteur limitée, contenu en flux page */
.cfy-pi-zone-panel {
    display: none;
    padding: var(--cfy-pi-zone-spacing);
    min-height: 0;
    overflow: visible;
    visibility: visible;
    opacity: 1;
    color: var(--pub-index-text);
}

.cfy-pi-zone-panel--active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.cfy-pi-zone-panel--active * {
    visibility: visible;
}

/* En-tête de panneau */
.cfy-pi-zone-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--pub-index-border);
}

.cfy-pi-zone-panel-title {
    margin: 0;
    font-family: var(--cfy-font-family);
    font-size: var(--cfy-font-size-lg);
    font-weight: var(--cfy-font-weight-semibold);
    color: var(--pub-index-blue);
    visibility: visible;
}

.cfy-pi-zone-panel-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.cfy-pi-zone-panel-actions .btn {
    white-space: nowrap;
}

/* États vides et erreurs */
.cfy-pi-zone-empty {
    text-align: center;
    color: var(--pub-index-text-muted);
    font-style: italic;
    padding: 1.5rem 1rem;
    font-size: var(--cfy-font-size-base);
    line-height: 1.5;
    visibility: visible;
}

/* ============================================================================
   CTA Don — onglets roadmap (Minicom, Compétences, Projets, etc.)
   ============================================================================ */

.cfy-pi-zone-donation-cta {
    padding: 1.5rem 1rem;
    background: var(--pub-index-bg-subtle);
    border: 1px solid var(--pub-index-border);
    border-radius: 0;
    margin: 0;
    max-width: 42rem;
}

.cfy-pi-zone-donation-cta__intro {
    margin: 0 0 1rem 0;
    font-size: var(--cfy-font-size-base);
    line-height: 1.6;
    color: var(--pub-index-text);
}

.cfy-pi-zone-donation-cta__reason {
    margin: 0 0 1.25rem 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--pub-index-text-muted);
}

.cfy-pi-zone-donation-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--cfy-font-family);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border-radius: 0;
    border: none;
    background: linear-gradient(145deg, #198754, #157347);
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.cfy-pi-zone-donation-cta__btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.4);
}

.cfy-pi-zone-donation-cta__btn:focus-visible {
    outline: 2px solid var(--pub-index-blue);
    outline-offset: 2px;
}

.dark-mode .cfy-pi-zone-donation-cta {
    background: var(--pub-index-bg-subtle);
    border-color: var(--pub-index-border);
}

.dark-mode .cfy-pi-zone-donation-cta__intro {
    color: var(--pub-index-text);
}

.dark-mode .cfy-pi-zone-donation-cta__reason {
    color: var(--pub-index-text-muted);
}

.cfy-pi-zone-error {
    text-align: center;
    color: var(--cfy-danger);
    font-style: italic;
    padding: 1.5rem 1rem;
    font-size: var(--cfy-font-size-base);
    line-height: 1.5;
    visibility: visible;
}

/* Contenu des panneaux : héritage */
.cfy-pi-zone-panel p,
.cfy-pi-zone-panel h4,
.cfy-pi-zone-panel .cfy-pi-zone-media-grid,
.cfy-pi-zone-panel .cfy-pi-zone-galerie-grid,
.cfy-pi-zone-panel .cfy-pi-zone-portfolio-grid,
.cfy-pi-zone-panel .cfy-pi-zone-chat,
.cfy-pi-zone-panel .cfy-pi-zone-history-list,
.cfy-pi-zone-panel .cfy-pi-zone-skills-list {
    visibility: visible;
    color: inherit;
}

/* ============================================================================
   Onglet Médias
   ============================================================================ */

.cfy-pi-zone-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.cfy-pi-zone-media-item {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 0;
    border: 1px solid var(--pub-index-border);
    transition: var(--cfy-pi-zone-transition);
}

.cfy-pi-zone-media-item:hover {
    transform: scale(1.05);
    box-shadow: var(--cfy-pi-zone-shadow-lg);
}

.cfy-pi-zone-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cfy-pi-zone-banners {
    border-top: 1px solid var(--pub-index-border);
    padding-top: 1rem;
    text-align: center;
}

.cfy-pi-zone-banners h4 {
    margin: 0 0 0.5rem 0;
    font-family: var(--cfy-font-family);
    font-size: var(--cfy-font-size-lg);
    font-weight: var(--cfy-font-weight-semibold);
    color: var(--pub-index-blue);
}

/* ============================================================================
   Onglet Galerie
   ============================================================================ */

.cfy-pi-zone-galerie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.cfy-pi-zone-galerie-item {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 0;
    border: 1px solid var(--pub-index-border);
    transition: var(--cfy-pi-zone-transition);
}

.cfy-pi-zone-galerie-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--cfy-pi-zone-shadow-lg);
}

.cfy-pi-zone-galerie-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cfy-pi-zone-galerie-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--cfy-gray-900);
    color: var(--cfy-white);
    width: 40px;
    height: 40px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0.9;
}

.cfy-pi-zone-galerie-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, var(--cfy-gray-900));
    color: var(--cfy-white);
    padding: 0.5rem;
    font-size: var(--cfy-font-size-base);
    text-align: center;
}

.cfy-pi-zone-galerie-placeholder {
    width: 100%;
    height: 100%;
    min-height: 80px;
    background: var(--pub-index-bg-subtle);
    color: var(--pub-index-text-muted);
    font-size: 0.75rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ============================================================================
   Onglet Portfolio
   ============================================================================ */

.cfy-pi-zone-portfolio-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cfy-pi-zone-portfolio-item {
    padding: 0.75rem;
    border: 1px solid var(--pub-index-border);
    border-radius: 0;
    background: var(--pub-index-bg-subtle);
    transition: var(--cfy-pi-zone-transition);
}

.cfy-pi-zone-portfolio-item:hover {
    border-color: var(--pub-index-border-strong);
    box-shadow: var(--cfy-pi-zone-shadow);
}

.cfy-pi-zone-portfolio-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--pub-index-text);
    text-decoration: none;
}

.cfy-pi-zone-portfolio-link:hover {
    color: var(--pub-index-blue);
}

.cfy-pi-zone-portfolio-title {
    font-weight: var(--cfy-font-weight-semibold);
    font-size: var(--cfy-font-size-base);
    color: var(--pub-index-text);
}

.cfy-pi-zone-portfolio-desc {
    font-size: var(--cfy-font-size-base);
    color: var(--pub-index-text-muted);
    line-height: 1.4;
}

/* ============================================================================
   Onglet Réseau social (Minicom)
   ============================================================================ */

.cfy-pi-zone-chat {
    margin-bottom: 1rem;
    border: 1px solid var(--pub-index-border);
    border-radius: 0;
    background: var(--pub-index-bg-subtle);
}

.cfy-pi-zone-message {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--pub-index-border);
}

.cfy-pi-zone-message:last-child {
    border-bottom: none;
}

.cfy-pi-zone-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 0;
    flex-shrink: 0;
}

.cfy-pi-zone-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--pub-index-blue);
    color: var(--cfy-white);
    font-size: 0.875rem;
    font-weight: var(--cfy-font-weight-semibold);
}

.cfy-pi-zone-message-content {
    flex: 1;
    min-width: 0;
}

.cfy-pi-zone-message-sender {
    font-weight: var(--cfy-font-weight-semibold);
    font-size: var(--cfy-font-size-base);
    color: var(--pub-index-blue);
    margin-bottom: 0.25rem;
}

.cfy-pi-zone-message-text {
    font-size: var(--cfy-font-size-base);
    line-height: 1.4;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    color: var(--pub-index-text);
}

.cfy-pi-zone-message-time {
    font-size: 0.75rem;
    color: var(--pub-index-text-muted);
    text-align: right;
}

.cfy-pi-zone-social-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cfy-pi-zone-social-actions .btn {
    width: 100%;
    justify-content: flex-start;
    font-size: var(--cfy-font-size-base);
}

/* ============================================================================
   Onglet Historique
   ============================================================================ */

.cfy-pi-zone-history-list {
    overflow: visible;
}

.cfy-pi-zone-log-item {
    padding: 0.75rem;
    border-inline-start: 3px solid var(--pub-index-border);
    margin-bottom: 0.5rem;
    background: var(--pub-index-bg-subtle);
    border-radius: 0;
}

.cfy-pi-zone-log-level--info {
    border-inline-start-color: var(--pub-index-blue);
}

.cfy-pi-zone-log-level--warning {
    border-inline-start-color: var(--cfy-warning);
}

.cfy-pi-zone-log-level--error {
    border-inline-start-color: var(--cfy-danger);
}

.cfy-pi-zone-log-level--critical {
    border-inline-start-color: var(--cfy-primary);
}

.cfy-pi-zone-log-time {
    font-size: 0.75rem;
    color: var(--pub-index-text-muted);
    margin-bottom: 0.25rem;
}

.cfy-pi-zone-log-content {
    font-size: var(--cfy-font-size-base);
    line-height: 1.4;
    word-wrap: break-word;
    color: var(--pub-index-text);
}

/* ============================================================================
   Onglet Compétences
   ============================================================================ */

.cfy-pi-zone-skills-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cfy-pi-zone-skill-item {
    padding: 1rem;
    border: 1px solid var(--pub-index-border);
    border-radius: 0;
    background: var(--pub-index-bg-subtle);
    transition: var(--cfy-pi-zone-transition);
}

.cfy-pi-zone-skill-item:hover {
    border-color: var(--pub-index-border-strong);
    box-shadow: var(--cfy-pi-zone-shadow);
}

.cfy-pi-zone-skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cfy-pi-zone-skill-name {
    margin: 0;
    font-size: var(--cfy-font-size-lg);
    font-weight: var(--cfy-font-weight-semibold);
    color: var(--pub-index-blue);
}

.cfy-pi-zone-skill-level {
    font-size: var(--cfy-font-size-base);
    color: var(--pub-index-gold);
    background: var(--pub-index-blue);
    padding: 0.25rem 0.5rem;
    border-radius: 0;
    font-weight: var(--cfy-font-weight-medium);
}

.cfy-pi-zone-skill-description {
    font-size: var(--cfy-font-size-base);
    color: var(--pub-index-text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.cfy-pi-zone-skill-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cfy-pi-zone-skill-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--cfy-font-size-base);
    color: var(--pub-index-blue);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--pub-index-border-strong);
    border-radius: 0;
    transition: var(--cfy-pi-zone-transition);
}

.cfy-pi-zone-skill-link:hover {
    background: var(--pub-index-blue-bg);
    color: var(--pub-index-blue);
    border-color: var(--pub-index-blue);
}

/* Dark mode : skill-level contraste (texte clair sur fond bleu/or) */
.dark-mode .cfy-pi-zone-skill-level {
    background: var(--pub-index-gold);
    color: var(--pub-index-text);
}

/* ============================================================================
   Support RTL
   ============================================================================ */

[dir="rtl"] .cfy-pi-zone-tab--active::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

[dir="rtl"] .cfy-pi-zone-message {
    flex-direction: row-reverse;
}

[dir="rtl"] .cfy-pi-zone-message-time {
    text-align: left;
}

[dir="rtl"] .cfy-pi-zone-log-item {
    border-inline-start: none;
    border-inline-end: 3px solid var(--pub-index-border);
    border-radius: 0;
}

[dir="rtl"] .cfy-pi-zone-log-level--info {
    border-inline-end-color: var(--pub-index-blue);
}

[dir="rtl"] .cfy-pi-zone-log-level--warning {
    border-inline-end-color: var(--cfy-warning);
}

[dir="rtl"] .cfy-pi-zone-log-level--error {
    border-inline-end-color: var(--cfy-danger);
}

[dir="rtl"] .cfy-pi-zone-log-level--critical {
    border-inline-end-color: var(--cfy-primary);
}

[dir="rtl"] .cfy-pi-zone-skill-header {
    flex-direction: row-reverse;
}

/* ============================================================================
   Responsive / utilitaires
   ============================================================================ */

.cfy-pi-zone-sm-hint {
    border-inline-start: 3px solid var(--pub-index-blue);
    background: var(--pub-index-blue-bg);
}

.dark-mode .cfy-pi-zone-sm-hint {
    background: var(--pub-index-gold-bg);
    border-inline-start-color: var(--pub-index-gold);
}

.cfy-pi-zone-panel--active {
    animation: cfyPiZoneFadeIn 0.25s ease-out;
}

@keyframes cfyPiZoneFadeIn {
    from {
        opacity: 0.6;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   Page Publisher Index — coins angulaires (override typology)
   Tous les éléments visibles sur cette page : cartes, boutons, alertes, profil, etc.
   ============================================================================ */

.page-publisher-typology .card.card-bordered,
.page-publisher-typology .card:not(.card-bordered) {
    border-radius: 0;
}

.page-publisher-typology .card-inner.publisher-header-gradient {
    border-radius: 0;
}

.page-publisher-typology .card-inner.publisher-entry-gradient,
.page-publisher-typology .article.publisher-entry-gradient {
    border-radius: 0;
}

.page-publisher-typology .publisher-profile__img,
.page-publisher-typology .publisher-profile__embed {
    border-radius: 0;
}

.page-publisher-typology .alert.publisher-alert-gradient {
    border-radius: 0;
}

.page-publisher-typology .btn.publisher-btn-private-access,
.page-publisher-typology .btn.bg-dark.text-warning {
    border-radius: 0;
}

.page-publisher-typology .publisher-avatar {
    border-radius: 0;
}

.page-publisher-typology .tags .badge {
    border-radius: 0;
}

.page-publisher-typology .border-warning.bg-dark {
    border-radius: 0;
}

.page-publisher-typology .publisher-nav__link {
    border-radius: 0;
}
