/* Main Container */
.ud-container {
    margin: 0 auto;
}

/* Comparison Table Wrapper */
.ud-comparison-table {
    gap: 12px;
    display: flex;
    flex-direction: column;
}

/* Header Row */
.ud-header-row {
    display: grid;
    grid-template-columns: 200px repeat(var(--ud-columns, 3), 1fr);
    gap: 20px;
}
.ud-header-row .ud-header-cell {
    padding: 30px;
    box-shadow: 0px 4px 24px rgba(40, 59, 158, 0.12), 0px 0px 0px 0px rgba(40, 59, 158, 0.08);
    border-radius: 12px 12px 0px 0px;
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ud-header-row .ud-header-cell:first-child {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Header Cells */
.ud-header-cell {
    padding: 30px 20px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
}

/* Provider Header */
.ud-provider-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.ud-provider-header h4 {
    color: #1B2247;
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
}

.ud-provider-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
}

.ud-provider-icon img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Mobile cell header (hidden on desktop) */
.ud-mobile-cell-header {
    display: none;
}

.ud-mobile-provider-icon {
    display: none;
    height: auto;
}

.ud-mobile-provider-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 32px;
    color: #1B2247;
}

/* Data Rows */
.ud-row {
    display: grid;
    gap: 20px;
    grid-template-columns: 200px repeat(var(--ud-columns, 3), 1fr);
    transition: all 0.3s ease;
}

.ud-row-label {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    background: #2D3A5C;
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 2px 0px 8px rgba(27, 34, 71, 0.08);
}

/* Data Cells */
.ud-cell {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    padding: 21px 25px;
    box-shadow: 0px 8px 32px rgba(40, 59, 158, 0.18), 0px 0px 0px 0px rgba(40, 59, 158, 0.12);

}

/* Badges */
.ud-badge {
    padding: 8px 16px;
    border-radius: 100px;
    font-weight: 400;
    font-size: 14px;
    line-height: 21px;
    margin-bottom: 12px;
    text-align: center;
}

/* Badge Color Variations */
.ud-badge.high,
.ud-badge.exclusive,
.ud-badge.instant,
.ud-badge.none {
    background: #10b981;
    color: white;
}

.ud-badge.mixed,
.ud-badge.variable,
.ud-badge.varies {
    background: #f59e0b;
    color: white;
}

.ud-badge.low,
.ud-badge.non-exclusive {
    background: #ef4444;
    color: white;
}

/* Expand Icon */
.ud-expand-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 16px;
    transition: transform 0.3s ease;
}

/* Details Section - Hidden by default */
.ud-details {
    width: 100%;
    overflow: hidden;
    display: none;
    transition: all 0.3s ease;
    font-size: 13px;
    color: #5D5B5B;
    margin-top: 0;
    line-height: 1.6;
}

/* Hide mobile accordion icon on desktop */
.ud-mobile-accordion-icon {
    display: none;
}

/* Expanded State */
.ud-row.expanded .ud-cell {
    padding-bottom: 24px;
}

.ud-row.expanded .ud-details {
    display: block;
}

.ud-row.expanded .ud-expand-icon {
    transform: rotate(180deg);
}

/* Responsive Design */
@media (max-width: 1024px) {
    /* Hide header row */
    .ud-header-row {
        display: none;
    }

    /* Hide expand icon on mobile */
    .ud-expand-icon {
        display: none;
    }

    /* Row becomes vertical accordion layout */
    .ud-row {
        display: flex;
        border-radius: 8px;
        flex-direction: column;
        gap: 0;
    }

    /* Row label becomes accordion header */
    .ud-row-label {
        width: 100%;
        cursor: pointer;
        position: relative;
        padding-right: 50px;
        border-radius: 8px;
        user-select: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: 1px solid rgba(0, 0, 0, 0.04);
        box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.06);
    }

    .ud-row.expanded .ud-row-label {
        background: #F8F9FF !important;
        box-shadow: 0px 6px 24px rgba(40, 59, 158, 0.12), 0px 0px 0px 1.5px rgba(40, 59, 158, 0.1);
    }

    .ud-row.expanded {
        padding: 20px;
        box-shadow: 0px 6px 24px rgba(40, 59, 158, 0.12), 0px 0px 0px 1.5px rgba(40, 59, 158, 0.1);
    }
    

    /* Mobile accordion icon container */
    .ud-row-label .ud-mobile-accordion-icon {
        display: block;
        transition: transform 0.3s ease;
        font-size: var(--accordion-icon-size, 16px);
        width: var(--accordion-icon-size, 16px);
        height: var(--accordion-icon-size, 16px);
        flex-shrink: 0;
    }

    /* SVG icons inside */
    .ud-row-label .ud-mobile-accordion-icon svg {
        width: 1em;
        height: 1em;
        fill: currentColor;
    }

    /* Plus and chevron text icons */
    .ud-row-label .ud-mobile-accordion-icon span {
        display: inline-block;
    }

    .ud-row.expanded .ud-row-label .ud-mobile-accordion-icon {
        transform: rotate(180deg);
    }

    /* CSS-based arrow icon (default) */
    .ud-row-label::after {
        content: '';
        position: absolute;
        right: 20px;
        top: 50%;
        width: calc(var(--accordion-icon-size, 12px) * 0.55);
        height: calc(var(--accordion-icon-size, 12px) * 0.55);
        border-right: 2px solid #283B9E;
        border-bottom: 2px solid #283B9E;
        border-color: #5D5B5B !important;
        transform: translateY(-70%) rotate(45deg);
        transition: transform 0.3s ease;
    }

    .ud-row.expanded .ud-row-label::after {
        border-color: #283B9E !important;
    }

    .ud-row.expanded .ud-row-label::after {
        transform: translateY(-20%) rotate(225deg);
    }

    /* Hide CSS arrow when using custom icon */
    .ud-row-label:has(.ud-mobile-accordion-icon:not(:empty))::after {
        display: none;
    }

    .ud-row-label:has(.ud-mobile-accordion-icon:not(:empty)) {
        padding-right: 20px;
    }

    /* Cells become column-wise below label */
    .ud-cell {
        width: 100%;
        border-radius: 0;
        display: none;
        box-shadow: none;
        padding: 0;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .ud-row.expanded .ud-cell {
        display: flex;
        animation: slideDown 0.3s ease forwards;
    }

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

    .ud-row .item-1-cell {
        background: #F8F9FF !important;
        box-shadow: 0px 2px 8px rgba(40, 59, 158, 0.08) !important;
    }

    /* Mobile cell header (provider info) */
    .ud-mobile-cell-header {
        display: flex;
        align-items: center;
    }

    .ud-mobile-provider-icon {
        display: flex;
        width: auto;
        align-items: center;
        justify-content: flex-start;
        flex-shrink: 0;
    }

    .ud-mobile-provider-icon img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    /* Badge in mobile cell */
    .ud-cell .ud-badge {
        margin: 0;
        padding: 7px 15px;
        border-radius: 0;
        text-align: center;
        min-width: 100px;
        border-radius: 60px;
    }

    /* Description in mobile cell */
    .ud-row.mobile-accordion-open .ud-cell .ud-details {
        display: block;
    }   
}