/* Universal Size Table Plugin - Frontend Styles */

/* Bataleon-style Size Table */
.ust-frontend-size-table,
.ust-frontend-size-table-summary {
    margin: 30px 0;
    width: 100%;
}

.ust-frontend-size-table h2,
.ust-frontend-size-table-summary h3 {
    font-size: 24px;
    font-weight: 400;
    color: #333;
    margin-bottom: 20px;
    text-align: left;
}

.ust-size-table-container {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}

.ust-frontend-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    background: #fff;
    border: 1px solid #e1e1e1;
}

.ust-frontend-table thead th {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    text-align: center;
    padding: 12px 8px;
    border: 1px solid #e1e1e1;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ust-frontend-table tbody th.row-header {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    border: 1px solid #e1e1e1;
    white-space: nowrap;
    min-width: 80px;
}

.ust-frontend-table tbody td {
    text-align: center;
    padding: 12px 8px;
    border: 1px solid #e1e1e1;
    color: #555;
    font-weight: 400;
    min-width: 40px;
}

.ust-frontend-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.ust-frontend-table tbody tr:hover {
    background: #f0f8ff;
}

/* WooCommerce tab integration */
.woocommerce-tabs .ust-frontend-size-table {
    margin: 0;
    padding: 20px 0;
}

.woocommerce-tabs .ust-frontend-size-table h2 {
    margin-top: 0;
}

/* Size Recommendation Tool */
.ust-size-recommendation-tool {
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.ust-size-recommendation-tool h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.ust-size-finder {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ust-size-finder label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.ust-shoe-size-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    min-width: 150px;
}

.ust-find-size-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ust-find-size-btn:hover {
    background: #005a87;
}

.ust-find-size-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ust-size-recommendation {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ust-recommendation-result {
    text-align: center;
}

.ust-recommended-size {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    margin: 10px 0;
}

.ust-size-explanation {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.ust-size-warning {
    background: #ffc107;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
}

.ust-size-error {
    background: #dc3545;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
}

.ust-recommended-cell {
    position: relative;
}

/* Best match gets a vertical line indicator */
.ust-recommended-cell.fit-100 {
    background-color: rgba(100, 100, 100, 0.25) !important;
    font-weight: bold !important;
    border-left: 2px solid rgba(100, 100, 100, 0.5) !important;
    border-right: 2px solid rgba(100, 100, 100, 0.5) !important;
}

.ust-recommended-cell.fit-75 {
    background-color: rgba(120, 120, 120, 0.15) !important;
    font-weight: 600 !important;
}

.ust-recommended-cell.fit-50 {
    background-color: rgba(140, 140, 140, 0.10) !important;
}

.ust-recommended-cell.fit-25 {
    background-color: rgba(160, 160, 160, 0.06) !important;
}

.ust-recommended-cell::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* Size range highlighting */
.ust-frontend-table {
    position: relative;
}

.ust-size-range-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.ust-size-range {
    position: absolute;
    top: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ust-size-range.active {
    opacity: 1;
}

.ust-cell-solid {
    background-color: #e0e0e0 !important;
}

.ust-cell-fade-in {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #e0e0e0 100%) !important;
}

.ust-cell-fade-out {
    background: linear-gradient(90deg, #e0e0e0 0%, rgba(255, 255, 255, 0) 100%) !important;
}

/* Specific overrides for when we want to keep colors but use the fade style */
.ust-size-range-s .ust-cell-solid {
    background-color: rgba(255, 193, 7, 0.3) !important;
}

.ust-size-range-s .ust-cell-fade-in {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0) 0%, rgba(255, 193, 7, 0.3) 100%) !important;
}

.ust-size-range-s .ust-cell-fade-out {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.3) 0%, rgba(255, 193, 7, 0) 100%) !important;
}

.ust-size-range-ml .ust-cell-solid {
    background-color: rgba(40, 167, 69, 0.3) !important;
}

.ust-size-range-ml .ust-cell-fade-in {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0) 0%, rgba(40, 167, 69, 0.3) 100%) !important;
}

.ust-size-range-ml .ust-cell-fade-out {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.3) 0%, rgba(40, 167, 69, 0) 100%) !important;
}

.ust-size-range-lxl .ust-cell-solid {
    background-color: rgba(220, 53, 69, 0.3) !important;
}

.ust-size-range-lxl .ust-cell-fade-in {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0) 0%, rgba(220, 53, 69, 0.3) 100%) !important;
}

.ust-size-range-lxl .ust-cell-fade-out {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.3) 0%, rgba(220, 53, 69, 0) 100%) !important;
}

/* Column highlighting on hover - thin vertical line */
.ust-frontend-table tbody tr td {
    position: relative;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

/* Vertical highlight effect - thin line on sides */
.ust-frontend-table tbody tr td.column-hover {
    background-color: rgba(0, 123, 255, 0.05) !important;
    border-left: 2px solid rgba(0, 123, 255, 0.4) !important;
    border-right: 2px solid rgba(0, 123, 255, 0.4) !important;
}

.ust-frontend-table thead th.column-hover {
    background-color: rgba(0, 123, 255, 0.08) !important;
    border-left: 2px solid rgba(0, 123, 255, 0.5) !important;
    border-right: 2px solid rgba(0, 123, 255, 0.5) !important;
}

/* Binding size cell hover - just highlight the text */
.ust-binding-size-cell {
    position: relative;
    cursor: pointer;
    font-weight: 500;
}

.ust-binding-size-cell:hover {
    font-weight: bold;
    color: #0073aa;
}

/* Responsive design for Bataleon style */
@media (max-width: 768px) {
    .ust-size-table-container {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .ust-frontend-table {
        min-width: 600px;
        font-size: 12px;
    }

    .ust-frontend-table thead th,
    .ust-frontend-table tbody th.row-header,
    .ust-frontend-table tbody td {
        padding: 8px 6px;
    }

    .ust-frontend-size-table h2,
    .ust-frontend-size-table-summary h3 {
        font-size: 20px;
    }

    .ust-size-finder {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ust-shoe-size-select,
    .ust-find-size-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ust-frontend-table {
        font-size: 11px;
    }

    .ust-frontend-table thead th,
    .ust-frontend-table tbody th.row-header,
    .ust-frontend-table tbody td {
        padding: 6px 4px;
    }
}

.universal-size-table-frontend,
.universal-size-table-shortcode {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.universal-size-table-frontend h3,
.universal-size-table-shortcode h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

.ust-size-table table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 14px;
}

.ust-size-table table th,
.ust-size-table table td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #ddd;
    vertical-align: middle;
}

.ust-size-table table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.ust-size-table table th:first-child {
    text-align: left;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
}

.ust-size-table table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.ust-size-table table tbody tr:hover {
    background: #e3f2fd;
    transition: background-color 0.2s ease;
}

.ust-size-table table td:first-child {
    font-weight: 600;
    color: #0073aa;
    text-align: left;
    background: #f0f8ff;
}

/* Size table meta information */
.ust-size-table p {
    margin: 5px 0;
    font-size: 12px;
    color: #666;
}

.ust-size-table p:last-child {
    margin-bottom: 0;
}

/* Sizing guide section */
.ust-sizing-guide {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.ust-sizing-guide p {
    margin: 0;
    color: #0c5460;
    font-size: 14px;
}

/* Confidence indicator styling */
.confidence-high {
    color: #28a745;
    font-weight: 600;
}

.confidence-medium {
    color: #ffc107;
    font-weight: 600;
}

.confidence-low {
    color: #dc3545;
    font-weight: 600;
}

/* Shortcode style variations */
.universal-size-table-shortcode.style-compact {
    padding: 15px;
    margin: 15px 0;
}

.universal-size-table-shortcode.style-compact .ust-size-table table {
    font-size: 12px;
}

.universal-size-table-shortcode.style-compact .ust-size-table table th,
.universal-size-table-shortcode.style-compact .ust-size-table table td {
    padding: 8px 6px;
}

.universal-size-table-shortcode.style-minimal {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 10px 0;
}

.universal-size-table-shortcode.style-minimal h3 {
    border-bottom: 1px solid #ddd;
    font-size: 1.1em;
}

/* Responsive design */
@media (max-width: 768px) {

    .universal-size-table-frontend,
    .universal-size-table-shortcode {
        padding: 15px;
        margin: 15px 0;
    }

    .ust-size-table table {
        font-size: 12px;
    }

    .ust-size-table table th,
    .ust-size-table table td {
        padding: 8px 4px;
    }

    .ust-size-table table th {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .ust-size-table table {
        font-size: 11px;
    }

    .ust-size-table table th,
    .ust-size-table table td {
        padding: 6px 3px;
    }

    .universal-size-table-frontend h3,
    .universal-size-table-shortcode h3 {
        font-size: 1.1em;
    }
}

/* Print styles */
@media print {

    .universal-size-table-frontend,
    .universal-size-table-shortcode {
        box-shadow: none;
        border: 1px solid #000;
        background: white;
    }

    .ust-size-table table th {
        background: #f0f0f0 !important;
        color: #000 !important;
    }

    .ust-size-table table th:first-child {
        background: #d0d0d0 !important;
        color: #000 !important;
    }
}