/**
 * Product Comparison Styles
 * CSS cho tính năng so sánh sản phẩm
 * 
 * @package SCode_Theme
 * @version 1.0.0
 */

/* Comparison Button */
.comparison-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #ff6600;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: none;
}

.comparison-button:hover {
    background: #e55a00;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 102, 0, 0.4);
}

.comparison-count {
    background: #ff0000;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
}

/* Add to Comparison Button */
.add-to-comparison {
    background: #ff6600;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.add-to-comparison:hover {
    background: #e55a00;
    transform: translateY(-1px);
}

.add-to-comparison.added {
    background: #28a745;
    cursor: default;
}

.add-to-comparison.added:hover {
    background: #28a745;
    transform: none;
}

/* Remove from Comparison Button */
.remove-from-comparison {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.remove-from-comparison:hover {
    background: #c82333;
}

/* Comparison Modal */
.comparison-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.comparison-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.comparison-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 95%;
    max-height: 90%;
    width: 1200px;
    display: flex;
    flex-direction: column;
}

.comparison-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.comparison-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 700;
}

.close-comparison-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-comparison-modal:hover {
    background: #f0f0f0;
    color: #333;
}

.comparison-modal-body {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.comparison-table-container {
    overflow-x: auto;
    max-height: 600px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 800px;
}

.comparison-table th,
.comparison-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.comparison-table .spec-name {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    min-width: 200px;
    position: sticky;
    left: 0;
    z-index: 5;
}

.comparison-table .product-header {
    background: #fff;
    text-align: center;
    min-width: 250px;
    vertical-align: top;
}

.comparison-table .product-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.comparison-table .product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.comparison-table .product-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    text-align: center;
    line-height: 1.4;
}

.comparison-table .product-price {
    font-size: 16px;
    font-weight: 700;
    color: #ff6600;
}

.comparison-table .spec-value {
    text-align: center;
    color: #666;
    font-size: 13px;
}

.comparison-table .group-header {
    background: #e9ecef;
    font-weight: 700;
    color: #495057;
    font-size: 16px;
}

.comparison-table .group-header td {
    padding: 15px 16px;
    border-bottom: 2px solid #dee2e6;
}

.comparison-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.clear-comparison {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.clear-comparison:hover {
    background: #c82333;
}

/* Notifications */
.comparison-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease;
}

.comparison-notification.success {
    background: #28a745;
}

.comparison-notification.error {
    background: #dc3545;
}

.comparison-notification.warning {
    background: #ffc107;
    color: #333;
}

.comparison-notification.info {
    background: #17a2b8;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .comparison-modal-content {
        width: 95%;
        max-height: 95%;
    }
    
    .comparison-table {
        font-size: 12px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 8px 12px;
    }
    
    .comparison-table .product-image {
        width: 60px;
        height: 60px;
    }
    
    .comparison-table .product-name {
        font-size: 12px;
    }
    
    .comparison-table .product-price {
        font-size: 14px;
    }
    
    .comparison-button {
        bottom: 10px;
        right: 10px;
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .comparison-modal-header {
        padding: 15px 20px;
    }
    
    .comparison-modal-header h3 {
        font-size: 20px;
    }
    
    .comparison-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .comparison-table .spec-name {
        min-width: 150px;
    }
    
    .comparison-table .product-header {
        min-width: 200px;
    }
}

/* Modal Open State */
body.modal-open {
    overflow: hidden;
}

/* Loading State */
.comparison-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #666;
}

.comparison-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #ff6600;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.comparison-empty {
    text-align: center;
    padding: 40px;
    color: #666;
}

.comparison-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.comparison-empty h4 {
    margin: 0 0 8px 0;
    color: #333;
}

.comparison-empty p {
    margin: 0;
    color: #666;
}
