/**
 * Style CSS pour les boutons de résumé IA - Charte Asking Franklin
 * Approche Mobile-First
 * Fichier : style.css
 */

/* ============================================
   VARIABLES - CHARTE ASKING FRANKLIN
   ============================================ */
:root {
    --af-pink: #EA5571;
    --af-pink-hover: #D84563;
    --af-navy: #1E2857;
    --af-navy-light: #2B3674;
    --af-pink-light: #F56476;
    --af-gray-bg: #F9FAFB;
    --af-white: #FFFFFF;
    --af-shadow: 0 4px 12px rgba(234, 85, 113, 0.2);
    --af-shadow-hover: 0 6px 20px rgba(234, 85, 113, 0.35);
}

/* ============================================
   BASE STYLES - Mobile First (< 576px)
   ============================================ */

/* Conteneur principal */
.ai-summary-banner {
    background: linear-gradient(135deg, #FFF5F7 0%, #F0F4FF 100%);
    border: 2px solid var(--af-pink);
    border-radius: 20px;
    padding: 20px;
    margin: 32px 0;
    box-shadow: 0 4px 20px rgba(30, 40, 87, 0.08);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.ai-summary-banner:hover {
    box-shadow: 0 6px 30px rgba(30, 40, 87, 0.12);
    transform: translateY(-2px);
}

/* Conteneur interne */
.ai-summary-container {
    max-width: 100%;
    width: 100%;
}

/* Titre de la section */
.ai-summary-heading {
    margin-bottom: 16px;
    font-size: 17px;
    color: var(--af-navy);
    text-align: center;
    line-height: 1.4;
    padding: 0 8px;
    font-weight: 600;
}

.ai-summary-heading strong {
    font-weight: 700;
    display: block;
    background: linear-gradient(90deg, var(--af-pink) 0%, var(--af-pink-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Conteneur des boutons - Mobile */
.ai-summary-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: stretch;
}

/* Boutons individuels - Mobile */
.ai-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--af-white);
    border: 2px solid #E5E7EB;
    border-radius: 50px;
    text-decoration: none;
    color: var(--af-navy);
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    min-height: 52px;
    position: relative;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(30, 40, 87, 0.06);
}

.ai-button:hover,
.ai-button:focus {
    text-decoration: none;
    color: var(--af-white);
    transform: translateY(-3px);
    box-shadow: var(--af-shadow-hover);
    border-color: transparent;
}

.ai-button:active {
    transform: translateY(-1px);
    box-shadow: var(--af-shadow);
}

/* Icône du bouton */
.ai-button-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.ai-button:hover .ai-button-icon {
    transform: scale(1.15) rotate(5deg);
}

.ai-button-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Texte du bouton */
.ai-button-text {
    font-weight: 600;
    flex: 1;
    text-align: left;
    letter-spacing: 0.01em;
}

/* ============================================
   STYLES PAR PLATEFORME - Charte AF
   ============================================ */

/* ChatGPT */
.ai-button-chatgpt {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-color: #10B981;
}

.ai-button-chatgpt:hover,
.ai-button-chatgpt:focus {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-color: #10B981;
}

.ai-button-chatgpt .ai-button-icon {
    color: #10B981;
}

.ai-button-chatgpt:hover .ai-button-icon,
.ai-button-chatgpt:focus .ai-button-icon {
    color: white;
}

/* Claude */
.ai-button-claude {
    background: linear-gradient(135deg, #FFF5F1 0%, #FFE8DD 100%);
    border-color: #EA5571;
}

.ai-button-claude:hover,
.ai-button-claude:focus {
    background: linear-gradient(135deg, var(--af-pink) 0%, var(--af-pink-hover) 100%);
    border-color: var(--af-pink);
}

.ai-button-claude .ai-button-icon {
    color: var(--af-pink);
}

.ai-button-claude:hover .ai-button-icon,
.ai-button-claude:focus .ai-button-icon {
    color: white;
}

/* Gemini */
.ai-button-gemini {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-color: #3B82F6;
}

.ai-button-gemini:hover,
.ai-button-gemini:focus {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border-color: #3B82F6;
}

.ai-button-gemini .ai-button-icon {
    color: #3B82F6;
}

.ai-button-gemini:hover .ai-button-icon,
.ai-button-gemini:focus .ai-button-icon {
    color: white;
}

/* Perplexity */
.ai-button-perplexity {
    background: linear-gradient(135deg, #F0FDFA 0%, #CCFBF1 100%);
    border-color: #14B8A6;
}

.ai-button-perplexity:hover,
.ai-button-perplexity:focus {
    background: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%);
    border-color: #14B8A6;
}

.ai-button-perplexity .ai-button-icon {
    color: #14B8A6;
}

.ai-button-perplexity:hover .ai-button-icon,
.ai-button-perplexity:focus .ai-button-icon {
    color: white;
}

/* Mistral */
.ai-button-mistral {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border-color: #F59E0B;
}

.ai-button-mistral:hover,
.ai-button-mistral:focus {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    border-color: #F59E0B;
}

.ai-button-mistral .ai-button-icon {
    color: #F59E0B;
}

.ai-button-mistral:hover .ai-button-icon,
.ai-button-mistral:focus .ai-button-icon {
    color: white;
}

/* Grok */
.ai-button-grok {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    border-color: var(--af-navy);
}

.ai-button-grok:hover,
.ai-button-grok:focus {
    background: linear-gradient(135deg, var(--af-navy) 0%, var(--af-navy-light) 100%);
    border-color: var(--af-navy);
}

.ai-button-grok .ai-button-icon {
    color: var(--af-navy);
}

.ai-button-grok:hover .ai-button-icon,
.ai-button-grok:focus .ai-button-icon {
    color: white;
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (>= 360px)
   ============================================ */
@media (min-width: 360px) {
    .ai-summary-heading {
        font-size: 17.5px;
    }
    
    .ai-button {
        font-size: 15px;
        padding: 14px 22px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE PAYSAGE (>= 480px)
   ============================================ */
@media (min-width: 480px) {
    .ai-summary-banner {
        padding: 22px;
        margin: 34px 0;
        border-radius: 24px;
    }
    
    .ai-summary-heading {
        font-size: 18px;
        margin-bottom: 18px;
    }
    
    .ai-summary-buttons {
        gap: 14px;
    }
    
    .ai-button {
        font-size: 15px;
        padding: 13px 24px;
    }
    
    .ai-button-icon {
        width: 26px;
        height: 26px;
    }
}

/* ============================================
   RESPONSIVE - TABLETTE PORTRAIT (>= 576px)
   ============================================ */
@media (min-width: 576px) {
    .ai-summary-banner {
        padding: 24px;
        margin: 36px 0;
    }
    
    .ai-summary-heading {
        font-size: 19px;
    }
    
    .ai-summary-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
    }
    
    .ai-button {
        width: calc(50% - 7px);
        min-width: 160px;
        padding: 13px 20px;
    }
    
    .ai-button-text {
        text-align: center;
    }
}

/* ============================================
   RESPONSIVE - TABLETTE PAYSAGE (>= 768px)
   ============================================ */
@media (min-width: 768px) {
    .ai-summary-banner {
        padding: 28px;
        margin: 40px 0;
        border-radius: 28px;
    }
    
    .ai-summary-heading {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .ai-summary-buttons {
        gap: 16px;
    }
    
    .ai-button {
        width: calc(33.333% - 11px);
        min-width: 170px;
        font-size: 14.5px;
        padding: 12px 18px;
    }
    
    .ai-button:hover {
        transform: translateY(-4px);
    }
}

/* ============================================
   RESPONSIVE - DESKTOP SMALL (>= 992px)
   ============================================ */
@media (min-width: 992px) {
    .ai-summary-banner {
        padding: 30px;
        margin: 42px 0;
    }
    
    .ai-summary-heading {
        font-size: 21px;
    }
    
    .ai-summary-buttons {
        gap: 14px;
    }
    
    .ai-button {
        width: auto;
        min-width: 145px;
        padding: 12px 20px;
        font-size: 14.5px;
    }
    
    .ai-button-icon {
        width: 22px;
        height: 22px;
    }
}

/* ============================================
   RESPONSIVE - DESKTOP LARGE (>= 1200px)
   ============================================ */
@media (min-width: 1200px) {
    .ai-summary-banner {
        padding: 32px 40px;
    }
    
    .ai-summary-heading {
        font-size: 22px;
    }
    
    .ai-summary-buttons {
        gap: 16px;
    }
    
    .ai-button {
        min-width: 155px;
        padding: 13px 24px;
        font-size: 15px;
    }
}

/* ============================================
   RESPONSIVE - TRÈS GRAND ÉCRAN (>= 1440px)
   ============================================ */
@media (min-width: 1440px) {
    .ai-summary-container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .ai-summary-banner {
        padding: 36px 48px;
    }
    
    .ai-summary-heading {
        font-size: 23px;
    }
    
    .ai-button {
        min-width: 165px;
        padding: 14px 28px;
        font-size: 15px;
    }
}

/* ============================================
   ORIENTATION - PORTRAIT
   ============================================ */
@media (orientation: portrait) and (max-width: 767px) {
    .ai-summary-buttons {
        flex-direction: column;
    }
    
    .ai-button {
        width: 100%;
    }
    
    .ai-button-text {
        text-align: left;
    }
}

/* ============================================
   ORIENTATION - PAYSAGE (Mobile)
   ============================================ */
@media (orientation: landscape) and (max-height: 500px) {
    .ai-summary-banner {
        padding: 16px 20px;
        margin: 20px 0;
    }
    
    .ai-summary-heading {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .ai-summary-buttons {
        gap: 10px;
    }
    
    .ai-button {
        padding: 10px 16px;
        min-height: 44px;
        font-size: 14px;
    }
    
    .ai-button-icon {
        width: 20px;
        height: 20px;
    }
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */

/* Focus visible pour navigation au clavier */
.ai-button:focus-visible {
    outline: 3px solid var(--af-pink);
    outline-offset: 4px;
}

/* Masquer l'outline pour la souris */
.ai-button:focus:not(:focus-visible) {
    outline: none;
}

/* Amélioration du contraste */
@media (prefers-contrast: high) {
    .ai-summary-banner {
        border-width: 3px;
    }
    
    .ai-button {
        border-width: 3px;
        font-weight: 700;
    }
}

/* Réduction des animations pour utilisateurs sensibles */
@media (prefers-reduced-motion: reduce) {
    .ai-summary-banner,
    .ai-button,
    .ai-button-icon {
        transition: none;
        animation: none;
    }
    
    .ai-button:hover {
        transform: none;
    }
}

/* ============================================
   MODE SOMBRE
   ============================================ */
@media (prefers-color-scheme: dark) {
    .ai-summary-banner {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        border-color: var(--af-pink);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }
    
    .ai-summary-heading {
        color: #F0F4FF;
    }
    
    .ai-summary-heading strong {
        background: linear-gradient(90deg, var(--af-pink-light) 0%, var(--af-pink) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .ai-button {
        background: #2d2d3f;
        color: #e5e7eb;
        border-color: #3d3d5c;
    }
    
    .ai-button:hover,
    .ai-button:focus {
        color: white;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Animation d'entrée élégante */
@keyframes slideInUpBounce {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    60% {
        transform: translateY(-5px) scale(1.01);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-summary-banner {
    animation: slideInUpBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animation des boutons au chargement */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ai-button {
    animation: fadeInScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation-fill-mode: both;
}

.ai-button:nth-child(1) { animation-delay: 0.1s; }
.ai-button:nth-child(2) { animation-delay: 0.15s; }
.ai-button:nth-child(3) { animation-delay: 0.2s; }
.ai-button:nth-child(4) { animation-delay: 0.25s; }
.ai-button:nth-child(5) { animation-delay: 0.3s; }
.ai-button:nth-child(6) { animation-delay: 0.35s; }

/* Effet shimmer sur le titre */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.ai-summary-heading strong {
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
}

/* ============================================
   PRINT (Impression)
   ============================================ */
@media print {
    .ai-summary-banner {
        display: none;
    }
}

/* ============================================
   TRÈS PETITS ÉCRANS (< 320px)
   ============================================ */
@media (max-width: 320px) {
    .ai-summary-banner {
        padding: 16px;
        margin: 24px 0;
    }
    
    .ai-summary-heading {
        font-size: 15px;
        margin-bottom: 14px;
    }
    
    .ai-summary-heading strong {
        font-size: 16px;
    }
    
    .ai-button {
        font-size: 14px;
        padding: 12px 16px;
        gap: 8px;
        min-height: 48px;
    }
    
    .ai-button-icon {
        width: 22px;
        height: 22px;
    }
}

/* ============================================
   AJUSTEMENTS POUR CONTENEURS ÉTROITS
   ============================================ */

.narrow-container .ai-summary-buttons,
.sidebar .ai-summary-buttons {
    flex-direction: column;
}

.narrow-container .ai-button,
.sidebar .ai-button {
    width: 100%;
}

/* ============================================
   COMPATIBILITÉ AVEC LES THÈMES WORDPRESS
   ============================================ */

/* Reset des styles qui pourraient être hérités */
.ai-summary-banner * {
    box-sizing: border-box;
}

.ai-button {
    line-height: 1.5;
    letter-spacing: 0.01em;
    text-transform: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Empêcher les liens d'être stylisés par le thème */
.ai-button:link,
.ai-button:visited {
    color: var(--af-navy);
}

@media (prefers-color-scheme: dark) {
    .ai-button:link,
    .ai-button:visited {
        color: #e5e7eb;
    }
}

.ai-button:hover,
.ai-button:focus {
    color: white !important;
}

/* ============================================
   SUPPORT DES ANCIENS NAVIGATEURS
   ============================================ */

/* Fallback pour navigateurs sans support de gap */
@supports not (gap: 12px) {
    .ai-summary-buttons {
        margin: -7px;
    }
    
    .ai-button {
        margin: 7px;
    }
}

/* ============================================
   OPTIMISATIONS DE PERFORMANCE
   ============================================ */

/* GPU acceleration pour les transformations */
.ai-button {
    will-change: transform;
    transform: translateZ(0);
}

.ai-button:hover {
    will-change: transform, box-shadow;
}

/* Optimiser le rendering */
.ai-summary-banner {
    contain: layout style paint;
}

/* Badge "Nouveau" optionnel */
.ai-button::after {
    content: '';
    display: none;
}

.ai-button.new::after {
    content: 'NEW';
    display: block;
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--af-pink);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(234, 85, 113, 0.3);
}

/* ============================================
   FIN DU FICHIER
   ============================================ */