/*
 * CRM Comparison Table Styles
 *
 * Comprehensive styling for the industry-specific CRM comparison page
 *
 * @package Easy_CRM_Guide
 * @since 1.0.0
 */

/* ========================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ======================================== */

:root {
    /* Priority Level Colors */
    --priority-critical: #FFF5F5;
    --priority-critical-text: #C53030;
    --priority-critical-badge: #FC8181;

    --priority-high: #FFF9F5;
    --priority-high-text: #C05621;
    --priority-high-badge: #F6AD55;

    --priority-medium: #FFFEF5;
    --priority-medium-text: #B7791F;
    --priority-medium-badge: #F6E05E;

    --priority-low: #F5FFF5;
    --priority-low-text: #276749;
    --priority-low-badge: #68D391;

    --priority-not-needed: #F5F5F5;
    --priority-not-needed-text: #718096;
    --priority-not-needed-badge: #CBD5E0;

    /* General Colors */
    --primary-blue: #2563EB;
    --primary-blue-hover: #1E40AF;
    --success-green: #10B981;
    --warning-yellow: #F59E0B;
    --danger-red: #EF4444;
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --background-white: #FFFFFF;
    --background-light: #F9FAFB;
    --border-color: #E5E7EB;
    --border-color-dark: #D1D5DB;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ========================================
   BASE STYLES
   ======================================== */

.crm-comparison-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

.crm-comparison-wrapper .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: var(--text-dark);
    text-align: center;
}

/* ========================================
   SECTION 1: PAGE HEADER & INDUSTRY SELECTOR
   ======================================== */

.comparison-header {
    background: var(--background-light);
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--border-color);
}

.comparison-header .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 var(--spacing-md) 0;
    text-align: center;
    color: var(--text-dark);
}

.industry-selector-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.industry-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
}

.industry-dropdown {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color-dark);
    border-radius: var(--radius-md);
    background-color: var(--background-white);
    color: var(--text-dark);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: all 0.2s ease;
}

.industry-dropdown:hover {
    border-color: var(--primary-blue);
}

.industry-dropdown:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========================================
   SECTION 2: PRICING COMPARISON TABLE
   ======================================== */

.pricing-comparison-section {
    padding: var(--spacing-xl) 0;
    background: var(--background-white);
}

.pricing-table-wrapper {
    overflow-x: auto;
    margin: 0 calc(-1 * var(--spacing-md));
    padding: 0 var(--spacing-md);
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--background-white);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.pricing-table thead {
    background: var(--background-light);
}

.pricing-table th,
.pricing-table td {
    padding: var(--spacing-md);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.pricing-table th:first-child,
.pricing-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.pricing-table thead th {
    font-weight: 700;
    color: var(--text-dark);
}

.pricing-table .product-logo {
    max-width: 150px;
    height: auto;
    margin: 0 auto var(--spacing-sm) auto;
    display: block;
}

.pricing-table .product-column h3 {
    margin: 0;
    font-size: 1.25rem;
}

.pricing-table .pricing-highlight {
    background: #FEFCE8;
}

.pricing-table .price-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.pricing-table .free-plan-yes {
    color: var(--success-green);
    font-weight: 600;
}

.pricing-table .free-plan-no {
    color: var(--text-gray);
}

.pricing-table .cta-row {
    background: var(--background-light);
}

/* ========================================
   CTA BUTTONS
   ======================================== */

.cta-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-blue);
    color: var(--background-white);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.cta-button:hover {
    background: var(--primary-blue-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cta-button-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ========================================
   SECTION 3: PRIORITY BADGE LEGEND
   ======================================== */

.priority-legend-section {
    padding: var(--spacing-xl) 0;
    background: var(--background-light);
}

.priority-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.priority-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--background-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.priority-description {
    font-size: 0.875rem;
    color: var(--text-gray);
}

/* ========================================
   PRIORITY BADGES
   ======================================== */

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.priority-badge.priority-critical {
    background: var(--priority-critical-badge);
    color: var(--priority-critical-text);
}

.priority-badge.priority-high {
    background: var(--priority-high-badge);
    color: var(--priority-high-text);
}

.priority-badge.priority-medium {
    background: var(--priority-medium-badge);
    color: var(--priority-medium-text);
}

.priority-badge.priority-low {
    background: var(--priority-low-badge);
    color: var(--priority-low-text);
}

.priority-badge.priority-not-needed {
    background: var(--priority-not-needed-badge);
    color: var(--priority-not-needed-text);
}

.priority-icon {
    font-size: 1rem;
    cursor: help;
}

/* ========================================
   SECTION 4: FEATURE COMPARISON TABLE
   ======================================== */

.feature-comparison-section {
    padding: var(--spacing-xl) 0;
    background: var(--background-white);
}

.feature-section {
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.feature-section-title {
    padding: var(--spacing-md) var(--spacing-lg);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: default;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feature-section-title.collapsible {
    cursor: pointer;
    user-select: none;
}

.feature-section-title.collapsible:hover {
    opacity: 0.9;
}

.toggle-icon {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.priority-section-critical .feature-section-title {
    background: var(--priority-critical);
    color: var(--priority-critical-text);
}

.priority-section-high .feature-section-title {
    background: var(--priority-high);
    color: var(--priority-high-text);
}

.priority-section-medium .feature-section-title {
    background: var(--priority-medium);
    color: var(--priority-medium-text);
}

.priority-section-low .feature-section-title {
    background: var(--priority-low);
    color: var(--priority-low-text);
}

.priority-section-not-needed .feature-section-title {
    background: var(--priority-not-needed);
    color: var(--priority-not-needed-text);
}

.feature-table-wrapper {
    overflow-x: auto;
    transition: max-height 0.3s ease;
}

.feature-table-wrapper.collapsed {
    display: none;
}

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

.feature-table th,
.feature-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.feature-table thead {
    background: var(--background-light);
}

.feature-table th {
    font-weight: 600;
    text-align: left;
}

.feature-table .product-col {
    text-align: center;
    min-width: 150px;
}

.feature-table .feature-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.feature-table .feature-value {
    text-align: center;
}

.feature-icon {
    font-size: 1.25rem;
}

.feature-icon.available {
    color: var(--success-green);
}

.feature-icon.unavailable {
    color: var(--text-gray);
}

.feature-icon.partial {
    color: var(--warning-yellow);
    font-size: 0.875rem;
}

/* ========================================
   SECTION 5: RECOMMENDATION CARDS
   ======================================== */

.recommendation-section {
    padding: var(--spacing-xl) 0;
    background: var(--background-light);
}

.recommendation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.recommendation-card {
    background: var(--background-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    transition: all 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.recommendation-card.best-match {
    border-color: var(--success-green);
    border-width: 3px;
}

.best-match-badge {
    position: absolute;
    top: -12px;
    right: var(--spacing-md);
    background: var(--success-green);
    color: var(--background-white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.card-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

.card-logo {
    max-width: 180px;
    height: auto;
    margin: 0 auto var(--spacing-sm) auto;
    display: block;
}

.card-title {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.card-body {
    margin-bottom: var(--spacing-md);
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.match-scores {
    background: var(--background-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    font-size: 0.875rem;
}

.score-item.overall-match {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 2px solid var(--border-color);
    font-size: 1rem;
}

.score-value {
    font-weight: 600;
}

.score-value.match-excellent {
    color: var(--success-green);
}

.score-value.match-good {
    color: var(--warning-yellow);
}

.score-value.match-fair {
    color: var(--danger-red);
}

.card-highlight {
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
}

.card-highlight.best-for {
    background: #ECFDF5;
    color: var(--priority-low-text);
}

.card-highlight.watch-out {
    background: #FEF3C7;
    color: var(--priority-medium-text);
}

.card-footer {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--border-color);
}

/* ========================================
   SECTION 6: PRODUCT REVIEWS ACCORDION
   ======================================== */

.product-reviews-section {
    padding: var(--spacing-xl) 0;
    background: var(--background-white);
}

.product-reviews-accordion {
    max-width: 900px;
    margin: var(--spacing-lg) auto 0;
}

.review-accordion-item {
    margin-bottom: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.review-accordion-header {
    padding: var(--spacing-md) var(--spacing-lg);
    margin: 0;
    background: var(--background-light);
    cursor: pointer;
    user-select: none;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: background 0.2s ease;
}

.review-accordion-header:hover {
    background: var(--border-color);
}

.accordion-icon {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.review-accordion-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(90deg);
}

.review-accordion-content {
    padding: var(--spacing-lg);
    background: var(--background-white);
    transition: max-height 0.3s ease;
}

.review-accordion-content.collapsed {
    display: none;
}

.review-ratings {
    display: flex;
    justify-content: space-around;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--background-light);
    border-radius: var(--radius-md);
}

.rating-item {
    text-align: center;
}

.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.star {
    font-size: 1.25rem;
}

.star-full {
    color: #F59E0B;
}

.star-half {
    color: #F59E0B;
    opacity: 0.6;
}

.star-empty {
    color: var(--border-color-dark);
}

.rating-number {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-left: 0.5rem;
}

.review-pros,
.review-cons {
    margin-bottom: var(--spacing-lg);
}

.review-pros h4,
.review-cons h4 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

.review-pros h4 {
    color: var(--success-green);
}

.review-cons h4 {
    color: var(--danger-red);
}

.pros-list,
.cons-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pros-list li,
.cons-list li {
    padding: var(--spacing-xs) 0;
    line-height: 1.6;
}

.pros-list li {
    color: var(--priority-low-text);
}

.cons-list li {
    color: var(--priority-critical-text);
}

.review-verdict {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--background-light);
    border-left: 4px solid var(--primary-blue);
    border-radius: var(--radius-sm);
}

.review-verdict h4 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-blue);
}

.review-verdict p {
    margin: 0;
    line-height: 1.8;
}

.review-cta {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--border-color);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .comparison-header .page-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .pricing-table th,
    .pricing-table td {
        padding: var(--spacing-sm);
        font-size: 0.875rem;
    }

    .recommendation-cards {
        grid-template-columns: 1fr;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .comparison-header .page-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .industry-selector-wrapper {
        flex-direction: column;
        text-align: center;
    }

    .industry-dropdown {
        width: 100%;
        max-width: 300px;
    }

    .pricing-table {
        font-size: 0.75rem;
    }

    .pricing-table th,
    .pricing-table td {
        padding: var(--spacing-xs);
    }

    .pricing-table .product-logo {
        max-width: 100px;
    }

    .priority-legend {
        grid-template-columns: 1fr;
    }

    .feature-table {
        font-size: 0.875rem;
    }

    .feature-table th,
    .feature-table td {
        padding: var(--spacing-xs);
    }

    .recommendation-cards {
        grid-template-columns: 1fr;
    }

    .review-ratings {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .cta-button {
        display: block;
        width: 100%;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
    .comparison-header .page-title {
        font-size: 1.5rem;
    }

    .crm-comparison-wrapper .container {
        padding: 0 var(--spacing-sm);
    }

    .feature-section-title {
        font-size: 1.125rem;
        padding: var(--spacing-sm);
    }

    .card-title {
        font-size: 1.25rem;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-center {
    text-align: center;
}

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.hidden {
    display: none;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .industry-selector-wrapper,
    .cta-button,
    .best-match-badge,
    .toggle-icon,
    .accordion-icon {
        display: none;
    }

    .feature-table-wrapper.collapsed,
    .review-accordion-content.collapsed {
        display: block !important;
    }

    .recommendation-card {
        page-break-inside: avoid;
    }
}
