/* Full CSS with all styles (unchanged except for confirming .wmw-table-view-container has overflow-x) */

.wmw-table-view-container {
    max-height: 600px;
    overflow-y: auto;
    /* ADDED for horizontal scroll: */
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.wmw-stock-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    color: #333;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.wmw-preferences-form {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    border: 1px solid #e0e0e0;
}

.wmw-preferences-section h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.wmw-form-group {
    margin-bottom: 2rem;
}

.wmw-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #34495e;
    font-size: 1.1rem;
}

.wmw-warehouse-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.8rem;
}

[type=checkbox], [type=radio] {
    display: none;
}

.wmw-checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.wmw-checkbox-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    border-color: #3498db;
}

.wmw-checkbox-custom {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    margin-right: 0.8rem;
    position: relative;
    transition: all 0.2s;
}

input[type="checkbox"]:checked + .wmw-checkbox-custom {
    background: #3498db;
    border-color: #3498db;
}

input[type="checkbox"]:checked + .wmw-checkbox-custom::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 14px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.wmw-view-toggle {
    display: inline-flex;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.wmw-view-btn {
    padding: 0.8rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #7f8c8d;
    transition: all 0.2s;
}

.wmw-view-btn.active {
    background: #3498db;
    color: white;
}

.wmw-view-btn .dashicons {
    font-size: 18px;
}

.wmw-save-btn {
    background: #27ae60;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.wmw-save-btn:hover {
    background: #219a52;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(39, 174, 96, 0.2);
}

.wmw-search-box {
    margin-bottom: 2rem;
}

#wmw-search-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

#wmw-search-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.wmw-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.wmw-product-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.wmw-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.product-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.product-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #eee;
}

.product-info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
    line-height: 1.4;
}

.product-info small {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.warehouse-stock-list {
    display: grid;
    gap: 1rem;
}

.warehouse-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.warehouse-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.warehouse-name {
    font-weight: 600;
    color: #3498db;
}

.stock-qty {
    font-weight: 700;
    color: #2ecc71;
}

.form-row {
    display: flex;
    gap: 0.5rem;
}

.qty {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
}

.button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.button:hover {
    background: #2980b9;
}

.out-of-stock {
    color: #e74c3c;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.5rem;
    background: #fdedec;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.wmw-table-view {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.wmw-table-view th {
    background: #3498db;
    color: white;
    padding: 1.2rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.wmw-table-view td {
    padding: 1.2rem;
    border-bottom: 1px solid #f0f0f0;
}

.product-cell {
    min-width: 300px;
}

.warehouse-cell {
    min-width: 200px;
}

.wmw-cart-notice {
    position: fixed;
    bottom: 20px;
    right: -100%;
    background: #27ae60;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    max-width: 90%;
}

.wmw-cart-notice.error {
    background: #e74c3c;
}

.wmw-cart-notice .dashicons {
    font-size: 1.2rem;
}

/* Responsivni stilovi */
@media (max-width: 768px) {

    .wmw-table-view-container {
        max-height: none;
        overflow-x: auto; /* ensure horizontal scrolling on mobile too */
    }

    .wmw-products-grid {
        grid-template-columns: 1fr;
    }
    
    .wmw-table-view {
        display: block;
        overflow-x: auto;
    }
    
    .wmw-warehouse-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .wmw-product-card {
        padding: 1rem;
    }
    
    .wmw-cart-notice {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        padding: 0.8rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* Animacije */
@keyframes slideIn {
    from {
        right: -100%;
        opacity: 0;
    }
    to {
        right: 20px;
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        right: 20px;
        opacity: 1;
    }
    to {
        right: -100%;
        opacity: 0;
    }
}

/* Dodatni stilovi za tabelu */
.wmw-table-view {
    position: relative;
}

.wmw-table-view:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.dataTables_wrapper {
    position: relative;
}

.dataTables_length,
.dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_filter input {
    border: 1px solid #ddd !important;
    padding: 0.3rem 0.5rem !important;
    border-radius: 4px;
}

/* Hover efekti za tabelu */
.wmw-table-view tbody tr {
    transition: background 0.2s;
}

.wmw-table-view tbody tr:hover {
    background-color: #f8f9fa !important;
}

/* Loading stanje */
.wmw-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.wmw-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip za dugmad */
.button[title]:hover:after {
    content: attr(title);
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;
}

/* Border radius konzistentnost */
.wmw-product-card,
.wmw-table-view,
.wmw-warehouse-checkboxes label,
.wmw-view-toggle button {
    border-radius: 8px;
}

/* Shadow konsistencija */
.wmw-product-card,
.wmw-preferences-form,
.wmw-table-view {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Transition efekti */
.wmw-product-card,
.wmw-checkbox-label,
.button,
.wmw-view-btn {
    transition: all 0.2s ease-in-out;
}

.wmw-warehouse-selection {
	margin:10px 0px 40px 0px;
}

.wmw-warehouse-selection p {
	padding-bottom:15px;
}

.wmw-warehouse-selection label.radio-container {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 20px;
    cursor: pointer;
    font-size: 15px;
    user-select: none;
	  justify-content:center;
	  line-height:20px;
	  
}

.wmw-warehouse-selection label.radio-container input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.wmw-warehouse-selection label.radio-container .custom-radio {
    position: absolute;
    top: 0;
    left: 0;
    height: 25px;
    width: 25px;
    background-color: #f1f1f1;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.wmw-warehouse-selection label.radio-container:hover input ~ .custom-radio {
    background-color: #ddd;
}

.wmw-warehouse-selection label.radio-container input[type="radio"]:checked ~ .custom-radio {
    background-color: #0073aa;
}

.wmw-warehouse-selection label.radio-container .custom-radio:after {
    content: "";
    position: absolute;
    display: none;
}

.wmw-warehouse-selection label.radio-container input[type="radio"]:checked ~ .custom-radio:after {
    display: block;
}

.wmw-warehouse-selection label.radio-container .custom-radio:after {
    top: 9px;
    left: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: white;
}
