/**
 * Styles pour le widget Metals Prices
 * Design moderne et responsive
 */

.metals-prices-widget-container {
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.metals-prices-widget-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.5px;
}

/* ============================================
   THEME SOMBRE (par défaut)
   ============================================ */
.metals-prices-theme-dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
}

.metals-prices-theme-dark .metals-prices-widget-title {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ============================================
   THEME CLAIR
   ============================================ */
.metals-prices-theme-light {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    color: #2c3e50;
}

.metals-prices-theme-light .metals-prices-widget-title {
    color: #2c3e50;
}

.metals-prices-theme-light .metal-card {
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* ============================================
   THEME OR
   ============================================ */
.metals-prices-theme-gold {
    background: linear-gradient(135deg, #2c1810 0%, #4a2c1a 100%);
    color: #f4e4c1;
}

.metals-prices-theme-gold .metals-prices-widget-title {
    color: #ffd700;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

/* ============================================
   CARTES DES MÉTAUX
   ============================================ */
.metals-prices-cards {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.metal-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 12px;
    align-items: center;
}

.metal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0.6;
}

.metal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   ICÔNE DU MÉTAL
   ============================================ */
.metal-icon {
    grid-row: 1 / 3;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.metal-icon svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.metal-card:hover .metal-icon {
    transform: rotate(360deg);
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   INFORMATIONS DU MÉTAL
   ============================================ */
.metal-info {
    grid-column: 2;
    grid-row: 1;
}

.metal-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
}

.metal-symbol {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   PRIX
   ============================================ */
.metal-price {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.metal-price .currency {
    font-size: 14px;
    opacity: 0.8;
}

.metal-price .amount {
    font-size: 24px;
    line-height: 1;
}

.metal-unit {
    grid-column: 2 / 4;
    grid-row: 2;
    text-align: right;
    font-size: 11px;
    opacity: 0.6;
    font-weight: 500;
}

/* ============================================
   COULEURS SPÉCIFIQUES PAR MÉTAL
   ============================================ */

/* OR */
.metal-gold {
    color: #ffd700;
}

.metal-gold::before {
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
}

.metal-gold .metal-icon {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 223, 0, 0.1));
}

.metal-gold .metal-icon svg {
    color: #ffd700;
}

/* ARGENT */
.metal-silver {
    color: #c0c0c0;
}

.metal-silver::before {
    background: linear-gradient(90deg, transparent, #c0c0c0, transparent);
}

.metal-silver .metal-icon {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.1));
}

.metal-silver .metal-icon svg {
    color: #c0c0c0;
}

/* PLATINE */
.metal-platinum {
    color: #e5e4e2;
}

.metal-platinum::before {
    background: linear-gradient(90deg, transparent, #e5e4e2, transparent);
}

.metal-platinum .metal-icon {
    background: linear-gradient(135deg, rgba(229, 228, 226, 0.2), rgba(229, 228, 226, 0.1));
}

.metal-platinum .metal-icon svg {
    color: #e5e4e2;
}

/* PALLADIUM */
.metal-palladium {
    color: #cbc4c0;
}

.metal-palladium::before {
    background: linear-gradient(90deg, transparent, #cbc4c0, transparent);
}

.metal-palladium .metal-icon {
    background: linear-gradient(135deg, rgba(203, 196, 192, 0.2), rgba(203, 196, 192, 0.1));
}

.metal-palladium .metal-icon svg {
    color: #cbc4c0;
}

/* ============================================
   HEURE DE MISE À JOUR
   ============================================ */
.metals-prices-update {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 12px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.metals-prices-update:hover {
    opacity: 1;
}

.update-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.metals-prices-theme-light .metals-prices-update {
    background: rgba(0, 0, 0, 0.03);
}

/* ============================================
   MESSAGE AUCUNE DONNÉE
   ============================================ */
.metals-prices-no-data {
    text-align: center;
    padding: 30px 20px;
    opacity: 0.7;
}

.metals-prices-no-data p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metal-card {
    animation: fadeInUp 0.5s ease backwards;
}

.metal-card:nth-child(1) { animation-delay: 0.1s; }
.metal-card:nth-child(2) { animation-delay: 0.2s; }
.metal-card:nth-child(3) { animation-delay: 0.3s; }
.metal-card:nth-child(4) { animation-delay: 0.4s; }

/* ============================================
   EFFET BRILLANCE SUR L'OR
   ============================================ */
.metal-gold .metal-price .amount {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 600px) {
    .metals-prices-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .metals-prices-cards {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Ajustement pour les petits écrans */
@media (max-width: 360px) {
    .metal-price .amount {
        font-size: 20px;
    }

    .metal-name {
        font-size: 16px;
    }

    .metal-icon {
        width: 40px;
        height: 40px;
    }

    .metal-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   EFFET DE PULSE SUR MISE À JOUR
   ============================================ */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.update-icon {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   STYLE POUR LA SIDEBAR
   ============================================ */
.widget .metals-prices-widget-container {
    margin: 0;
}

.widget .metals-prices-cards {
    grid-template-columns: 1fr;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .metals-prices-widget-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .metal-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .metal-card:hover {
        transform: none;
    }
}
