/**
 * Advanced Features Styles for Peptide-Compare.co.uk
 */

/* Filter Panel */
.filter-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.filter-header h3 {
    color: #667eea;
    font-size: 1.3em;
    margin: 0;
}

.toggle-filters-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.toggle-filters-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.filter-content {
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.filter-group {
    margin-bottom: 20px;
}

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

.filter-group input[type="checkbox"] {
    margin-right: 8px;
}

.price-range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-range-inputs input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
}

.price-range-inputs input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    background: white;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.apply-filters-btn,
.reset-filters-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.apply-filters-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.reset-filters-btn {
    background: #f0f0f0;
    color: #333;
}

.reset-filters-btn:hover {
    background: #e0e0e0;
}

/* Favorite Button */
.favorite-btn {
    background: white;
    border: 2px solid #ffc107;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.3em;
    color: #ffc107;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.favorite-btn:hover {
    transform: scale(1.15);
    background: #ffc107;
    color: white;
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.peptide-header {
    position: relative;
}

/* Recently Viewed */
.recently-viewed-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.recently-viewed-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.recently-viewed-item {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.recently-viewed-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.recently-viewed-item a {
    text-decoration: none;
    font-weight: 600;
}

.recently-viewed-item a:hover {
    text-decoration: underline;
}

/* Comparison Bar */
.comparison-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 3px solid #667eea;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
}

.comparison-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.comparison-items {
    display: flex;
    gap: 15px;
    flex: 1;
    overflow-x: auto;
}

.comparison-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    white-space: nowrap;
}

.comparison-item-name {
    font-weight: 600;
    color: #333;
}

.comparison-item-price {
    color: #667eea;
    font-weight: 700;
}

.remove-comparison-item {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.remove-comparison-item:hover {
    background: #c82333;
    transform: scale(1.1);
}

.comparison-actions {
    display: flex;
    gap: 10px;
}

.compare-now-btn,
.clear-comparison-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.compare-now-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.compare-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.clear-comparison-btn {
    background: #f0f0f0;
    color: #333;
}

.clear-comparison-btn:hover {
    background: #e0e0e0;
}

.add-to-compare-btn {
    width: 100%;
    padding: 10px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.add-to-compare-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Comparison Modal */
.comparison-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.comparison-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.comparison-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #f0f0f0;
}

.comparison-modal-header h2 {
    color: #667eea;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s;
}

.close-modal:hover {
    color: #333;
    transform: scale(1.1);
}

.comparison-table-container {
    padding: 30px;
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.comparison-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.comparison-table tr:hover {
    background: #f8f9fa;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.view-details-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.view-details-link:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-panel {
        padding: 15px;
    }

    .filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .price-range-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions {
        flex-direction: column;
    }

    .comparison-bar-content {
        flex-direction: column;
        align-items: stretch;
    }

    .comparison-items {
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .comparison-actions {
        width: 100%;
    }

    .compare-now-btn,
    .clear-comparison-btn {
        flex: 1;
    }

    .comparison-modal {
        padding: 10px;
    }

    .comparison-modal-header {
        padding: 15px;
    }

    .comparison-table-container {
        padding: 15px;
    }

    .comparison-table {
        font-size: 0.9em;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 10px;
    }

    .recently-viewed-list {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .favorite-btn {
        font-size: 1.2em;
    }

    .comparison-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .comparison-table {
        font-size: 0.8em;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 8px;
    }
}
