/**
 * ANIMATED INFO WIDGETS - STYLES COMPLETS
 * Plugin WordPress pour widgets d'information animés
 * Version: 2.0.1
 */

/* ==========================================
   SECTION 1: STYLES FRONTEND WIDGETS
   ========================================== */

/* --- Conteneur Principal Widget --- */
.tarif-libre-widget {
    position: relative;
    padding: 15px;
    margin: 20px auto;
    text-align: center;
    overflow: visible; /* IMPORTANT: Permet le débordement des éléments décoratifs */
  
}

/* --- Header du Widget --- */
.tarif-libre-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    gap: 10px;
    position: relative;
    overflow: visible; /* Permet le débordement dans le header aussi */
}

/* --- Titres Animés --- */
.tarif-libre-titre {
    font-size: 2.5rem !important;
    font-weight: bold;
    color: white;
    margin: 0;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 1px 1px 0 #ff8800, -1px 1px 0 #ff8800, 1px -1px 0 #ff8800, -1px -1px 0 #ff8800;
    transition: opacity 0.5s ease-in-out;
}

/* --- Animation Centrale (Prix) --- */
.prix-anime-container {
    text-align: center;
    margin: 10px 0;
}

.prix-anime {
    font-size: 3rem;
    font-weight: bold;
    color: #e74c3c;
    display: inline-block;
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}

.prix-anime img {
    margin: 0 auto;
    display: block;
}

/* --- Éléments Décoratifs --- */
.tarif-libre-image {
    position: absolute;
    object-fit: contain;
    z-index: 999; /* Valeur par défaut élevée */
    pointer-events: none; /* Évite les interférences avec les clics */
    /* Les positions left/top sont définies dynamiquement via les attributs */
}

/* --- Bouton d'Action --- */
.tarif-libre-bouton {
    background-color: #910900;
    color: white;
    border: solid 1px #ffffff;
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.tarif-libre-bouton:hover {
    background-color: #A76635;
    color: white;
    text-decoration: none;
}

/* ==========================================
   SECTION 2: ANIMATIONS CSS
   ========================================== */

/* --- Animations Visuelles Prix --- */
@keyframes prixFade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes prixZoom {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes prixBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    60% { transform: translateY(-15px); }
}

@keyframes prixPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes prixShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes prixRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes prixSlide {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* --- Animations d'Entrée Widget --- */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
/* --- Animations Titres Spécifiques --- */
.tarif-libre-titre {
    animation-fill-mode: both;
    transform-origin: center center;
}

/* Support pour toutes les polices Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&family=Open+Sans:wght@300;400;600;700&family=Montserrat:wght@300;400;500;600;700&family=Lato:wght@300;400;700&family=Poppins:wght@300;400;500;600;700&family=Playfair+Display:wght@400;700&display=swap');
@keyframes slideInLeft {
    0% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInTop {
    0% { transform: translateY(-100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes slideInBottom {
    0% { transform: translateY(100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes zoomIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes flipIn {
    0% { transform: perspective(400px) rotateY(90deg); opacity: 0; }
    40% { transform: perspective(400px) rotateY(-20deg); }
    60% { transform: perspective(400px) rotateY(10deg); opacity: 1; }
    100% { transform: perspective(400px) rotateY(0deg); opacity: 1; }
}

/* --- Animations Background Globales --- */
/* Note: Les animations de background spécifiques sont générées dynamiquement 
   avec des IDs uniques dans le PHP pour éviter les conflits */

/* Modèles d'animations background réutilisables */
.aiw-bg-fade {
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

.aiw-bg-pulse {
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

.aiw-bg-rotate {
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.aiw-bg-cycle {
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

.aiw-bg-cassette {
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* ==========================================
   SECTION 3: STYLES INTERFACE ADMIN
   ========================================== */

/* --- Layout Admin --- */
.aiw-admin-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.aiw-admin-left {
    flex: 1;
    background: white;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-height: 80vh;
    overflow-y: auto;
}

.aiw-admin-right {
    flex: 1;
}

/* --- Fieldsets Admin --- */
.aiw-admin-left fieldset {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.aiw-admin-left legend {
    font-weight: bold;
    padding: 0 10px;
}

/* --- Sous-sections --- */
.aiw-admin-left h4 {
    margin: 20px 0 10px 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.aiw-admin-left h5 {
    margin: 10px 0 5px 0;
    color: #666;
    font-size: 14px;
}

.aiw-admin-left h6 {
    margin: 10px 0 5px 0;
    color: #666;
    font-size: 13px;
}

/* --- Inputs Admin --- */
.aiw-admin-left input[type="text"],
.aiw-admin-left input[type="url"],
.aiw-admin-left input[type="number"],
.aiw-admin-left select,
.aiw-admin-left textarea {
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 5px 8px;
}

.aiw-admin-left input[type="text"]:focus,
.aiw-admin-left input[type="url"]:focus,
.aiw-admin-left input[type="number"]:focus,
.aiw-admin-left select:focus,
.aiw-admin-left textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
    outline: none;
}

/* --- Conteneur Titres --- */
#titres-container > div {
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 3px;
}

/* --- Aperçu Iframe --- */
#preview-iframe {
    width: 100%;
    height: 400px;
    border: 2px solid #ddd;
    border-radius: 5px;
}

/* --- Zone Shortcode Généré --- */
#generated-shortcode {
    width: 100%;
    height: 120px;
    font-family: 'Courier New', Courier, monospace;
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 3px;
    resize: vertical;
}

/* --- Messages Admin --- */
#copy-message {
    color: green;
    margin-left: 10px;
    font-weight: bold;
}

/* --- Sections Background Admin --- */
.aiw-admin-left .form-table th {
    vertical-align: top;
    padding-top: 8px;
}

.aiw-admin-left .form-table td {
    padding: 5px 0;
}

/* --- Color Picker Override --- */
.wp-picker-container {
    display: inline-block;
}

.wp-picker-container .wp-color-result {
    height: 30px;
    width: auto !important; 
    min-width: 30px;
}

/* --- Boutons Admin --- */
.aiw-admin-left .button {
    margin-left: 10px;
    vertical-align: top;
}

/* --- Responsive Admin --- */
@media (max-width: 1200px) {
    .aiw-admin-container {
        flex-direction: column;
    }
    
    .aiw-admin-left {
        max-height: 60vh;
    }
}

/* ==========================================
   SECTION 4: UTILITAIRES & HELPERS
   ========================================== */

/* --- Classes Utilitaires Taille Widget --- */
.aiw-widget-small {
    max-width: 300px;
}

.aiw-widget-medium {
    max-width: 500px;
}

.aiw-widget-large {
    max-width: 700px;
}

.aiw-widget-extra-large {
    max-width: 900px;
}

.aiw-widget-full-width {
    width: 100%;
    max-width: none;
}

/* --- Classes Utilitaires Images Prix --- */
.aiw-prix-image-small {
    width: 150px;
    height: auto;
}

.aiw-prix-image-medium {
    width: 250px;
    height: auto;
}

.aiw-prix-image-large {
    width: 350px;
    height: auto;
}

.aiw-prix-image-extra-large {
    width: 450px;
    height: auto;
}

/* --- Responsive Frontend --- */
@media (max-width: 768px) {
    .tarif-libre-widget {
        padding: 10px;
        margin: 10px auto;
    }
    
    .tarif-libre-titre {
        font-size: 2rem !important;
    }
    
    .prix-anime {
        font-size: 2.5rem;
    }
    
    .tarif-libre-image {
        left: -15px;
        width: 100px !important;
    }
    
    .aiw-widget-small,
    .aiw-widget-medium,
    .aiw-widget-large,
    .aiw-widget-extra-large {
        max-width: 100%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .tarif-libre-titre {
        font-size: 1.5rem !important;
        height: 2rem;
    }
    
    .prix-anime {
        font-size: 2rem;
    }
    
    .tarif-libre-image {
        left: -10px;
        width: 80px !important;
    }
    
    .tarif-libre-bouton {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* ==========================================
   SECTION 5: DARK MODE & ACCESSIBILITY
   ========================================== */

/* --- Support Dark Mode Basique --- */
@media (prefers-color-scheme: dark) {
    .tarif-libre-widget {
        border-color: #555;
    }
    
    .tarif-libre-titre {
        text-shadow: 1px 1px 0 #333, -1px 1px 0 #333, 1px -1px 0 #333, -1px -1px 0 #333;
    }
}

/* --- Accessibilité --- */
.tarif-libre-widget:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.tarif-libre-bouton:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.5);
}

/* --- Réduction des animations pour accessibilité --- */
@media (prefers-reduced-motion: reduce) {
    .prix-anime,
    .tarif-libre-widget,
    .tarif-libre-titre {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================
   SECTION 6: PRINT STYLES
   ========================================== */

@media print {
    .tarif-libre-widget {
        animation: none !important;
        break-inside: avoid;
        margin: 10px 0;
        border: 1px solid #000;
        background: white !important;
    }
    
    .prix-anime,
    .tarif-libre-titre {
        animation: none !important;
        color: #000 !important;
        text-shadow: none !important;
    }
    
    .tarif-libre-bouton {
        background: white !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
    
    .tarif-libre-image {
        position: static !important;
        display: block !important;
        margin: 10px auto !important;
    }
}

/* ==========================================
   SECTION 7: ANIMATIONS SPÉCIALES VINTAGE
   ========================================== */

/* --- Effet Cassette Loading C64 --- */
.aiw-cassette-loading {
    background-attachment: fixed;
    position: relative;
}

.aiw-cassette-loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    z-index: -1;
}

/* --- Effet Rétro Text Shadow --- */
.aiw-retro-text {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 40px currentColor;
}

/* --- Glitch Effect --- */
@keyframes glitch {
    0% { text-shadow: 0.05em 0 0 red, -0.05em -0.025em 0 green, 0.025em 0.05em 0 blue; }
    15% { text-shadow: 0.05em 0 0 red, -0.05em -0.025em 0 green, 0.025em 0.05em 0 blue; }
    16% { text-shadow: -0.05em -0.025em 0 red, 0.025em 0.025em 0 green, -0.05em -0.05em 0 blue; }
    49% { text-shadow: -0.05em -0.025em 0 red, 0.025em 0.025em 0 green, -0.05em -0.05em 0 blue; }
    50% { text-shadow: 0.025em 0.05em 0 red, 0.05em 0 0 green, 0 -0.05em 0 blue; }
    99% { text-shadow: 0.025em 0.05em 0 red, 0.05em 0 0 green, 0 -0.05em 0 blue; }
    100% { text-shadow: -0.025em 0 0 red, -0.025em -0.025em 0 green, -0.025em -0.05em 0 blue; }
}

.aiw-glitch-effect {
    animation: glitch 1s linear infinite;
}

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