/* CRM Detail Page Specific Overrides - Must be loaded AFTER all other CSS */

/* Override section spacing for CRM detail pages */
.crm-detail-page .content-grid .main-content .section,
body .container .content-grid .main-content section.section {
    padding: 0 !important;
    margin-bottom: 1.5rem !important;
    margin-top: 0 !important;
}

.crm-detail-page .content-grid .main-content .section:first-child,
body .container .content-grid .main-content section.section:first-child {
    margin-top: 0 !important;
}

.crm-detail-page .content-grid .main-content .section:last-child,
body .container .content-grid .main-content section.section:last-child {
    margin-bottom: 0 !important;
}

.crm-detail-page .content-grid .main-content .section h2,
body .container .content-grid .main-content section.section h2 {
    color: #005a73;
    margin-bottom: 1rem !important;
    margin-top: 0 !important;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    font-size: 1.5rem;
}

/* Ensure proper spacing between sections */
.crm-detail-page .content-grid .main-content .section + .section,
body .container .content-grid .main-content section.section + section.section {
    margin-top: 1.5rem !important;
}

/* Enhanced Similar CRMs Section */
.similar-crms-section {
    margin-top: 3rem !important;
    padding: 2rem 0 !important;
    border-top: 1px solid #e5e7eb;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.similar-crms-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.similar-crms-header h2 {
    font-size: 2rem !important;
    color: #005a73 !important;
    margin-bottom: 0.5rem !important;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.similar-crms-subtitle {
    color: #6b7280 !important;
    font-size: 1.1rem;
    margin: 0 !important;
    font-weight: 400;
}

/* Enhanced Cards Grid */
.similar-crms-enhanced {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
}

/* Individual Card Styling */
.similar-card-enhanced {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    min-width: 0;
    width: 100%;
}

.similar-card-enhanced:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #005a73;
}

/* Card Header */
.similar-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
}

.similar-card-logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.similar-card-logo .logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.similar-card-logo .logo-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.025em;
}

.similar-card-title-area {
    flex: 1;
    min-width: 0;
}

.similar-card-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin: 0 0 0.5rem 0 !important;
    line-height: 1.3;
    word-wrap: break-word;
}

.shared-features-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    color: #0369a1;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #bae6fd;
}

.shared-features-badge .feature-count {
    font-weight: 700;
    color: #0c4a6e;
}

/* Card Body */
.similar-card-body {
    padding: 0 1.5rem 1rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.similar-card-description {
    color: #6b7280 !important;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 !important;
    flex: 1;
}

/* Card Metrics */
.similar-card-metrics {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars {
    display: flex;
    gap: 1px;
}

.rating-stars .star {
    font-size: 1rem;
    transition: color 0.2s ease;
}

.rating-stars .star.filled {
    color: #fbbf24;
}

.rating-stars .star.half {
    color: #fbbf24;
}

.rating-stars .star.empty {
    color: #d1d5db;
}

.rating-value {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-weight: 600;
    color: #059669;
}

.price-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 400;
}

.price-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.price-period {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 400;
}

.price-free {
    color: #059669;
    font-weight: 700;
    font-size: 1rem;
}

/* Card Footer */
.similar-card-footer {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
}

.similar-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #005a73;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    background: #f8fafc;
    width: 100%;
    justify-content: center;
}

.similar-card-link:hover {
    background: #005a73;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 90, 115, 0.2);
}

.similar-card-link svg {
    transition: transform 0.2s ease;
}

.similar-card-link:hover svg {
    transform: translate(2px, -2px);
}

/* Responsive Design - Large Screens */
@media (min-width: 1200px) {
    .similar-crms-enhanced {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Responsive Design - Medium Screens */
@media (min-width: 769px) and (max-width: 1199px) {
    .similar-crms-enhanced {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Responsive Design - Small Screens */
@media (max-width: 768px) {
    .similar-crms-enhanced {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .similar-crms-header h2 {
        font-size: 1.5rem !important;
    }
    
    .similar-card-header {
        padding: 1rem 1rem 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .similar-card-logo {
        width: 40px;
        height: 40px;
    }
    
    .similar-card-title {
        font-size: 1.1rem !important;
    }
    
    .similar-card-body {
        padding: 0 1rem 0.75rem 1rem;
    }
    
    .similar-card-footer {
        padding: 0.75rem 1rem 1rem 1rem;
    }
}

/* Responsive Design - Mobile Screens */
@media (max-width: 580px) {
    .similar-crms-enhanced {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .similar-crms-section {
        padding: 1.5rem 0 !important;
    }
    
    .similar-crms-header {
        margin-bottom: 1.5rem;
    }
    
    .similar-card-metrics {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .price-display {
        align-self: flex-end;
    }
}