/* Flexible Pool Table Builder Styles */

/* Color scheme - lake blue #1e90ff for all buttons */

.flexible-pool-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.flexible-pool-table th, .flexible-pool-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.flexible-pool-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.flexible-pool-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.flexible-pool-table tr:hover {
    background-color: #f1f1f1;
}

.flexible-pool-table td a {
    text-decoration: none;
    color: inherit;
}

/* Special styling for the Editor Comments/Cleaner Overview column when present */
.flexible-pool-table td:last-child {
    min-width: 250px !important;
    max-width: 400px !important;
    line-height: 1.4;
}

/* When Editor Comments is present, style it specially */
.flexible-pool-table td[data-column="Editor_Comments"], 
.flexible-pool-table td[data-column="Cleaner_Overview"] {
    font-style: italic;
    color: #555;
    min-width: 300px !important;
    max-width: 400px !important;
}

.description-wrapper {
    display: block;
    white-space: normal;
    word-wrap: break-word;
    max-height: 4.2em;
    overflow: hidden;
}

.description-link {
    color: #333 !important;
    text-decoration: none !important;
    display: block !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow: visible !important;
    position: static !important;
    padding-right: 0 !important;
}

.description-link:after {
    display: none !important;
    content: none !important;
}

.description-link:hover {
    color: #0066cc;
    text-decoration: underline;
}

.check-price-button, .view-product-btn, .apply-filter-button, .reset-button {
    background-color: #1e90ff !important;
    color: white !important;
    padding: 8px 15px !important;
    border: none !important;
    border-radius: 15px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    display: inline-block !important;
    text-decoration: none !important;
    text-align: center !important;
    transition: background-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.5 !important;
    height: auto !important;
}

.check-price-button:hover, .view-product-btn:hover, 
.apply-filter-button:hover, .reset-button:hover {
    background-color: #0066cc !important;
    opacity: 0.9;
}

.responsive-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.flexible-pool-filter {
    background-color: #f5f5f5;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.flexible-pool-filter h3 {
    display: none;
}

.filter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.filter-left {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-width: 600px;
}

.filter-right {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    width: calc(50% - 15px);
    max-width: 300px;
    margin-bottom: 10px;
    text-align: center;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.filter-group select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    max-height: 300px;
    overflow-y: auto;
}

.filter-actions {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: auto !important;
}

.apply-filter-button, .reset-button {
    width: auto !important;
    min-width: 120px !important;
    box-sizing: border-box !important;
}

#loading-indicator {
    margin-top: 10px;
    font-style: italic;
    color: #666;
}

/* Advanced columns support (same as original) */
.advanced-column {
    display: none;
}

/* Mobile responsive design */
@media screen and (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        gap: 15px;
    }

    .filter-left {
        flex-direction: column;
        max-width: 100%;
        gap: 10px;
        width: 100%;
    }

    .filter-right {
        width: 100%;
        margin-top: 10px;
    }

    .filter-group {
        width: 100%;
        max-width: 100%;
    }

    .filter-actions {
        flex-direction: row;
        width: 100%;
        gap: 15px;
        justify-content: center;
    }

    .apply-filter-button, .reset-button {
        width: 45% !important;
    }

    .flexible-pool-table {
        width: 100%;
        display: block;
        font-size: 12px;
    }

    .flexible-pool-table th, .flexible-pool-table td {
        padding: 8px;
    }

    .flexible-pool-table td:last-child {
        min-width: 200px !important;
        max-width: 250px !important;
    }

    .check-price-button, .view-product-btn {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    .flexible-pool-filter h3 {
        font-size: 16px;
    }
}

/* Extra small screens */
@media screen and (max-width: 480px) {
    .flexible-pool-table td:last-child {
        min-width: 150px !important;
        max-width: 200px !important;
        font-size: 12px;
    }
    
    .filter-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .apply-filter-button, .reset-button {
        width: 100% !important;
    }

    .filter-group {
        min-width: 100%;
    }
}

/* When there are many columns, make table more compact */
.flexible-pool-table.many-columns {
    font-size: 12px;
}

.flexible-pool-table.many-columns th,
.flexible-pool-table.many-columns td {
    padding: 6px 8px;
}

/* Special styling for specific column types */
.flexible-pool-table td[data-column="Check_Price"],
.flexible-pool-table td[data-column="Affiliate_URL"] {
    text-align: center;
    min-width: 120px;
}

.flexible-pool-table td[data-column="Brand_and_Model"] {
    min-width: 200px;
    font-weight: 500;
}

.flexible-pool-table td[data-column="Pool_Size_Class"],
.flexible-pool-table td[data-column="Budget_Tier"],
.flexible-pool-table td[data-column="Weight_Class"] {
    min-width: 100px;
    text-align: center;
}

/* Ensure consistent button styling across all table configurations */
.flexible-pool-table .check-price-button {
    white-space: nowrap;
    min-width: 100px;
}

/* Hide empty filter sections */
.filter-container:empty {
    display: none;
}

.filter-left:empty + .filter-right {
    width: 100%;
    justify-content: center;
}

/* When no dropdown filters are present, hide the entire filter section except title */
.flexible-pool-filter.no-filters .filter-container {
    display: none;
}

.flexible-pool-filter.no-filters {
    padding: 15px 15px 5px 15px;
    margin-bottom: 10px;
}
