/* WP Comparator Frontend Styles */

.wp-comparator-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.comparator-header {
    text-align: center;
    margin-bottom: 30px;
}

.comparator-header h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #333;
}

.comparator-description {
    font-size: 1.1em;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Filtres */
.comparator-filters {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.comparator-filters h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: start;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-group label,
.checkbox-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.radio-group input,
.checkbox-group input {
    margin-right: 8px;
}

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 15px;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.results-count {
    font-weight: 600;
    color: #0073aa;
    font-size: 14px;
}

/* Grille des éléments */
.comparator-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.comparator-grid[data-columns="2"] {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.comparator-grid[data-columns="3"] {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.comparator-grid[data-columns="4"] {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.comparator-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comparator-item:hover {
    transform: translateY(-2px);
}

.item-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.item-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.item-header {
    text-align: center;
    margin-bottom: 15px;
}

.item-logo {
    margin-bottom: 10px;
}

.item-logo img {
    max-width: 120px;
    max-height: 60px;
    object-fit: contain;
}

.item-title {
    font-size: 1.3em;
    margin: 0;
    color: #333;
    font-weight: 600;
}

.item-description {
    flex-grow: 1;
    margin-bottom: 20px;
}

.item-description p {
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compare-checkbox {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.compare-checkbox:hover {
    background: #e9ecef;
}

.compare-checkbox input[type="checkbox"] {
    margin-right: 10px;
}

.checkmark {
    font-weight: 600;
    color: #0073aa;
}

.button-view-single,
.button-external,
.button-document {
    display: inline-block;
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.button-view-single {
    background: #0073aa;
    color: white;
}

.button-view-single:hover {
    background: #005a87;
    color: white;
}

.button-external {
    background: #28a745;
    color: white;
}

.button-external:hover {
    background: #218838;
    color: white;
}

.button-document {
    background: #dc3545;
    color: white;
}

.button-document:hover {
    background: #c82333;
    color: white;
}

/* Section de comparaison */
.comparison-section {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #0073aa;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,115,170,0.1);
}

.comparison-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.comparison-info h3 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 1.4em;
    font-weight: 600;
}

.selected-count {
    display: block;
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
}

.selection-help {
    display: block;
    color: #666;
    font-size: 0.95em;
    font-style: italic;
}

.comparison-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.button-large {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.button-large:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,115,170,0.3);
}

.button-large:disabled,
.button-large.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-primary,
.button-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button-primary,
.button-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button-primary {
    background: #0073aa;
    color: white;
}

.button-primary:hover {
    background: #005a87;
}

.button-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.button-secondary {
    background: #f1f1f1;
    color: #333;
}

.button-secondary:hover {
    background: #e1e1e1;
}

/* Messages d'état */
.no-items {
    text-align: center;
    font-size: 1.1em;
    color: #666;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Styles pour la page single */
.wp-comparator-single-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.item-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.item-header .item-logo img {
    max-width: 150px;
    max-height: 80px;
    margin-bottom: 15px;
}

.item-header .item-title {
    font-size: 2.2em;
    margin: 0 0 15px 0;
    color: #333;
}

.item-header .item-description {
    font-size: 1.1em;
    color: #666;
    max-width: 600px;
    margin: 0 auto 20px auto;
}

.item-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.category-section {
    margin-bottom: 40px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.category-title {
    background: #f8f9fa;
    margin: 0;
    padding: 20px;
    font-size: 1.4em;
    color: #333;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.fields-list {
    padding: 0;
}

.field-row {
    display: flex;
    border-bottom: 1px solid #f1f1f1;
    min-height: 60px;
}

.field-row:last-child {
    border-bottom: none;
}

.field-label {
    flex: 0 0 300px;
    padding: 20px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #333;
}

.field-value {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    color: #666;
    line-height: 1.5;
}

.field-more-info {
    margin-top: 10px;
}

.btn-more-info {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    padding: 0;
}

.btn-more-info:hover {
    color: #005a87;
}

.btn-more-info {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    padding: 0;
}

.more-info-content {
    display: none !important;
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.more-info-content.show {
    display: block !important;
}

/* Styles pour la page de comparaison */
.wp-comparator-compare-page .more-info-content {
    display: none;
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.wp-comparator-compare-page .more-info-content.show {
    display: block !important;
}

.wp-comparator-compare-page .btn-more-info {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    padding: 0;
    margin-top: 8px;
}

.wp-comparator-compare-page .btn-more-info:hover {
    color: #005a87;
}




.comparator-actions {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.button-back,
.button-compare {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    margin: 0 10px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.button-back {
    background: #6c757d;
    color: white;
}

.button-back:hover {
    background: #5a6268;
    color: white;
}

.button-compare {
    background: #28a745;
    color: white;
}

.button-compare:hover {
    background: #218838;
    color: white;
}

.no-data-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1em;
}

.info-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: #333;
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    line-height: 1.4;
    display: none;
}

.info-btn,
.info-btn-small {
    background: none;
    border: none;
    cursor: pointer;
    color: #0073aa;
    padding: 0;
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    justify-content: center;
    transition: all 0.2s ease;
}

.info-btn:hover,
.info-btn-small:hover {
    background: #0073aa;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-comparator-grid-container {
        padding: 15px;
    }
    
    .comparator-header h2 {
        font-size: 2em;
    }
    
    .filters-form {
        grid-template-columns: 1fr;
    }
    
    .comparator-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .comparison-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .button-large {
        width: 100%;
        justify-content: center;
    }
    
    .item-actions {
        gap: 8px;
    }
    
    .button-view-single,
    .button-external,
    .button-document {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .field-row {
        flex-direction: column;
    }
    
    .field-label {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .field-value {
        flex: none;
    }
    
    .item-header .item-title {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .item-card {
        padding: 15px;
    }
    
    .item-title {
        font-size: 1.1em;
    }
    
    .comparison-section {
        margin-top: 20px;
        padding: 20px 15px;
    }
}