/* public/css/articles/show.css */

/* Social Share Styles */
/* ============================================
   1. GALERIE ET MODALS
   ============================================ */

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    isolation: isolate;
}

.gallery-thumbnail {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item:hover .gallery-thumbnail {
    transform: scale(1.08);
}

.gallery-overlay {
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1 !important;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
}

.thumbnail-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
}

.thumbnail-btn:hover,
.thumbnail-btn:focus {
    transform: translateY(-2px);
    border-color: var(--bs-primary);
}

.thumbnail-btn:hover img,
.thumbnail-btn:focus img {
    opacity: 0.9 !important;
}

.thumbnail-btn.active {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px var(--bs-primary), 0 4px 12px rgba(var(--bs-primary-rgb, 13, 110, 253), 0.25);
}

.thumbnail-btn.active img {
    opacity: 1 !important;
}

/* Thème sombre pour modals */
[data-bs-theme="dark"] .modal-content.bg-body {
    background-color: var(--bs-dark) !important;
    color: var(--bs-light);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .carousel-control-prev-icon.bg-dark,
[data-bs-theme="dark"] .carousel-control-next-icon.bg-dark {
    background-color: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

[data-bs-theme="dark"] .carousel-control-prev-icon.bg-dark:hover,
[data-bs-theme="dark"] .carousel-control-next-icon.bg-dark:hover {
    background-color: rgba(255, 255, 255, 1) !important;
}

[data-bs-theme="dark"] .carousel-caption {
    background-color: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive galerie */
@media (max-width: 768px) {
    .gallery-item {
        margin-bottom: 1rem;
        border-radius: 6px;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-dialog.modal-xl {
        max-width: calc(100% - 1rem);
    }
    
    .thumbnail-btn img {
        width: 40px !important;
        height: 30px !important;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 15%;
    }
}

@media (max-width: 576px) {
    .gallery-thumbnail {
        transition: transform 0.3s ease;
    }
    
    .gallery-item:hover .gallery-thumbnail {
        transform: scale(1.03);
    }
}

/* ============================================
   2. BOUTONS SOCIAUX ET PARTAGE
   ============================================ */

.btn-social {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    color: white !important;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    padding: 0.5rem 1rem;
}

.btn-social::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-social:hover::before,
.btn-social:focus::before {
    width: 300px;
    height: 300px;
}

.btn-social:hover,
.btn-social:focus {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-social:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Couleurs spécifiques aux réseaux sociaux */
.btn-facebook {
    background: linear-gradient(135deg, #1877f2, #0d5cb6);
}

.btn-twitter {
    background: linear-gradient(135deg, #000000, #1da1f2);
}

.btn-linkedin {
    background: linear-gradient(135deg, #0a66c2, #004182);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.btn-facebook:hover,
.btn-facebook:focus {
    background: linear-gradient(135deg, #0d5cb6, #1877f2);
}

.btn-twitter:hover,
.btn-twitter:focus {
    background: linear-gradient(135deg, #1da1f2, #000000);
}

.btn-linkedin:hover,
.btn-linkedin:focus {
    background: linear-gradient(135deg, #004182, #0a66c2);
}

.btn-whatsapp:hover,
.btn-whatsapp:focus {
    background: linear-gradient(135deg, #128c7e, #25d366);
}

/* Statistiques de partage */
.share-stats {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(var(--bs-body-bg-rgb), 0.8) !important;
    border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .share-stats {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Cartes en thème sombre */
[data-bs-theme="dark"] .card {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--bs-body-color);
    background-color: transparent;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--bs-primary);
    color: var(--bs-light);
}

/* Animation pour le feedback */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
}

#copyFeedback {
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--bs-success-rgb, 25, 135, 84), 0.2);
}

#copyFeedback.hide {
    animation: fadeOutDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

/* Responsive partage social */
@media (max-width: 768px) {
    .social-share .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-social,
    .btn-outline-secondary {
        width: 100%;
        margin-bottom: 0.5rem;
        justify-content: center;
    }
    
    .share-stats {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem !important;
    }
    
    .share-stats > div {
        width: 100%;
        padding: 0.5rem 0;
    }
}

@media (max-width: 576px) {
    .btn-social span {
        font-size: 0.875rem;
    }
}

/* ============================================
   3. MÉTADONNÉES ET TAGS
   ============================================ */

/* Styles pour les métadonnées */
.article-meta {
    font-size: 0.875rem;
    line-height: 1.5;
}

.article-meta small {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
}

.article-meta i {
    opacity: 0.8;
    transition: opacity 0.2s ease;
    width: 1em;
    text-align: center;
}

.article-meta .d-flex:hover i {
    opacity: 1;
}

/* Styles pour les tags */
.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 50rem;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    line-height: 1;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
}

.tag-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.tag-badge:hover,
.tag-badge:focus {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: currentColor;
    color: white !important;
    text-decoration: none !important;
}

.tag-badge:hover::before,
.tag-badge:focus::before {
    opacity: 0.2;
}

/* Thème sombre pour tags */
[data-bs-theme="dark"] .tag-badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .tag-badge:hover,
[data-bs-theme="dark"] .tag-badge:focus {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .article-meta small {
    color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .article-meta i {
    opacity: 0.9;
}

/* ============================================
   4. SYSTÈME DE LIKES
   ============================================ */

/* Bouton like */
#likeBtn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

#likeBtn:hover {
    transform: scale(1.15);
}

#likeBtn:active {
    transform: scale(0.95);
}

#likeBtn:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Icône like */
#likeIcon {
    font-size: 1.75rem;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-block;
    position: relative;
}

#likeIcon:not(.text-danger) {
    color: var(--bs-secondary);
    filter: grayscale(0.5);
}

#likeBtn:hover #likeIcon:not(.text-danger) {
    color: var(--bs-danger);
    filter: grayscale(0);
    transform: scale(1.2);
}

/* Animation du cœur */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

@keyframes likePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--bs-danger-rgb, 220, 53, 85), 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--bs-danger-rgb, 220, 53, 85), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-danger-rgb, 220, 53, 85), 0);
    }
}

.animate-heart {
    animation: heartBeat 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-pulse {
    animation: likePulse 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Compteur de likes */
#likeCount {
    font-weight: 600;
    margin-left: 0.375rem;
    transition: all 0.3s ease;
    font-variant-numeric: tabular-nums;
}

/* État de chargement */
#likeBtn.loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: progress;
}

#likeBtn.loading #likeIcon {
    animation: heartBeat 1.2s infinite;
}

/* Animation du compteur */
@keyframes countUp {
    0% {
        transform: translateY(8px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateY(-2px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes countDown {
    0% {
        transform: translateY(-8px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateY(2px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.count-up {
    animation: countUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.count-down {
    animation: countDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation unlike */
@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
}

.unlike-animate {
    animation: fadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Particules pour like */
.like-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bs-danger);
    pointer-events: none;
    z-index: 1000;
}

/* Responsive likes */
@media (max-width: 768px) {
    #likeIcon {
        font-size: 1.5rem;
    }
    
    #likeCount {
        font-size: 0.9375rem;
    }
}

/* ============================================
   5. AMÉLIORATIONS GLOBALES
   ============================================ */

/* Transitions cohérentes */
.gallery-item,
.thumbnail-btn,
.btn-social,
.tag-badge,
#likeBtn {
    will-change: transform;
}

/* Focus styles améliorés */
.gallery-item:focus-within {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-thumbnail,
    .gallery-overlay,
    .thumbnail-btn,
    .btn-social,
    .tag-badge,
    #likeBtn,
    #likeIcon,
    #likeCount,
    #copyFeedback {
        transition: none !important;
        animation: none !important;
    }
    
    .gallery-item:hover .gallery-thumbnail {
        transform: none;
    }
}

/* Styles d'impression */
@media print {
    .gallery-overlay,
    .btn-social,
    #likeBtn,
    .thumbnail-btn {
        display: none !important;
    }
    
    .gallery-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Variables CSS pour la cohérence */
:root {
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-base: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-active: 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] {
    --shadow-base: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-active: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.comment {
    transition: all 0.3s ease;
    position: relative;
}
.comment:hover {
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.comment-footer {
    background-color: #f8f9fa;
    margin: -15px -15px -15px -15px;
    padding: 10px 15px;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}
.comment-actions {
    opacity: 0.7;
    transition: opacity 0.3s;
}
.comment:hover .comment-actions {
    opacity: 1;
}
.edit-form {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
}
#loadingSpinner {
    margin-left: 8px;
}

/* Styles pour les toasts */
#toastContainer {
    max-width: 350px;
}
.toast {
    font-size: 0.875rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    margin-bottom: 10px;
}