/* Styles pour le frontend du plugin MAX */

/* ========================================
   LAYOUT PRINCIPAL - Page non-scrollable
   ======================================== */

/* S'assurer que la page ne soit pas scrollable */
body.max-no-scroll {
    overflow: hidden;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Container principal pour carrousel + ticker */
.max-fullscreen-layout {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Zone carrousel (85vh) */
.max-carousel-zone {
    height: 85vh;
    flex-shrink: 0;
    overflow: hidden;
}

/* Zone ticker (15vh) */
.max-ticker-zone {
    height: 15vh;
    flex-shrink: 0;
    position: relative;
    z-index: 1000;
}

/* ========================================
   NEWS TICKER - Zone bas de page (15%)
   ======================================== */

.max-news-ticker-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-top: 3px solid #ffd700;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
}

/* Mode standalone (sans cohabitation) */
.max-news-ticker-container.max-standalone {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 15vh;
}

.max-news-ticker-wrapper {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.max-news-ticker-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
}

.max-news-ticker-item {
    display: inline-flex;
    align-items: center;
    margin-right: 60px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.max-news-ticker-item:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
}

.max-news-ticker-icon {
    margin-right: 10px;
    font-size: 18px;
    color: #ffd700;
}

.max-news-ticker-price {
    font-weight: 700;
    color: #ffd700;
    margin-left: 8px;
}

.max-news-ticker-change {
    margin-left: 8px;
    font-size: 14px;
    font-weight: 600;
}

.max-news-ticker-change.positive {
    color: #00ff88;
}

.max-news-ticker-change.negative {
    color: #ff4757;
}

.max-news-ticker-change.neutral {
    color: #a4b0be;
}

/* Animation de défilement */
.max-news-ticker-scrolling {
    animation: scroll-left 60s linear infinite;
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Pause au survol */
.max-news-ticker-container:hover .max-news-ticker-scrolling {
    animation-play-state: paused;
}

/* Indicateur de statut */
.max-news-ticker-status {
    position: absolute;
    top: 10px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 12px;
    opacity: 0.8;
}

.max-news-ticker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    animation: pulse 2s infinite;
}

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

/* Thèmes supplémentaires pour le news ticker */
.max-ticker-theme-light {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #e9ecef 100%);
    border-top-color: #007bff;
    color: #333333;
}

.max-ticker-theme-light .max-news-ticker-item {
    background: rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.3);
    color: #333333;
    text-shadow: none;
}

.max-ticker-theme-light .max-news-ticker-item:hover {
    background: rgba(0, 123, 255, 0.2);
    border-color: rgba(0, 123, 255, 0.6);
}

.max-ticker-theme-light .max-news-ticker-icon {
    color: #007bff;
}

.max-ticker-theme-light .max-news-ticker-price {
    color: #007bff;
}

.max-ticker-theme-light .max-news-ticker-status {
    color: #333333;
}

.max-ticker-theme-gold {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    border-top-color: #ffd700;
    box-shadow: 0 -5px 20px rgba(255, 215, 0, 0.2);
}

.max-ticker-theme-gold .max-news-ticker-item {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.1);
}

.max-ticker-theme-gold .max-news-ticker-item:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.7);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.max-ticker-theme-gold .max-news-ticker-icon {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.max-ticker-theme-gold .max-news-ticker-price {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.max-ticker-theme-gold .max-news-ticker-dot {
    background: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Responsive pour le news ticker */
@media (max-width: 768px) {
    .max-news-ticker-container {
        height: 12vh;
    }
    
    .max-news-ticker-item {
        font-size: 14px;
        padding: 6px 15px;
        margin-right: 40px;
    }
    
    .max-news-ticker-icon {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .max-news-ticker-container {
        height: 10vh;
    }
    
    .max-news-ticker-item {
        font-size: 12px;
        padding: 4px 12px;
        margin-right: 30px;
    }
    
    .max-news-ticker-status {
        font-size: 10px;
        right: 10px;
    }
}

/* ========================================
   CARROUSEL - Zone principale (85%)
   ======================================== */

/* Carrousel limité à 85vh (cohabitation avec news ticker) */
.max-carousel-container {
    position: relative;
    margin: 0 auto;
    background: #0f172a; /* slate-900 */
    color: #fff;
    overflow: hidden;
    max-height: 85vh;
    height: 85vh;
}

/* Mode cohabitation : carrousel + ticker */
.max-carousel-container.max-cohabitation-mode {
    height: 85vh !important;
    max-height: 85vh !important;
    width: 100% !important;
    position: relative;
    margin: 0;
    border-radius: 0;
}

/* Layout complet pour cohabitation */
.max-fullscreen-layout .max-carousel-container {
    height: 85vh;
    max-height: 85vh;
    width: 100%;
    margin: 0;
}

/* Styles spécifiques pour la cohabitation */
.max-cohabitation-mode .max-swiper {
    height: 100%;
}

.max-cohabitation-mode .max-tiles-grid {
    height: 100%;
    padding: 20px;
}

/* S'assurer qu'il n'y a pas de scroll */
body.max-no-scroll,
html.max-no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Layout flex pour cohabitation parfaite */
.max-fullscreen-layout {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
}

.max-carousel-zone {
    flex: 0 0 85vh !important;
    height: 85vh !important;
    overflow: hidden !important;
}

.max-ticker-zone {
    flex: 0 0 15vh !important;
    height: 15vh !important;
    overflow: hidden !important;
}

.max-swiper {
    width: 100%;
    height: 100%;
}

.max-tiles-grid {
    display: grid;
    grid-template-columns: repeat(var(--max-cols, 4), 1fr);
    grid-template-rows: repeat(var(--max-rows, 2), 1fr);
    gap: var(--max-gap, 16px);
    width: 100%;
    height: 100%;
    padding: 24px;
    box-sizing: border-box;
}

.max-tile {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.max-tile-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.max-tile-meta {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 12px;
}

.max-tile-prices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
}

.max-tile-international {
    background: #3b82f6;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 4px;
}

.max-tile-buy { 
    color: #22c55e; 
    background: rgba(34, 197, 94, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.max-tile-sell { 
    color: #f97316; 
    background: rgba(249, 115, 22, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.swiper-button-prev, .swiper-button-next {
    color: #fff;
}

.swiper-pagination-bullet { background: rgba(255,255,255,0.6); }
.swiper-pagination-bullet-active { background: #fff; }

/* Thèmes */
.max-theme-dark { background: #0f172a; color: #fff; }
.max-theme-clean { background: #ffffff; color: #0f172a; }
.max-theme-glass { background: radial-gradient(ellipse at top, #0b1020 0%, #0f172a 60%, #0b1020 100%); color: #ffffff; }
.max-theme-clean .max-tile { background: #fff; border: 1px solid #e5e7eb; }
.max-theme-clean .swiper-button-prev, .max-theme-clean .swiper-button-next { color: #0f172a; }
.max-theme-clean .swiper-pagination-bullet { background: rgba(0,0,0,0.4); }
.max-theme-clean .swiper-pagination-bullet-active { background: #0f172a; }

/* Cours des métaux */
.max-metal-prices-table,
.max-gold-carat-prices-table,
.max-products-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.max-metal-prices-table th,
.max-gold-carat-prices-table th,
.max-products-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.max-metal-prices-table td,
.max-gold-carat-prices-table td,
.max-products-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.max-metal-prices-table tr:hover td,
.max-gold-carat-prices-table tr:hover td,
.max-products-table tr:hover td {
    background-color: #f8f9fa;
}

.max-price {
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
}

/* Cartes */
.max-metal-prices-cards,
.max-gold-carat-prices-cards,
.max-products-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.max-metal-card,
.max-gold-card,
.max-product-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.max-metal-card::before,
.max-gold-card::before,
.max-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.max-metal-card:hover,
.max-gold-card:hover,
.max-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.max-metal-card h3,
.max-gold-card h3,
.max-product-card h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.max-metal-card .max-price,
.max-gold-card .max-price,
.max-product-card .max-price {
    font-size: 24px;
    font-weight: bold;
    color: #27ae60;
}

.max-purity {
    font-size: 14px;
    color: #7f8c8d;
    margin: 5px 0;
}

/* Couleurs spécifiques par métal */
.max-metal-gold .max-price {
    color: #f39c12;
}

.max-metal-silver .max-price {
    color: #95a5a6;
}

.max-metal-platinum .max-price {
    color: #e74c3c;
}

.max-gold-24k .max-price {
    color: #f39c12;
}

.max-gold-22k .max-price {
    color: #e67e22;
}

.max-gold-18k .max-price {
    color: #d35400;
}

.max-gold-14k .max-price {
    color: #c0392b;
}

.max-gold-9k .max-price {
    color: #a93226;
}

/* Listes */
.max-metal-prices-list,
.max-gold-carat-prices-list,
.max-products-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.max-metal-item,
.max-gold-item,
.max-product-item {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.max-metal-item:hover,
.max-gold-item:hover,
.max-product-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.max-metal-name,
.max-gold-carat,
.max-product-name {
    font-weight: 600;
    color: #2c3e50;
}

.max-product-details {
    color: #7f8c8d;
    font-size: 14px;
}

/* Informations produit */
.max-product-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.max-category,
.max-material,
.max-weight {
    background: #ecf0f1;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: #2c3e50;
}

.max-product-prices {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.max-buy-price,
.max-sell-price {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.max-buy-price {
    background: #e8f5e8;
    color: #27ae60;
}

.max-sell-price {
    background: #fdeaea;
    color: #e74c3c;
}

/* Timestamp */
.max-timestamp {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    font-size: 12px;
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .max-metal-prices-cards,
    .max-gold-carat-prices-cards,
    .max-products-cards {
        grid-template-columns: 1fr;
    }
    
    .max-metal-prices-table,
    .max-gold-carat-prices-table,
    .max-products-table {
        font-size: 14px;
    }
    
    .max-metal-prices-table th,
    .max-gold-carat-prices-table th,
    .max-products-table th,
    .max-metal-prices-table td,
    .max-gold-carat-prices-table td,
    .max-products-table td {
        padding: 10px;
    }
    
    .max-product-prices {
        flex-direction: column;
        gap: 8px;
    }
    
    .max-metal-item,
    .max-gold-item,
    .max-product-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .max-metal-card,
    .max-gold-card,
    .max-product-card {
        padding: 15px;
    }
    
    .max-metal-card h3,
    .max-gold-card h3,
    .max-product-card h3 {
        font-size: 16px;
    }
    
    .max-metal-card .max-price,
    .max-gold-card .max-price,
    .max-product-card .max-price {
        font-size: 20px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.max-metal-prices-table,
.max-gold-carat-prices-table,
.max-products-table,
.max-metal-prices-cards,
.max-gold-carat-prices-cards,
.max-products-cards,
.max-metal-prices-list,
.max-gold-carat-prices-list,
.max-products-list {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading state */
.max-loading {
    position: relative;
    opacity: 0.6;
}

.max-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Styles pour les images du carrousel */
.max-tile-image {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.max-tile-image.max-tile-no-image {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
}

.max-product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}

.max-tile:hover .max-product-img {
    transform: scale(1.05);
}

.max-placeholder-icon {
    font-size: 48px;
    color: #6c757d;
    opacity: 0.6;
}

/* Responsive pour les images */
@media (max-width: 768px) {
    .max-tile-image {
        height: 100px;
    }
    
    .max-placeholder-icon {
        font-size: 36px;
    }
}

/* Thème sombre pour les images */
.max-theme-dark .max-tile-image {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

.max-theme-dark .max-tile-image.max-tile-no-image {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-color: rgba(255, 255, 255, 0.2);
}

.max-theme-dark .max-placeholder-icon {
    color: #bdc3c7;
}

/* Thème glass pour les images */
.max-theme-glass .max-tile-image {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.max-theme-glass .max-tile-image.max-tile-no-image {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

