/* ==========================================================================
   Icarus Table Builder - Complete Front-End Styles
   ========================================================================== */

.icarus-table-wrapper {
    width: 100%;
    margin: 24px 0;
    position: relative;
    box-sizing: border-box;
    font-family: inherit;
}

.icarus-table-wrapper * {
    box-sizing: border-box;
}

/* 1. Live Search Input Box */
.icarus-search-box {
    margin-bottom: 24px;
    display: flex;
    justify-content: flex-end;
}

.icarus-search-input {
    padding: 10px 18px;
    border: 1px solid #e2e2e2;
    border-radius: 30px;
    width: 260px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.icarus-search-input:focus {
    border-color: #27ccc0;
    box-shadow: 0 0 0 3px rgba(39, 204, 192, 0.15);
}

/* 2. Main Table & Scroll Area */
.icarus-responsive-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.icarus-frontend-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: #ffffff;
}

/* Header Cells */
.icarus-frontend-table th {
    font-weight: 700;
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
    user-select: none;
}

.icarus-sortable th {
    cursor: pointer;
    position: relative;
    padding-right: 28px !important;
}

.icarus-sortable th::after {
    content: "↕";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    opacity: 0.5;
}

/* Body Cells */
.icarus-frontend-table td {
    font-size: 14px;
    color: #444444;
    line-height: 1.5;
}

.icarus-frontend-table tr:last-child td {
    border-bottom: none !important;
}

.icarus-highlight-row td {
    background-color: #fff9e6 !important;
    font-weight: 600;
}

/* 3. Element Specific Styling */

/* Text Element */
.icarus-el-text {
    line-height: 1.5;
}

/* Image Element */
.icarus-el-img img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    transition: transform 0.3s ease;
}

.icarus-el-img.icarus-img-zoom img:hover {
    transform: scale(1.05);
}

/* Salient Styled CTA Button */
.icarus-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 30px;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.salient-btn-accent {
    background-color: #ff3366;
}

.salient-btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

/* Star Rating */
.icarus-el-stars {
    color: #ffb400;
    font-size: 18px;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icarus-rating-label {
    font-size: 12px;
    color: #666666;
    margin-left: 4px;
}

/* Plain & Styled Lists (With Bullet Overflow Fix) */
.icarus-plain-list, 
.icarus-styled-list {
    margin: 0;
    padding-left: 20px;
    list-style-position: inside;
}

.icarus-plain-list li {
    padding: 3px 0;
}

.icarus-styled-list {
    padding-left: 0;
}

.icarus-styled-list li {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.icarus-styled-list li i {
    color: #27ccc0;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Custom Icon */
.icarus-el-icon i {
    display: inline-block;
    line-height: 1;
}

/* Badge */
.icarus-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress Bar */
.icarus-progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.icarus-progress-fill {
    background: #27ccc0;
    height: 100%;
    transition: width 0.4s ease;
}

.icarus-progress-bar span {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    color: #333333;
}

/* Circle Score Rating Badge */
.icarus-circle-rating {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #27ccc0;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(39, 204, 192, 0.3);
}

/* Tooltips */
.icarus-has-tooltip {
    position: relative;
    cursor: help;
}

.icarus-has-tooltip:hover::after {
    content: attr(data-icarus-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #272727;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* 4. Client Pagination */
.icarus-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.icarus-page-btn {
    background: #ffffff;
    border: 1px solid #e2e2e2;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.icarus-page-btn:hover:not(:disabled) {
    background: #27ccc0;
    color: #ffffff;
    border-color: #27ccc0;
}

.icarus-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.icarus-page-info {
    font-size: 12px;
    color: #666666;
    font-weight: 600;
}

/* 5. Sticky Header & First Column */
.icarus-sticky-header .icarus-frontend-table th {
    position: sticky;
    top: 0;
    z-index: 10;
}

.icarus-sticky-col .icarus-frontend-table td:first-child,
.icarus-sticky-col .icarus-frontend-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 9;
    background: #ffffff;
}

/* 6. Responsive Modes */
@media (max-width: 768px) {
    .icarus-resp-stack table, 
    .icarus-resp-stack tbody, 
    .icarus-resp-stack tr, 
    .icarus-resp-stack td, 
    .icarus-resp-stack th {
        display: block;
        width: 100%;
    }

    .icarus-resp-stack tr {
        margin-bottom: 16px;
        border: 1px solid #e4e4e4;
        border-radius: 6px;
    }

    .icarus-resp-scroll .icarus-responsive-scroll {
        overflow-x: auto;
    }

    .icarus-hide-mobile {
        display: none !important;
    }
}

/* Fallback Notice */
.icarus-notice {
    padding: 14px 18px;
    background: #fff8e5;
    border-left: 4px solid #ffb400;
    color: #8a6d3b;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}