/* 
 * Supplier Cards CSS - Complete Updated Version
 * Addresses specific styling issues and layout improvements
 */

/* ========================================
   CARD CONTAINER
   ======================================== */

.supplier-card {
    background-color: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    margin-bottom: 18px;
    position: relative;
}

.supplier-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Premium Card Styling */
.supplier-card.premium-card {
    border-left: 5px solid var(--primary-color, #D2691E);
    border-color: var(--primary-color, #D2691E);
}

.supplier-card.premium-card .supplier-header {
    background-color: #fff3e0;
}

/* ========================================
   CARD HEADER
   ======================================== */

.supplier-header {
    background-color: var(--bg-primary, #ffffff);
    padding: 6px 16px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.supplier-header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.supplier-logo {
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 50px;
}

.supplier-logo-img {
    max-width: 100px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.supplier-no-logo {
    width: 100px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 11px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.supplier-info {
    flex: 1;
    line-height: 1.2;
}

.supplier-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.supplier-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e6f2ff;
    color: #0073aa;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: help;
    position: relative;
}

.premium-card .category-tag {
    background-color: #ffffff;
    color: var(--primary-color, #D2691E);
}

.supplier-email {
    margin: 0 0 6px 0; 
    font-size: 13px;
    color: #888;
    font-weight: 400;
    font-style: italic;
}

.supplier-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    align-items: center; /* Zorgt ervoor dat alle items op dezelfde lijn staan */
}

.supplier-categories .category-tag,
.supplier-categories .more-categories {
    margin: 0; /* Geen individuele marges */
    vertical-align: baseline; /* Zelfde baseline uitlijning */
}

.more-categories {
    display: inline-flex;
    align-items: center;
    background-color: #f0f0f0;
    color: #666;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 0; /* Geen margin-top */
    vertical-align: top; /* Zorg dat het op dezelfde lijn staat */
    line-height: 1.2; /* Zelfde line-height als category-tag */
}

.more-categories.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0; /* Geen margin-top */
}

.more-categories.clickable:hover {
    color: var(--primary-color, #D2691E);
    text-decoration: underline;
}

.hidden-categories {
    display: none;
}

.hidden-categories {
    display: none;
}

/* When shown, ensure exact same alignment as visible categories */
.hidden-categories[style*="flex"] {
    align-items: center !important;
    margin-top: 0 !important; /* No margin-top, gebruik alleen gap */
}

/* Zorg dat beide containers exact hetzelfde gedrag hebben */
.supplier-categories,
.hidden-categories {
    align-items: center;
    line-height: 1.2;
}

/* Category tags in both containers should have identical styling */
.supplier-categories .category-tag,
.hidden-categories .category-tag {
    margin: 0;
    vertical-align: baseline;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    line-height: 1.2;
}

/* ========================================
   COMPARE BUTTON - FIXED
   ======================================== */

.compare-container-new {
    display: flex;
    align-items: center;
    gap: 6px;
}

.compare-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 24px;
    user-select: none;
}

.compare-wrapper:hover {
    border-color: #0073aa;
    background-color: #f8f9ff;
}

.supplier-compare-checkbox {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
    margin: 0;
    top: 0;
    left: 0;
}

.supplier-compare-checkbox:checked + .compare-icon-text {
    color: #0073aa;
}

.supplier-compare-checkbox:checked + .compare-icon-text .compare-icon-shape {
    border-color: #0073aa;
    background-color: #0073aa;
    color: white;
}

.compare-icon-text {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #666;
    font-weight: 500;
    pointer-events: none;
}

.compare-icon-shape {
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: transparent;
    flex-shrink: 0;
}

/* Replace with SVG icon */
.compare-icon-shape::before {
    content: '';
    width: 16px;
    height: 16px;
    display: block;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="m21 8-4-4-4 4"/><path d="M17 4v16"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Selected state */
.supplier-card.selected-for-compare {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.supplier-card.selected-for-compare .compare-wrapper {
    border-color: #0073aa;
    background-color: #0073aa;
}

.supplier-card.selected-for-compare .compare-icon-text {
    color: white;
}

.supplier-card.selected-for-compare .compare-icon-shape {
    border-color: white;
    background-color: transparent;
    color: white;
}

/* Make compare text clickable */
.compare-text-clickable {
    cursor: pointer;
    user-select: none;
}

.compare-text-clickable:hover {
    color: #0073aa;
}

.supplier-card.selected-for-compare .compare-wrapper {
    border-color: #0073aa;
    background-color: #0073aa;
}

.supplier-card.selected-for-compare .compare-icon-text {
    color: white;
}

.supplier-card.selected-for-compare .compare-icon-shape {
    border-color: white;
    background-color: transparent;
    color: white;
}

/* ========================================
   CARD CONTENT
   ======================================== */

.supplier-content-area {
    padding: 12px 16px 4px 16px !important;
}

.main-content-flex {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.properties-section {
    flex: 0 0 60%;
}

.right-column {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    gap: 0px;
    min-height: 200px;
}

/* Ensure actions are pushed to bottom */
.right-column .actions-section {
    margin-top: auto;
}

/* ========================================
   FEATURES SECTION
   ======================================== */

.features-section-title {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin: 0 0 8px 0;
    padding-left: 0px !important;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0px;
    margin-bottom: 8px;
    padding-left: 0px;
    width: 100%;
}

.feature-item {
    text-align: center;
    position: relative;
    padding: 0 4px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.feature-tooltip {
    position: relative;
    display: inline-block;
}

.feature-icon-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    border: 2px solid #f0f0f0;
    position: relative;
    transition: all 0.2s ease;
}

.feature-icon-container.selected {
    border-color: #FFD4B3;
}

.feature-icon-container.unselected {
    border-color: #f0f0f0;
}

.feature-icon-container img {
    max-width: 22px;
    max-height: 22px;
    width: auto;
    height: auto;
}

.feature-icon-container span {
    font-size: 10px;
}

.feature-icon-container.selected img,
.feature-icon-container.selected span {
    opacity: 1;
}

.feature-icon-container.unselected img,
.feature-icon-container.unselected span {
    opacity: 0.6;
}

.status-indicator-small {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    color: white;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    z-index: 5;
    background-color: #4caf50;
}

.status-indicator-small.cross {
    background-color: #f44336 !important;
}

/* Lucide SVG icon adjustments */
.feature-icon-container svg {
    width: 18px;
    height: 18px;
    transform: translateY(2px);
}

.feature-text {
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
    min-height: 20px;
    display: block;
    word-break: break-word;
    hyphens: auto;
    overflow-wrap: break-word;
    width: 100%;
    margin: 0;
    padding: 2px 0;
}

.feature-text.selected {
    color: #333;
}

.feature-text.unselected {
    color: #999;
}

/* ========================================
   BLOCK FEATURES - FIXED ALIGNMENT
   ======================================== */

.block-features-section {
    margin-bottom: 8px;
}

.block-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.property-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 11px;
    line-height: 1.2;
    padding: 2px 0;
}

.property-item .check,
.property-item .cross {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: bold;
    margin-top: 2px;
}

.property-item .check {
    color: #4caf50;
}

.property-item .cross {
    color: #f44336;
}

.property-item span:last-child {
    color: #333;
    flex: 1;
}

/* Subfeatures */
.subfeatures-section {
    margin-bottom: 6px;
}

.subfeatures-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
}

.subfeatures-grid .property-item {
    font-size: 12px;
    line-height: 1.1;
}

.subfeatures-grid .property-item .check,
.subfeatures-grid .property-item .cross {
    font-size: 14px;
    margin-top: 1px;
}

/* ========================================
   MORE FUNCTIONS LINK - LEFT ALIGNED
   ======================================== */

.more-functions-container-left {
    text-align: left;
    margin-top: 12px;
    padding-left: 0px;
}

.more-functions-container-left .more-functions-link {
    color: var(--primary-color, #D2691E);
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
}

.more-functions-container-left .more-functions-link:hover {
    color: #B8560F;
    text-decoration: underline;
}

/* ========================================
   CENTRAL MORE INFO LINK - BOTTOM OF CARD
   ======================================== */

.central-more-info-container {
    text-align: center;
    margin: 0 0 0 0; /* Removed all margins */
    padding: 0 16px;
}

.central-more-info-link {
    color: var(--primary-color, #D2691E);
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
}

.central-more-info-link:hover {
    color: #B8560F;
    text-decoration: underline;
}

.hidden-features {
    display: none;
    margin-top: 6px;
}

.more-features-link {
    color: var(--primary-color, #D2691E);
    font-size: 11px;
    text-decoration: none;
    display: inline-block;
    margin-top: 6px;
}

.more-features-link:hover {
    color: #B8560F;
    text-decoration: underline;
}

/* ========================================
   RIGHT COLUMN
   ======================================== */

.section-heading {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin: 0 0 6px 12px;
}

/* ========================================
   CERTIFICATIONS - ALIGNED WITH FEATURE ICONS TOP
   ======================================== */

.certifications-container {
    margin-bottom: 8px;
    margin-left: 12px;
    margin-top: 0px; /* Align with top of feature icons */
}

.visible-certifications,
.hidden-certifications {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.certification-item {
    position: relative;
    display: inline-block;
    padding: 6px 8px; /* Increased top/bottom padding for better visual weight */
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 11px;
    color: #333;
    background-color: #f5f5f5;
    white-space: nowrap;
    font-weight: 500;
    cursor: help;
    line-height: 1.2; /* Match feature text line-height */
}

.certification-item:hover {
    background-color: #e9e9e9;
}

.more-certifications-link {
    color: var(--primary-color, #D2691E);
    font-size: 10px;
    text-decoration: none;
}

.more-certifications-link:hover {
    color: #B8560F;
    text-decoration: underline;
}

.hidden-certifications {
    display: none;
}

/* ========================================
   PRICE SECTION
   ======================================== */

.price-section {
    margin-bottom: 8px;
    text-align: left;
}

.price-display {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.price-period {
    font-size: 11px;
    color: #666;
}

/* ========================================
   ACTIONS SECTION - COMPACT BUTTONS
   ======================================== */

.actions-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    margin-left: 12px;
    margin-right: 16px;
}

.primary-cta-compact {
    display: block;
    padding: 10px 16px;
    background-color: var(--primary-color, #D2691E);
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    min-height: 40px;
    width: 100%;
    line-height: 1.2;
    margin: 0;
    box-sizing: border-box;
}

.secondary-buttons-row {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    width: 100%;
}

.info-btn-compact,
.website-btn-compact {
    padding: 10px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background-color: #f8f9fa;
    color: #666;
    text-decoration: none;
    text-align: center;
    font-weight: 400;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 40px;
    width: calc(50% - 3px);
    margin: 0;
    line-height: 1;
    box-sizing: border-box;
}

.primary-cta-compact:hover {
    background-color: #B8560F;
    color: white;
    transform: translateY(-1px);
}

.info-btn-compact:hover,
.website-btn-compact:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Button icons */
.info-btn-compact .info-icon,
.website-btn-compact .external-icon {
    width: 10px;
    height: 10px;
    opacity: 0.7;
}

/* ========================================
   CARD FOOTER - REMOVED
   ======================================== */

.supplier-actions {
    display: none;
}

/* ========================================
   EXPANDABLE SECTION
   ======================================== */

.supplier-expandable {
    display: none;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #e0e0e0);
    background-color: #f9f9f9;
    animation: slideDown 0.3s ease;
}

.supplier-expandable.visible {
    display: block;
}

.additional-functions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.additional-functions .property-item {
    font-size: 12px;
}

.supplier-custom-content {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
}

/* ========================================
   TOOLTIPS
   ======================================== */

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 999999;
    font-size: 12px;
    line-height: 1.4;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: none;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.feature-tooltip:hover .tooltip-text,
.category-tag:hover .tooltip-text,
.certification-item:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ========================================
   GRAYSCALE EFFECTS
   ======================================== */

.grayscale-logo img,
.grayscale-image {
    filter: grayscale(100%);
    opacity: 0.9;
    transition: all 0.2s ease;
}

.grayscale-icons img,
.grayscale-icons .feature-icon-text,
.grayscale-icons [class^="emoji"],
.grayscale-icons [class*=" emoji"],
.grayscale-icons span.emoji,
.grayscale-icons i.emoji,
.grayscale-icons i[class^="fa-"],
.grayscale-icons i[class*=" fa-"],
.grayscale-icons svg,
.grayscale-icons .icon,
.grayscale-icons .feature-icon {
    filter: grayscale(100%);
    opacity: 0.8;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

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

@media (max-width: 768px) {
    .main-content-flex {
        flex-direction: column;
        gap: 12px;
    }
    
    .properties-section,
    .right-column {
        flex: 1 0 100%;
    }
    
    .supplier-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .supplier-header-left {
        flex-direction: column;
        width: 100%;
    }
    
    .supplier-logo {
        margin-right: 0;
        margin-bottom: 10px;
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        padding-left: 0;
    }
    
    .block-features-grid {
        grid-template-columns: 1fr;
    }
    
    .subfeatures-grid {
        grid-template-columns: 1fr;
    }
    
    .additional-functions {
        grid-template-columns: 1fr;
    }
    
    .feature-icon-container {
        width: 35px;
        height: 35px;
    }
    
    .feature-text {
        font-size: 10px;
    }
    
    /* Mobile tooltip fix */
    .tooltip-text {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90vw !important;
        max-width: 300px !important;
        bottom: auto !important;
        margin: 0 !important;
    }
}

