/* ===== POG COMPONENT STYLES ===== */

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1050;
    overflow-x: hidden;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    margin: 20px;
    position: relative;
    overflow: hidden;
}

.modal-large {
    max-width: 800px;
}

.modal-small {
    max-width: 400px;
}

/* ===== MODAL SECTIONS ===== */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #edebe9;
    background-color: #faf9f8;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #323130;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #605e5c;
    cursor: pointer;
    padding: 4px;
    border-radius: 2px;
    line-height: 1;
    transition: all 0.1s ease;
}

.modal-close:hover {
    background-color: #f3f2f1;
    color: #323130;
}

.modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #edebe9;
    background-color: #faf9f8;
}

/* ===== CATEGORY TREE ===== */
.category-tree {
    width: 100%;
}

.category-item {
    margin-bottom: 2px;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.1s ease;
    user-select: none;
}

.category-header:hover {
    background-color: #f3f2f1;
}

.category-toggle {
    width: 16px;
    height: 16px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    border-radius: 2px;
    color: #605e5c;
    transition: all 0.1s ease;
}

.category-toggle:hover {
    background-color: #edebe9;
    color: #323130;
}

.category-toggle::after {
    content: '▶';
    font-size: 10px;
    transition: transform 0.2s ease;
}

.category-item.expanded .category-toggle::after {
    transform: rotate(90deg);
}

.category-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #323130;
}

.category-count {
    font-size: 12px;
    color: #605e5c;
    background-color: #f3f2f1;
    padding: 2px 6px;
    border-radius: 8px;
    min-width: 20px;
    text-align: center;
}

/* ===== SKU LIST ===== */
.sku-list {
    margin-left: 24px;
    border-left: 1px solid #edebe9;
    padding-left: 8px;
    display: none;
}

.category-item.expanded .sku-list {
    display: block;
}

.sku-item-sidebar {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin-bottom: 2px;
    border-radius: 2px;
    cursor: grab;
    transition: all 0.1s ease;
    background-color: #ffffff;
    border: 1px solid #edebe9;
}

.sku-item-sidebar:hover {
    background-color: #f3f2f1;
    border-color: #8a8886;
    transform: translateX(2px);
}

.sku-item-sidebar:active {
    cursor: grabbing;
}

.sku-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 2px;
    margin-right: 8px;
    background-color: #faf9f8;
    border: 1px solid #edebe9;
}

.sku-name {
    flex: 1;
    font-size: 13px;
    color: #323130;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sku-dimensions {
    font-size: 11px;
    color: #605e5c;
    white-space: nowrap;
}

/* ===== CANVAS SKU ITEMS ===== */
.sku-item {
    position: absolute;
    border: 2px solid #8a8886;
    background-color: #ffffff;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #323130;
    text-align: center;
    overflow: hidden;
    transition: all 0.1s ease;
    user-select: none;
}

.sku-item:hover {
    border-color: #605e5c;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 10;
}

.sku-item.selected {
    border-color: #0078d4;
    box-shadow: 0 0 0 1px #0078d4;
    z-index: 20;
}

.sku-item.dragging {
    opacity: 0.8;
    transform: scale(1.05);
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.sku-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ===== DROP ZONES ===== */
.drop-zone {
    position: relative;
    transition: all 0.2s ease;
    border: 2px dashed transparent;
}

.drop-zone.highlight {
    border-color: #0078d4;
    background-color: rgba(0, 120, 212, 0.1);
}

.drop-zone.drop-valid {
    border-color: #107c10;
    background-color: rgba(16, 124, 16, 0.1);
}

.drop-zone.drop-invalid {
    border-color: #d13438;
    background-color: rgba(209, 52, 56, 0.1);
}

/* ===== PROGRESS BARS ===== */
.progress {
    width: 100%;
    height: 8px;
    background-color: #f3f2f1;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background-color: #0078d4;
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar.bg-success {
    background-color: #107c10;
}

.progress-bar.bg-warning {
    background-color: #ffd23f;
}

.progress-bar.bg-danger {
    background-color: #d13438;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #323130;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* ===== TOOLTIPS ===== */
.tooltip {
    position: absolute;
    z-index: 1070;
    display: block;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.tooltip.show {
    opacity: 1;
}

.tooltip-inner {
    max-width: 200px;
    padding: 4px 8px;
    background-color: #323130;
    color: #ffffff;
    text-align: center;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
}

.tooltip-top .tooltip-arrow {
    bottom: -4px;
    left: 50%;
    margin-left: -4px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #323130;
}

.tooltip-bottom .tooltip-arrow {
    top: -4px;
    left: 50%;
    margin-left: -4px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #323130;
}

/* ===== LOADING SPINNER ===== */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #f3f2f1;
    border-top: 2px solid #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 1px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 20px;
}

.alert-primary {
    background-color: #cce7ff;
    border-color: #0078d4;
    color: #004578;
}

.alert-success {
    background-color: #c6efce;
    border-color: #107c10;
    color: #0e5814;
}

.alert-warning {
    background-color: #fff2cc;
    border-color: #ffd23f;
    color: #8a5400;
}

.alert-danger {
    background-color: #ffc7ce;
    border-color: #d13438;
    color: #9c0e1b;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #0596aa;
    color: #0c5460;
}

.alert-dismissible {
    padding-right: 48px;
    position: relative;
}

.alert-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: #0078d4;
    color: #ffffff;
}

.badge-secondary {
    background-color: #8a8886;
    color: #ffffff;
}

.badge-success {
    background-color: #107c10;
    color: #ffffff;
}

.badge-warning {
    background-color: #ffd23f;
    color: #323130;
}

.badge-danger {
    background-color: #d13438;
    color: #ffffff;
}

.badge-info {
    background-color: #0596aa;
    color: #ffffff;
}

/* ===== BREADCRUMBS ===== */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 8px 0;
    margin-bottom: 16px;
    list-style: none;
    background-color: transparent;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '>';
    padding: 0 8px;
    color: #8a8886;
}

.breadcrumb-item a {
    color: #0078d4;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #605e5c;
}

/* ===== CONTEXT MENU ===== */
.context-menu {
    position: fixed;
    background-color: #ffffff;
    border: 1px solid #edebe9;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 1060;
    min-width: 160px;
    padding: 4px 0;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.1s ease;
    pointer-events: none;
}

.context-menu.show {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.context-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 14px;
    color: #323130;
    cursor: pointer;
    transition: background-color 0.1s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.context-menu-item:hover {
    background-color: #f3f2f1;
}

.context-menu-item:disabled {
    color: #a19f9d;
    cursor: not-allowed;
}

.context-menu-item:disabled:hover {
    background-color: transparent;
}

.context-menu-separator {
    height: 1px;
    background-color: #edebe9;
    margin: 4px 0;
}

/* ===== TABS ===== */
.nav-tabs {
    display: flex;
    border-bottom: 1px solid #edebe9;
    margin-bottom: 16px;
}

.nav-tab {
    padding: 12px 16px;
    border: 1px solid transparent;
    border-bottom: none;
    background-color: transparent;
    color: #605e5c;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px 4px 0 0;
    margin-right: 2px;
    transition: all 0.1s ease;
}

.nav-tab:hover {
    background-color: #f3f2f1;
    color: #323130;
}

.nav-tab.active {
    background-color: #ffffff;
    border-color: #edebe9;
    color: #0078d4;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== COLLAPSIBLE PANELS ===== */
.collapse-panel {
    border: 1px solid #edebe9;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.collapse-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #faf9f8;
    cursor: pointer;
    transition: background-color 0.1s ease;
    user-select: none;
}

.collapse-header:hover {
    background-color: #f3f2f1;
}

.collapse-toggle {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    transition: transform 0.2s ease;
}

.collapse-panel.expanded .collapse-toggle {
    transform: rotate(90deg);
}

.collapse-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #323130;
}

.collapse-content {
    padding: 16px;
    display: none;
    border-top: 1px solid #edebe9;
}

.collapse-panel.expanded .collapse-content {
    display: block;
}

/* ===== RESPONSIVE COMPONENTS ===== */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .category-header {
        padding: 12px 8px;
    }
    
    .sku-item-sidebar {
        padding: 8px;
    }
    
    .sku-name {
        font-size: 14px;
    }
    
    .sku-dimensions {
        font-size: 12px;
    }
    
    .context-menu {
        min-width: 140px;
    }
    
    .context-menu-item {
        padding: 12px 16px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tab {
        flex-shrink: 0;
        min-width: fit-content;
    }
    
    .breadcrumb {
        font-size: 12px;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 4px;
    }
}