/**
 * Enhanced Comparison Styles - PhoneArena Inspired
 * 
 * Professional side-by-side comparison layout with:
 * - Clean table design
 * - Visual comparisons
 * - Difference highlighting
 * - Responsive layout
 * 
 * @package TechMansion
 * @version 6.2.0
 */

/* ================================
   COMPARISON HEADER
   ================================ */

.comparison-header-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

.comparison-header-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.comparison-header-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.comparison-header-card.device-left {
    border-left: 4px solid var(--tm-primary);
}

.comparison-header-card.device-right {
    border-left: 4px solid var(--tm-accent);
}

.device-score-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.comparison-device-image {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin: 0 auto 1rem;
}

.comparison-device-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--tm-text-primary);
    margin-bottom: 0.5rem;
}

.comparison-device-type {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--tm-text-muted);
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.quick-specs {
    font-size: 0.875rem;
    color: var(--tm-text-secondary);
    margin: 1rem 0;
    padding: 1rem;
    background: var(--tm-surface);
    border-radius: 8px;
}

.price-info {
    margin: 1.5rem 0;
}

.price-main {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--tm-accent);
}

.price-vendor {
    font-size: 0.75rem;
    color: var(--tm-text-muted);
    margin-top: 0.25rem;
}

.comparison-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* ================================
   QUICK VERDICT
   ================================ */

.quick-verdict-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border-left: 6px solid var(--tm-accent);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--tm-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: var(--tm-accent);
}

.verdict-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.verdict-winner {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.winner-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #856404;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.verdict-winner h4 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--tm-primary);
    margin-bottom: 0.5rem;
}

.verdict-winner p {
    font-size: 0.875rem;
    color: var(--tm-text-secondary);
}

.verdict-summary {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
}

.verdict-summary ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
}

.verdict-summary li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--tm-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.verdict-summary li:last-child {
    border-bottom: none;
}

.verdict-summary strong {
    color: var(--tm-primary);
    font-weight: 600;
}

/* ================================
   COMPARISON CONTROLS
   ================================ */

.comparison-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.control-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.control-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.control-switch input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.switch-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tm-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline {
    background: white;
    border: 2px solid var(--tm-border);
    color: var(--tm-primary);
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--tm-primary);
    color: white;
    border-color: var(--tm-primary);
}

/* ================================
   COMPARISON TABLE
   ================================ */

.comparison-table-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.comparison-category {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.category-header {
    background: linear-gradient(135deg, var(--tm-primary) 0%, var(--tm-primary-light) 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-header i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.category-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
}

.category-scores {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.category-score {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 700;
    color: white;
}

.score-separator {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-row {
    transition: background-color 0.2s ease;
}

.comparison-row:hover {
    background-color: var(--tm-surface);
}

.comparison-row.row-different {
    background-color: rgba(255, 243, 205, 0.3);
}

.spec-label {
    font-weight: 600;
    color: var(--tm-text-primary);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--tm-border);
    width: 30%;
    background-color: #f8f9fa;
}

.spec-label .tooltip-icon {
    margin-left: 0.5rem;
    color: var(--tm-text-muted);
    cursor: help;
    font-size: 0.875rem;
}

.spec-value {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--tm-border);
    color: var(--tm-text-secondary);
    position: relative;
    width: 35%;
}

.spec-value.device-left {
    border-right: 2px solid var(--tm-border);
}

.spec-value.better-value {
    background-color: rgba(16, 185, 129, 0.05);
    font-weight: 600;
    color: var(--tm-primary);
}

.better-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-size: 1rem;
}

.na-value {
    color: var(--tm-text-muted);
    font-style: italic;
}

/* ================================
   VISUAL COMPARISONS
   ================================ */

.visual-comparisons-section {
    margin: 3rem 0;
}

.visual-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.visual-comparison-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.visual-comparison-card.full-width {
    grid-column: 1 / -1;
}

.visual-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--tm-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--tm-border);
}

/* Size Comparison */
.size-comparison-visual {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 2rem 0;
    min-height: 300px;
}

.size-device {
    text-align: center;
}

.device-outline {
    border: 3px solid var(--tm-primary);
    border-radius: 20px;
    position: relative;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.device-screen {
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    background: #1a1a1a;
    border-radius: 12px;
}

.size-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--tm-text-secondary);
}

.size-label strong {
    font-size: 0.875rem;
    color: var(--tm-primary);
}

/* Battery Comparison */
.battery-comparison-visual {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.battery-bar-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.battery-label {
    font-weight: 600;
    color: var(--tm-primary);
    font-size: 0.875rem;
}

.battery-bar-wrapper {
    background: var(--tm-surface);
    border-radius: 12px;
    height: 40px;
    overflow: hidden;
    position: relative;
}

.battery-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    transition: width 0.5s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Camera Comparison */
.camera-comparison-visual {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
}

.camera-setup {
    flex: 1;
    text-align: center;
}

.camera-setup .device-name {
    font-weight: 700;
    color: var(--tm-primary);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.camera-lenses {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.camera-lens {
    background: var(--tm-surface);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.camera-lens i {
    font-size: 1.5rem;
    color: var(--tm-primary);
}

.lens-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.lens-info strong {
    color: var(--tm-primary);
    font-size: 1rem;
}

.lens-info span {
    font-size: 0.75rem;
    color: var(--tm-text-muted);
}

/* Performance Benchmarks */
.benchmark-comparison {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.benchmark-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: center;
}

.benchmark-name {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.benchmark-name strong {
    font-weight: 700;
    color: var(--tm-primary);
}

.benchmark-name span {
    font-size: 0.75rem;
    color: var(--tm-text-muted);
}

.benchmark-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.benchmark-device {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    align-items: center;
}

.benchmark-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tm-text-secondary);
    text-align: right;
}

.benchmark-bar-wrapper {
    background: var(--tm-surface);
    border-radius: 8px;
    height: 32px;
    overflow: hidden;
    position: relative;
}

.benchmark-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.75rem;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    transition: width 0.5s ease;
}

.benchmark-bar.bar-device1 {
    background: linear-gradient(90deg, var(--tm-primary) 0%, var(--tm-primary-light) 100%);
}

.benchmark-bar.bar-device2 {
    background: linear-gradient(90deg, var(--tm-accent) 0%, var(--tm-accent-light) 100%);
}

.benchmark-score {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ================================
   PROS & CONS
   ================================ */

.pros-cons-section {
    margin: 3rem 0;
}

.pros-cons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.device-pros-cons {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.device-pros-cons h4 {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--tm-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--tm-border);
}

.pros-section,
.cons-section {
    margin-bottom: 1.5rem;
}

.pros-section h5,
.cons-section h5 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pros-section h5 {
    color: #10b981;
}

.cons-section h5 {
    color: #ef4444;
}

.pros-section ul,
.cons-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pros-section li,
.cons-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.875rem;
    color: var(--tm-text-secondary);
}

.pros-section li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
}

.cons-section li:before {
    content: '✗';
    position: absolute;
    left: 0;
    color: #ef4444;
    font-weight: 700;
}

/* ================================
   RELATED COMPARISONS
   ================================ */

.related-comparisons-section {
    margin: 3rem 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-comparison-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-comparison-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.related-devices {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.related-devices img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.vs-badge {
    background: var(--tm-accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.75rem;
}

.related-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tm-primary);
    text-align: center;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 1024px) {
    .comparison-header-grid {
        grid-template-columns: 1fr;
    }
    
    .verdict-content {
        grid-template-columns: 1fr;
    }
    
    .visual-grid {
        grid-template-columns: 1fr;
    }
    
    .pros-cons-grid {
        grid-template-columns: 1fr;
    }
    
    .benchmark-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .comparison-controls-bar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .spec-label {
        width: 40%;
    }
    
    .spec-value {
        width: 30%;
    }
    
    .size-comparison-visual {
        flex-direction: column;
        align-items: center;
    }
    
    .camera-comparison-visual {
        flex-direction: column;
    }
}

/* ================================
   PRINT STYLES
   ================================ */

@media print {
    .comparison-controls-bar,
    .comparison-actions {
        display: none;
    }
    
    .comparison-category {
        page-break-inside: avoid;
    }
}
