/* ============================================================
   PROFESSIONAL COMPARISON FEATURE STYLES
   For Phones, Laptops, and Accessories Comparison
   ============================================================ */

/* ===== COMPARISON BAR (Bottom of screen) ===== */
.comparison-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transform: translateY(0);
    transition: transform 0.3s ease;
    padding: 15px 0;
}

.comparison-bar.hidden {
    transform: translateY(100%);
}

.comparison-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.comparison-items {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.comparison-item-slot {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.empty-slot {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.empty-slot i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
    color: rgba(255, 255, 255, 0.4);
}

.empty-slot span {
    font-size: 13px;
    display: block;
}

.selected-product {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.selected-product img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    background: white;
}

.selected-product .product-info {
    flex: 1;
    min-width: 0;
}

.selected-product h4 {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-product p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.remove-product {
    background: rgba(255, 59, 48, 0.2);
    border: none;
    color: #ff3b30;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.remove-product:hover {
    background: #ff3b30;
    color: white;
    transform: scale(1.1);
}

.comparison-vs {
    font-weight: 700;
    font-size: 18px;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    flex-shrink: 0;
}

.comparison-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.btn-compare,
.btn-clear {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-compare {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-compare:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.btn-compare:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-clear {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-clear:hover {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

/* ===== COMPARISON CHECKBOX (on product cards) ===== */
.comparison-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.comparison-checkbox input[type="checkbox"] {
    display: none;
}

.comparison-checkbox label {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.comparison-checkbox label:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    transform: scale(1.05);
}

.comparison-checkbox input:checked + label {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    border-color: #00d4ff;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.comparison-checkbox label i {
    font-size: 14px;
}

/* ===== COMPARISON MODAL ===== */
.comparison-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.comparison-modal.active {
    display: flex;
}

.comparison-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.comparison-modal-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px 20px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.comparison-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.comparison-modal-header h2 i {
    color: #00d4ff;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
}

.modal-close:hover {
    background: rgba(255, 59, 48, 0.8);
    transform: rotate(90deg);
}

.comparison-modal-body {
    padding: 30px;
}

/* ===== LOADING STATE ===== */
.loading-comparison {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-comparison p {
    font-size: 16px;
    color: #333;
    margin: 10px 0;
    font-weight: 600;
}

.loading-comparison small {
    color: #999;
    font-size: 13px;
}

/* ===== PRODUCT HEADER CARDS ===== */
.comparison-products-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    margin-bottom: 40px;
    align-items: center;
}

.product-header-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.product-header-card img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 12px;
    background: white;
    padding: 15px;
    margin-bottom: 15px;
}

.product-header-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px 0;
}

.product-header-card .brand-name {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 15px 0;
    font-weight: 500;
}

.price-badge {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 22px;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.vs-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(238, 90, 111, 0.3);
}

.vs-badge i {
    font-size: 20px;
    margin-bottom: 4px;
}

.vs-badge span {
    font-size: 16px;
}

/* ===== SECTION TITLES ===== */
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 30px 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #00d4ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #00d4ff;
    font-size: 22px;
}

/* ===== COMPARISON TABLE ===== */
.comparison-table-container {
    margin-bottom: 30px;
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.comparison-table thead {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
}

.comparison-table th {
    padding: 18px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-table th:first-child {
    border-radius: 12px 0 0 0;
}

.comparison-table th:last-child {
    border-radius: 0 12px 0 0;
}

.comparison-table tbody tr {
    transition: background-color 0.2s;
}

.comparison-table tbody tr:hover {
    background-color: rgba(0, 212, 255, 0.05);
}

.comparison-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.comparison-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.spec-label {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spec-label i {
    color: #00d4ff;
    width: 20px;
    text-align: center;
}

.different-value {
    background-color: rgba(255, 193, 7, 0.1);
    font-weight: 600;
    color: #1a1a2e;
    position: relative;
}

.different-value::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #ffc107;
}

.same-value {
    color: #6c757d;
}

.not-available {
    color: #adb5bd;
    font-style: italic;
}

.badge-success {
    background: #28a745;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-danger {
    background: #dc3545;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ===== DETAILED ANALYSIS SECTIONS ===== */
.analysis-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 5px solid #00d4ff;
}

.analysis-section h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analysis-section h4 i {
    color: #00d4ff;
}

.analysis-section p {
    color: #495057;
    line-height: 1.7;
    margin: 0 0 12px 0;
}

.analysis-section ul {
    margin: 15px 0;
    padding-left: 25px;
}

.analysis-section li {
    color: #495057;
    line-height: 1.7;
    margin-bottom: 8px;
}

.analysis-section strong {
    color: #1a1a2e;
    font-weight: 600;
}

/* ===== PRICE ANALYSIS ===== */
.price-comparison-section {
    margin-bottom: 30px;
}

.price-analysis-grid {
    display: grid;
    gap: 20px;
}

.price-winner,
.price-equal {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.price-winner i,
.price-equal i {
    font-size: 32px;
    color: #28a745;
    margin-bottom: 10px;
    display: block;
}

.price-winner h4,
.price-equal h4 {
    font-size: 18px;
    font-weight: 700;
    color: #155724;
    margin: 0 0 10px 0;
}

.price-winner p,
.price-equal p {
    font-size: 15px;
    color: #155724;
    margin: 0;
    line-height: 1.6;
}

/* ===== RECOMMENDATION ===== */
.recommendation-section {
    margin-bottom: 30px;
}

.recommendation-content {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 16px;
    padding: 25px;
}

.winner-badge {
    text-align: center;
    padding: 20px;
}

.winner-badge i {
    font-size: 48px;
    color: #ffc107;
    margin-bottom: 15px;
    display: block;
}

.winner-badge h4 {
    font-size: 22px;
    font-weight: 700;
    color: #856404;
    margin: 0 0 12px 0;
}

.winner-badge p {
    font-size: 15px;
    color: #856404;
    margin: 0;
    line-height: 1.7;
}

.neutral-recommendation {
    text-align: center;
    padding: 20px;
}

.neutral-recommendation i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 15px;
    display: block;
}

.neutral-recommendation h4 {
    font-size: 22px;
    font-weight: 700;
    color: #495057;
    margin: 0 0 12px 0;
}

.neutral-recommendation p {
    font-size: 15px;
    color: #6c757d;
    margin: 0;
    line-height: 1.7;
}

.disclaimer {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: #495057;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.disclaimer i {
    color: #00d4ff;
}

/* ===== ACTION BUTTONS ===== */
.comparison-actions-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.btn-new-comparison,
.btn-close-comparison {
    padding: 14px 28px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.btn-new-comparison {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-new-comparison:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.btn-close-comparison {
    background: #6c757d;
    color: white;
}

.btn-close-comparison:hover {
    background: #5a6268;
}

/* ===== ERROR STATE ===== */
.error-message {
    text-align: center;
    padding: 60px 20px;
}

.error-message i {
    font-size: 60px;
    color: #dc3545;
    margin-bottom: 20px;
    display: block;
}

.error-message h3 {
    font-size: 24px;
    color: #1a1a2e;
    margin: 0 0 10px 0;
}

.error-message p {
    color: #6c757d;
    margin: 0 0 25px 0;
}

.btn-retry {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .comparison-bar-content {
        flex-direction: column;
        gap: 15px;
    }

    .comparison-items {
        flex-direction: column;
        width: 100%;
    }

    .comparison-item-slot {
        max-width: 100%;
    }

    .comparison-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn-compare,
    .btn-clear {
        width: 100%;
        justify-content: center;
    }

    .comparison-products-header {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .vs-badge {
        width: 50px;
        height: 50px;
        margin: 0 auto;
    }

    .comparison-table {
        font-size: 13px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 12px 10px;
    }

    .product-header-card img {
        width: 120px;
        height: 120px;
    }

    .comparison-modal-header h2 {
        font-size: 18px;
    }

    .section-title {
        font-size: 18px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== SMOOTH SCROLLING ===== */
.comparison-modal-content {
    scroll-behavior: smooth;
}

.comparison-modal-content::-webkit-scrollbar {
    width: 8px;
}

.comparison-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.comparison-modal-content::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 4px;
}

.comparison-modal-content::-webkit-scrollbar-thumb:hover {
    background: #0099ff;
}