/* ==========================================================================
   ECOPHOT - SYSTÈME DE BADGES ET STATUTS UNIFIÉ
   Fichier: 03-components/badges.css
   ========================================================================== */

/* ==========================================================================
   BADGES DE BASE
   ========================================================================== */

.badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
    margin: 5px;
    text-align: center;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ==========================================================================
   BADGES PAR COULEUR
   ========================================================================== */

.badge-primary {
    background-color: var(--primary);
    color: white;
}

.badge-secondary {
    background-color: var(--medium);
    color: var(--dark);
}

.badge-accent {
    background-color: var(--accent);
    color: white;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #333;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-light {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.badge-dark {
    background-color: #343a40;
    color: white;
}

/* ==========================================================================
   BADGES SPÉCIALISÉS
   ========================================================================== */

.innovation-badge {
    background-color: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(251, 188, 5, 0.3);
}

.french-badge {
    background-color: #ff4444;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--accent);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    z-index: 2;
    font-weight: bold;
    text-transform: uppercase;
    animation: badgePulse 2s infinite;
}

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

/* ==========================================================================
   BADGES DE STATUT
   ========================================================================== */

.status-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    display: inline-block;
    margin: 2px;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-progress {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-development {
    background-color: #6c757d;
    color: white;
}

.status-testing {
    background-color: #28a745;
    color: white;
}

.status-service {
    background-color: #023d78;
    color: white;
}

.status-available {
    background-color: #17a2b8;
    color: white;
}

.status-ce {
    background-color: #ffc107;
    color: #333;
}

.status-published {
    background-color: #d4edda;
    color: #155724;
}

.status-coming {
    background-color: #fff3cd;
    color: #856404;
}

.status-in-progress {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ==========================================================================
   BADGES DE PRIX ET ÉCONOMIES
   ========================================================================== */

.price-badge {
    background: linear-gradient(135deg, var(--accent), #f39c12);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(251, 188, 5, 0.3);
    margin-bottom: 1.5rem;
    font-weight: bold;
    display: inline-block;
}

/* ==========================================================================
   BADGES DE PERFORMANCE ET TECHNIQUE
   ========================================================================== */

.performance-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-block;
}

.badge-basic {
    background-color: #ffc107;
    color: #333;
}

.badge-good {
    background-color: var(--primary);
    color: white;
}

.badge-excellent {
    background-color: #34a853;
    color: white;
}

.badge-latest {
    background: linear-gradient(45deg, #34a853, #2e7d32);
    color: white;
}

.badge-popular {
    background: linear-gradient(45deg, var(--primary), #0d47a1);
    color: white;
}

.badge-legacy {
    background: linear-gradient(45deg, #ff9800, #f57c00);
    color: white;
}

/* ==========================================================================
   BADGES DE COMPOSANTS ET SYSTÈMES
   ========================================================================== */

.component-badge {
    background: linear-gradient(45deg, var(--primary), #0d47a1);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-badge {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
    margin: 10px 0;
    text-transform: uppercase;
}

.version-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   BADGES DE PROTOCOLES
   ========================================================================== */

.protocol-badge {
    background: linear-gradient(45deg, #1e7e34, #27ae60);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    margin: 2px;
    display: inline-block;
}

.protocol-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

/* Badges spécialisés par protocole */
.wifi-badge {
    background: linear-gradient(45deg, #2196F3, #03A9F4);
}

.bluetooth-badge {
    background: linear-gradient(45deg, #3F51B5, #5C6BC0);
}

.uart-badge {
    background: linear-gradient(45deg, #FF9800, #FFA726);
    color: #333;
}

.spi-badge {
    background: linear-gradient(45deg, #4CAF50, #66BB6A);
}

.i2c-badge {
    background: linear-gradient(45deg, #9C27B0, #BA68C8);
}

/* ==========================================================================
   BADGES DE TARIFICATION
   ========================================================================== */

.quantity-badge {
    font-size: 2em;
    color: #007bff;
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
}

.power-rating-badge {
    font-size: 2em;
    font-weight: bold;
    color: #007bff;
    margin: 10px 0;
    display: block;
}

.discount-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

/* ==========================================================================
   BADGES DE RECOMMANDATION
   ========================================================================== */

.recommended-badge {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    animation: recommendedGlow 2s ease-in-out infinite alternate;
}

@keyframes recommendedGlow {
    from {
        box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    }
    to {
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
    }
}

.recommended-badge::before {
    content: "⭐";
    margin-right: 5px;
}

/* ==========================================================================
   BADGES DE CERTIFICATION
   ========================================================================== */

.certification-badge {
    background: linear-gradient(45deg, #6f42c1, #8f5fe8);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(111, 66, 193, 0.3);
}

.ce-badge {
    background: linear-gradient(45deg, #ffc107, #ffca28);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    border: 2px solid #ff8f00;
}

/* ==========================================================================
   CONTENEURS DE BADGES
   ========================================================================== */

.badge-container {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
    align-items: center;
}

.status-container {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

/* ==========================================================================
   BADGES AVEC ICÔNES
   ========================================================================== */

.badge-with-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 500;
    font-size: 0.85rem;
}

.badge-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ==========================================================================
   BADGES DE TAILLE VARIABLE
   ========================================================================== */

.badge-sm {
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 10px;
}

.badge-md {
    padding: 5px 12px;
    font-size: 0.85rem;
    border-radius: 15px;
}

.badge-lg {
    padding: 8px 20px;
    font-size: 1rem;
    border-radius: 25px;
}

.badge-xl {
    padding: 12px 30px;
    font-size: 1.2rem;
    border-radius: 30px;
}

/* ==========================================================================
   BADGES ANIMÉS
   ========================================================================== */

.badge-animated {
    animation: badgeBounce 1s ease-in-out infinite;
}

@keyframes badgeBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

.badge-pulse {
    animation: badgePulseStrong 2s ease-in-out infinite;
}

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

.badge-glow {
    animation: badgeGlow 2s ease-in-out infinite alternate;
}

@keyframes badgeGlow {
    from {
        box-shadow: 0 0 10px rgba(26, 115, 232, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(26, 115, 232, 0.8);
    }
}

/* ==========================================================================
   BADGES DE POSITION
   ========================================================================== */

.badge-top-right {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

.badge-top-left {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
}

.badge-bottom-right {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 5;
}

.badge-bottom-left {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 5;
}

/* ==========================================================================
   BADGES DE NOTIFICATION
   ========================================================================== */

.notification-badge {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    padding: 0;
}

.notification-dot {
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 2px;
    animation: notificationPulse 1.5s ease-in-out infinite;
}

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

/* ==========================================================================
   BADGES DE PROGRESSION
   ========================================================================== */

.progress-badge {
    background: linear-gradient(90deg, #28a745 var(--progress, 0%), #e9ecef var(--progress, 0%));
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.progress-badge::after {
    content: attr(data-progress);
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #666;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .badge-container {
        justify-content: center;
    }
    
    .badge-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .protocol-badges {
        justify-content: center;
    }
    
    .badge,
    .status-badge,
    .performance-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    
    .badge-lg {
        padding: 6px 16px;
        font-size: 0.9rem;
    }
    
    .badge-xl {
        padding: 8px 20px;
        font-size: 1rem;
    }
    
    .featured-badge {
        top: 10px;
        right: 10px;
        font-size: 0.75rem;
        padding: 5px 8px;
    }
}

@media (max-width: 480px) {
    .badge-container {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .protocol-badges {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .badge,
    .status-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    .innovation-badge,
    .demo-badge,
    .component-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .recommended-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .quantity-badge,
    .power-rating-badge {
        font-size: 1.5em;
    }
}

/* ==========================================================================
   THÈMES SPÉCIALISÉS
   ========================================================================== */

/* Badges pour thème Matrix */
.matrix-badge {
    background: linear-gradient(45deg, #000000, #003300);
    color: #00ff00;
    border: 1px solid #00ff00;
    text-shadow: 0 0 5px #00ff00;
    font-family: 'Courier New', monospace;
}

/* Badges pour thème Astro */
.astro-badge {
    background: linear-gradient(45deg, #0a1a2e, #16213e);
    color: #ffd700;
    border: 1px solid #ffd700;
    text-shadow: 0 0 5px #ffd700;
}

/* Badges pour thème Vintage */
.vintage-badge {
    background: linear-gradient(45deg, #8b4513, #a0522d);
    color: #f5f5dc;
    border: 1px solid #daa520;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

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

/* Amélioration du contraste pour l'accessibilité */
.badge[aria-label] {
    cursor: help;
}

/* Focus visible pour les badges interactifs */
.badge:focus,
button.badge:focus,
a.badge:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Indication pour les lecteurs d'écran */
.sr-only-badge {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .badge,
    .status-badge,
    .performance-badge,
    .protocol-badge {
        background: transparent !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .featured-badge,
    .notification-badge,
    .notification-dot {
        display: none !important;
    }
    
    .badge-animated,
    .badge-pulse,
    .badge-glow {
        animation: none !important;
    }
}

/* ==========================================================================
   DIAGRAMMES ET COMPATIBILITÉ
   ========================================================================== */
.diagram-container {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.diagram {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 20px;
    margin: 40px 0;
}

.diagram-block {
    background-color: #f5f9ff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.diagram-block h4 {
    color: var(--astro-blue);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.diagram-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: #1a73e8;
}

.diagram-arrow.down {
    grid-column: span 3;
    transform: rotate(90deg);
}

.compatibility-section {
    margin-bottom: 40px;
}

.compatibility-section h4 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--medium);
    padding-bottom: 5px;
}

.compatibility-item {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.compatibility-check {
    background-color: var(--secondary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 20px;
    font-weight: bold;
}

.compatibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.connection-diagram {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.connector-list {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin: 20px 0;
}

.connector-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px;
    margin: 5px;
    text-align: center;
    min-width: 100px;
}