/**
 * Styles frontend pour KeepaPlugin
 */

/* Tableau de comparaison */
.gau-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

.gau-comparison-table thead,
.gau-comparison-table tbody,
.gau-comparison-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.gau-comparison-table th,
.gau-comparison-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
}

.gau-comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.gau-comparison-table tr:nth-child(even) {
    background: #f8f9fa;
}

/* Style minimal */
.gau-comparison-table-minimal {
    border: none;
}

.gau-comparison-table-minimal th,
.gau-comparison-table-minimal td {
    border: none;
    border-bottom: 1px solid #eee;
    padding: 8px 0;
}

.gau-comparison-table-minimal th {
    background: transparent;
    font-weight: 500;
    color: #666;
}

/* Style coloré */
.gau-comparison-table-colorful th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.gau-comparison-table-colorful tr:nth-child(even) {
    background: #f0f2ff;
}

.gau-comparison-table-colorful tr:hover {
    background: #e8ebff;
}

/* Tendance */
.trend-up {
    color: #d63384;
    font-weight: bold;
}

.trend-down {
    color: #198754;
    font-weight: bold;
}

.trend-stable {
    color: #6c757d;
}

/* Bloc news-prix */
.mt-price-trends {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mt-price-trends-title {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.mt-price-trends-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mt-section-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.mt-section-title.decreases {
    color: #198754;
}

.mt-section-title.increases {
    color: #d63384;
}

.mt-trends-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mt-trend-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    line-height: 1.4;
}

/* Liens de description cliquables */
.mt-description-link {
    color: inherit;
    text-decoration: none;
    display: block;
    padding: 4px 0;
    transition: all 0.2s ease;
}

.mt-description-link:hover {
    color: #0073aa;
    text-decoration: underline;
    transform: translateX(2px);
}

.mt-description-link:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    border-radius: 2px;
}

.mt-trend-item:last-child {
    border-bottom: none;
}

.mt-trend-item.decrease {
    color: #198754;
}

.mt-trend-item.increase {
    color: #d63384;
}

/* Wrapper du tableau */
.keepaplugin-comparison-wrapper {
    margin: 20px 0;
}

.keepaplugin-table-title {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* Responsive design */
@media screen and (max-width: 768px) {
    .gau-comparison-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
    }
    
    .gau-comparison-table th,
    .gau-comparison-table td {
        padding: 8px 6px;
        min-width: 80px;
    }
    
    /* Colonnes spécifiques pour mobile */
    .gau-comparison-table th:nth-child(1),
    .gau-comparison-table td:nth-child(1) {
        width: 25%; /* Modèle */
        min-width: 100px;
    }
    
    .gau-comparison-table th:nth-child(2),
    .gau-comparison-table td:nth-child(2) {
        width: 35%; /* Robustesse */
        min-width: 120px;
    }
    
    .gau-comparison-table th:nth-child(3),
    .gau-comparison-table td:nth-child(3) {
        width: 25%; /* Autonomie */
        min-width: 100px;
    }
    
    .gau-comparison-table th:nth-child(4),
    .gau-comparison-table td:nth-child(4) {
        width: 15%; /* Prix */
        min-width: 80px;
        font-weight: 600;
        color: #2271b1;
    }
    
    .mt-price-trends {
        padding: 15px;
        margin: 15px 0;
    }
    
    .mt-price-trends-title {
        font-size: 16px;
    }
    
    .mt-section-title {
        font-size: 14px;
    }
    
    .mt-trend-item {
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .gau-comparison-table {
        font-size: 11px;
    }
    
    .gau-comparison-table th,
    .gau-comparison-table td {
        padding: 6px 4px;
    }
    
    .gau-comparison-table th:nth-child(1),
    .gau-comparison-table td:nth-child(1) {
        width: 30%;
        min-width: 90px;
    }
    
    .gau-comparison-table th:nth-child(2),
    .gau-comparison-table td:nth-child(2) {
        width: 40%;
        min-width: 110px;
    }
    
    .gau-comparison-table th:nth-child(3),
    .gau-comparison-table td:nth-child(3) {
        width: 20%;
        min-width: 80px;
    }
    
    .gau-comparison-table th:nth-child(4),
    .gau-comparison-table td:nth-child(4) {
        width: 10%;
        min-width: 70px;
    }
    
    .mt-price-trends {
        padding: 12px;
    }
    
    .mt-price-trends-title {
        font-size: 15px;
    }
    
    .mt-trend-item {
        font-size: 12px;
    }
}

/* Animations */
.mt-trend-item {
    transition: all 0.3s ease;
}

.mt-trend-item:hover {
    transform: translateX(5px);
}

.gau-comparison-table tr {
    transition: background-color 0.2s ease;
}

/* Liens d'affiliation */
.gau-comparison-table a,
.mt-trend-item a {
    text-decoration: none;
    color: inherit;
    border-bottom: 1px dotted currentColor;
}

.gau-comparison-table a:hover,
.mt-trend-item a:hover {
    border-bottom-style: solid;
}
