/**
 * @author    SWM
 * @copyright 2025 SWM
 * @license   https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2.0 or later
 */

.tdbinpacking-meta-box {
    position: relative;
}

#tdbinpacking_simulation.postbox {
    overflow: visible !important;
}

#tdbinpacking_simulation .inside {
    overflow: visible !important;
}

#tdbinpacking_simulation > div:nth-child(2) {
    padding: 1.5em 2em;
}

.tdbinpacking-sticky-nav {
    position: sticky;
    top: 120px !important;
    z-index: 9999 !important;
    background: #fff;
    padding: 10px 15px;
    margin: 0 0 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    transition: top 0.2s ease;
    border-bottom: 1px solid #c3c4c7;
}

.tdbinpacking-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background-color: #fff;
    color: #2271b1;
    text-decoration: none;
    border: 1px solid #2271b1;
    border-radius: 3px;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.tdbinpacking-nav-btn:hover {
    background-color: #f0f0f1;
    color: #2271b1;
}

.tdbinpacking-nav-btn:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.tdbinpacking-nav-btn-top {
    background-color: #2271b1;
    color: #fff;
}

.tdbinpacking-nav-btn-top:hover {
    background-color: #135e96;
}

.tdbinpacking-nav-btn .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.tdbinpacking-carrier-card {
    scroll-margin-top: 120px;
}

.tdbinpacking-logistics-warning {
    margin: 15px 0 20px 0;
    padding: 15px 15px 18px 15px;
    border-left: 4px solid #ffb900;
    background: #fff8e5;
}

.logistics-warning-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.logistics-warning-content .dashicons {
    color: #f0b849;
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-top: 0;
    flex-shrink: 0;
}

.warning-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
}

.logistics-changes-list {
    margin: 10px 0 10px 20px;
    list-style: disc;
}

.logistics-changes-list > li {
    margin-bottom: 8px;
    color: #333;
}

.product-changes {
    margin: 5px 0 5px 20px;
    list-style: circle;
    font-size: 13px;
}

.product-changes li {
    margin-bottom: 3px;
    color: #666;
}

.warning-footer {
    margin: 12px 0 3px 0;
    color: #666;
    font-size: 13px;
}

.tdbinpacking-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.tdbinpacking-actions .button .dashicons {
    line-height: 28px;
    vertical-align: middle;
    margin-right: 5px;
}

.tdbinpacking-loading {
    padding: 15px;
    text-align: center;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 15px 0;
}

.tdbinpacking-loading-text {
    font-size: 14px;
    color: #666;
    vertical-align: middle;
}

.tdbinpacking-no-results {
    padding: 30px;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 4px;
    margin: 15px 0;
}

.tdbinpacking-no-results .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
}

.tdbinpacking-results-wrapper {
    margin-top: 20px;
}

.tdbinpacking-simulation-card {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tdbinpacking-simulation-header {
    padding: 15px;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
}

.tdbinpacking-simulation-header h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
}

.tdbinpacking-simulation-header > div {
    font-size: 12px;
    color: #666;
    text-align: left;
}

.tdbinpacking-simulation-header h3 .dashicons {
    color: #0073aa;
    vertical-align: middle;
}

.tdbinpacking-simulation-header .dashicons-yes {
    color: #46b450;
}

.tdbinpacking-simulation-header .dashicons-no {
    color: #dc3232;
}

.tdbinpacking-stats {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.tdbinpacking-stat-box {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
    text-align: center;
}

.tdbinpacking-stat-box div:first-child {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tdbinpacking-stat-box div:last-child {
    font-size: 28px;
    font-weight: bold;
    color: #0073aa;
}

.tdbinpacking-bins {
    padding: 15px;
    border-top: 1px solid #eee;
}

.tdbinpacking-bins h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.tdbinpacking-bin {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fafafa;
}

.tdbinpacking-bin > div:first-child {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.tdbinpacking-visualization {
    margin: 15px 0;
    text-align: center;
}

.tdbinpacking-visualization img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tdbinpacking-items table {
    margin-top: 10px;
    font-size: 12px;
    border-collapse: collapse;
    width: 100%;
}

.tdbinpacking-items table th {
    background: #f0f0f0;
    font-weight: 600;
    padding: 8px;
    text-align: left;
    border-bottom: 2px solid #ddd;
}

.tdbinpacking-items table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.tdbinpacking-items table tbody tr:hover {
    background: #f5f5f5;
}

.tdbinpacking-not-packed {
    padding: 15px;
    border-top: 1px solid #eee;
    background: #fff8e5;
}

.tdbinpacking-not-packed h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #dc3232;
}

.tdbinpacking-not-packed h4 .dashicons {
    vertical-align: middle;
    margin-right: 5px;
}

.tdbinpacking-not-packed table th {
    background: #fff3cd;
}

.tdbinpacking-errors {
    padding: 15px;
    border-top: 1px solid #eee;
    background: #ffeaea;
}

.tdbinpacking-errors h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #dc3232;
}

.tdbinpacking-errors h4 .dashicons {
    vertical-align: middle;
    margin-right: 5px;
}

.tdbinpacking-errors > div {
    padding: 10px;
    margin-bottom: 8px;
    background: #fff;
    border-left: 3px solid #dc3232;
    font-size: 12px;
    border-radius: 0 3px 3px 0;
}

.tdbinpacking-errors > div:last-child {
    margin-bottom: 0;
}

.tdbinpacking-error {
    padding: 15px;
    background: #ffeaea;
    border-left: 4px solid #dc3232;
}

.tdbinpacking-error p {
    color: #dc3232;
    margin: 0;
}

#tdbinpacking-messages {
    margin-bottom: 15px;
}

#tdbinpacking-messages .notice {
    position: relative;
    padding-right: 38px;
}

.tdbinpacking-show-visualization {
    background-color: transparent !important;
    border: 1px solid transparent !important;
}

.tdbinpacking-show-visualization:hover {
    background-color: #f0f0f0 !important;
    border: 1px solid #ddd !important;
}

.tdbinpacking-show-visualization .dashicons {
    vertical-align: middle;
    margin-top: -2px;
}

.tdbinpacking-show-visualization span:last-child {
    vertical-align: middle;
    font-weight: bold;
}

.tdbinpacking-meta-box .tdbinpacking-actions {
    margin: 15px 0;
    text-align: right;
}

.tdbinpacking-meta-box .tdbinpacking-actions .description {
    margin-top: 10px;
}

.tdbinpacking-meta-box .tdbinpacking-loading {
    display: none;
}

.tdbinpacking-meta-box .tdbinpacking-loading .spinner {
    float: none;
    margin: 0 10px 0 0;
}

.tdbinpacking-meta-box .tdbinpacking-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

.tdbinpacking-meta-box .tdbinpacking-no-results .dashicons {
    font-size: 20px;
    vertical-align: middle;
}

.tdbinpacking-results-wrapper > div[style*="padding: 20px"] {
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
}

.tdbinpacking-stats-grid {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.tdbinpacking-stats-section {
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.tdbinpacking-stats-section h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    padding-bottom: 8px;
}

.tdbinpacking-stats-section table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

.tdbinpacking-stats-section table td {
    padding: 3px 0;
}

.tdbinpacking-stats-section table td:first-child {
    color: #666;
}

.tdbinpacking-stats-section table td:last-child {
    text-align: right;
    font-weight: 600;
}

.tdbinpacking-stats-section table tr:not(:first-child) td {
    border-top: 1px solid #eee;
}

.tdbinpacking-stats-section p {
    margin: 0;
    color: #666;
    font-size: 12px;
}

.tdbinpacking-bins-grid {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.tdbinpacking-bin-card {
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
}

.tdbinpacking-bin-header {
    padding: 12px 15px;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
}

.tdbinpacking-bin-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tdbinpacking-bin-header .dashicons-info {
    color: #6c757d;
    cursor: help;
    font-size: 1.1rem;
}

.tdbinpacking-bin-stats {
    padding: 8px 15px;
}

.tdbinpacking-bin-stats table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

.tdbinpacking-bin-stats table td {
    padding: 4px 0;
}

.tdbinpacking-bin-stats table td:nth-child(1),
.tdbinpacking-bin-stats table td:nth-child(3) {
    width: 25%;
    text-align: left;
    color: #666;
}

.tdbinpacking-bin-stats table td:nth-child(2) {
    width: 25%;
    padding-right: 50px;
    text-align: right;
}

.tdbinpacking-bin-stats table td:nth-child(4) {
    width: 25%;
    text-align: right;
}

.tdbinpacking-bin-visualization {
    padding: 12px 15px;
    text-align: center;
}

.tdbinpacking-bin-items {
    padding: 15px;
}

.tdbinpacking-bin-items table {
    font-size: 12px;
    background: #fff;
    border-collapse: collapse;
    width: 100%;
}

.tdbinpacking-bin-items table th {
    padding: 8px;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}

.tdbinpacking-bin-items table th:first-child {
    text-align: left;
}

.tdbinpacking-bin-items table th:not(:first-child) {
    text-align: center;
}

.tdbinpacking-bin-items table td {
    padding: 4px 8px;
}

.tdbinpacking-bin-items table td:first-child {
    text-align: left;
}

.tdbinpacking-bin-items table td:not(:first-child) {
    text-align: center;
}

.tdbinpacking-bin-items table td:last-child {
    font-weight: 600;
}

.tdbinpacking-bin-items table td:last-child strong {
    color: #0073aa;
}

.tdbinpacking-bin-items table td small {
    color: #666;
}

.tdbinpacking-dimensions-form {
    padding: 20px;
    margin: 5px 0 20px 0;
}

.tdbinpacking-dimensions-form h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #dc3232;
    display: flex;
    align-items: center;
}

.tdbinpacking-dimensions-form h4 .dashicons {
    margin-right: 5px;
    color: #dc3232;
}

.tdbinpacking-dimensions-form p.description {
    margin: 0 0 15px 0;
    color: #666;
}

.tdbinpacking-dimensions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.tdbinpacking-dimensions-table thead th {
    padding: 8px 5px;
    font-weight: 600;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.tdbinpacking-dimensions-table tbody td {
    padding: 8px 5px;
    font-size: 13px;
}

.tdbinpacking-dimensions-table .col-product {
    width: 30%;
    min-width: 200px;
}

.tdbinpacking-dimensions-table .col-qty {
    width: 8%;
    text-align: center;
}

.tdbinpacking-dimensions-table .col-dimension {
    width: 12%;
}

.tdbinpacking-dimensions-table .col-vr {
    width: 180px;
    min-width: 180px;
    text-align: center;
    vertical-align: middle;
}

.tdbinpacking-dimensions-table thead th.col-vr {
    padding-right: 8px;
}

.tdbinpacking-dimensions-table td.col-vr {
    vertical-align: middle;
    padding-right: 8px;
}

.tdbinpacking-dimensions-table input[type="number"] {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
}

.tdbinpacking-dimensions-table input[type="number"]:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.tdbinpacking-dimensions-table .vr-placeholder {
    display: inline-block;
    color: #999;
    font-style: italic;
    font-size: 12px;
}

.tdbinpack-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1;
    justify-content: flex-end;
}

.tdbinpack-toggle-status-text {
    font-size: 14px;
    color: #1d2327;
    min-width: 70px;
    text-align: left;
    flex-shrink: 0;
}

.tdbinpack-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    vertical-align: middle;
}

.tdbinpack-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tdbinpack-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.tdbinpack-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.tdbinpack-toggle-switch input:checked + .tdbinpack-toggle-slider {
    background-color: #0073aa;
}

.tdbinpack-toggle-switch input:focus + .tdbinpack-toggle-slider {
    box-shadow: 0 0 1px #0073aa;
}

.tdbinpack-toggle-switch input:checked + .tdbinpack-toggle-slider:before {
    transform: translateX(24px);
}

.tdbinpacking-dimensions-actions {
    margin-top: 15px;
    text-align: right;
}
