/* Custom styles for AssetTracker */

/* Dashboard cards */
.small-box {
    border-radius: 0.25rem;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    display: block;
    margin-bottom: 20px;
    position: relative;
}

.small-box > .inner {
    padding: 10px;
}

.small-box > .small-box-footer {
    background: rgba(0,0,0,0.1);
    color: rgba(255,255,255,0.8);
    display: block;
    padding: 3px 0;
    position: relative;
    text-align: center;
    text-decoration: none;
    z-index: 10;
}

.small-box > .small-box-footer:hover {
    background: rgba(0,0,0,0.15);
    color: #fff;
}

.small-box h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 10px;
    padding: 0;
    white-space: nowrap;
}

.small-box p {
    font-size: 1rem;
}

.small-box .icon {
    color: rgba(0,0,0,0.15);
    position: absolute;
    right: 10px;
    top: 0;
    transition: all .3s linear;
    z-index: 0;
}

.small-box .icon > i {
    font-size: 5rem;
    line-height: 5rem;
}

.small-box .icon > i.fa,
.small-box .icon > i.fas,
.small-box .icon > i.far,
.small-box .icon > i.fab,
.small-box .icon > i.glyphicon,
.small-box .icon > i.ion {
    font-size: 5rem;
}

.small-box:hover .icon {
    font-size: 5.6rem;
}

.small-box:hover .icon > i {
    font-size: 5.6rem;
}

/* Status badges */
.badge {
    padding: 0.4em 0.6em;
    font-size: 75%;
    font-weight: 600;
}

.badge-success {
    background-color: #28a745;
    color: #fff;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: #fff;
}

.badge-info {
    background-color: #17a2b8;
    color: #fff;
}

.badge-primary {
    background-color: #007bff;
    color: #fff;
}

.badge-secondary {
    background-color: #6c757d;
    color: #fff;
}

.badge-dark {
    background-color: #343a40;
    color: #fff;
}

/* Product list for dashboard */
.products-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.products-list > .item {
    border-radius: 3px;
    background: #fff;
    display: table;
    padding: 10px 0;
    width: 100%;
}

.products-list > .item .product-img {
    display: table-cell;
    vertical-align: top;
    width: 50px;
}

.products-list > .item .product-img img {
    width: 50px;
    height: 50px;
}

.products-list > .item .product-info {
    display: table-cell;
    padding: 0 10px;
    vertical-align: top;
}

.products-list > .item .product-info .product-title {
    font-size: 16px;
    font-weight: 600;
}

.products-list > .item .product-info .product-description {
    color: #6c757d;
    display: block;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Login/Register pages */
.login-page,
.register-page {
    background: #e9ecef;
    min-height: 100vh;
}

.login-box,
.register-box {
    width: 360px;
    margin: 7% auto;
}

@media (max-width: 576px) {
    .login-box,
    .register-box {
        width: 90%;
        margin-top: 20px;
    }
}

.login-logo,
.register-logo {
    font-size: 2.1rem;
    font-weight: 300;
    margin-bottom: 0.9rem;
    text-align: center;
}

.login-logo a,
.register-logo a {
    color: #495057;
}

.login-card-body,
.register-card-body {
    background: #fff;
    padding: 20px;
    border-top: 0;
    color: #666;
}

.login-box-msg,
.register-box-msg {
    margin: 0;
    padding: 0 20px 20px;
    text-align: center;
}

/* File upload */
.custom-file-label::after {
    content: "Browse";
}

/* Loading overlay */
#loadingOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

#loadingOverlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Toast notifications */
.toast-success {
    background-color: #28a745;
}

.toast-error {
    background-color: #dc3545;
}

.toast-warning {
    background-color: #ffc107;
}

.toast-info {
    background-color: #17a2b8;
}

/* Tree view for categories */
.jstree-default .jstree-clicked {
    background: #bee5eb;
    border-radius: 3px;
    box-shadow: inset 0 0 1px #999;
}

.jstree-default .jstree-hovered {
    background: #f8f9fa;
    border-radius: 3px;
    box-shadow: inset 0 0 1px #ccc;
}

/* Print styles */
@media print {
    .main-header,
    .main-sidebar,
    .main-footer,
    .btn,
    .card-tools {
        display: none !important;
    }
    
    .content-wrapper {
        margin-left: 0 !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
}

/* RTL Support */
.rtl .main-sidebar {
    direction: rtl;
}

.rtl .nav-sidebar .nav-item > .nav-link {
    text-align: right;
}

.rtl .nav-sidebar .nav-item > .nav-link .right {
    float: left;
}

/* Accessibility */
:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .preloader img {
        width: 60px;
        height: 60px;
        animation: shake 1.5s infinite;
    }

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

/* Prevent text wrapping in table headers and cells */
.table-nowrap th,
.table-nowrap td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adds ... if content overflows */
}

/* Optional: fix header z-index if using fixed header */
.dataTables_scrollHeadInner {
    width: 100% !important;
}