/* --- CORE ENGINE --- */

body [class*="skeleto-"] {
    position: relative !important;
    overflow: hidden !important;
    pointer-events: none !important;
    user-select: none !important;
    background-color: #d1d1d1 !important;
    /* Solid base grey */
    background-image: none !important;
    border-color: #d1d1d1 !important;
    min-height: 10px;
    z-index: 10 !important;
    color: transparent !important;
    text-shadow: none !important;
    margin-bottom: 0.8rem;
}

body [class*="skeleto-"]::after {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: -150% !important;
    width: 300% !important;
    height: 100% !important;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.45) 50%,
            rgba(255, 255, 255, 0) 100%) !important;
    z-index: 9999 !important;
    animation: bs-shimmer 2s infinite linear !important;
    pointer-events: none !important;
}

@keyframes bs-shimmer {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(100%);
    }
}

body [class*="skeleto-"]>* {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* --- DYNAMIC RADIUS HOOKS --- */
.skeleto-card {
    border-radius: var(--bs-radius-card, 8px) !important;
}

.skeleto-button,
.skeleto-btn {
    border-radius: var(--bs-radius-button, 30px) !important;
}

.skeleto-image {
    border-radius: var(--bs-radius-image, 8px) !important;
}

.skeleto-select {
    border-radius: var(--bs-radius-select, 8px) !important;
}

.skeleto-input {
    border-radius: var(--bs-radius-input, 8px) !important;
}

.skeleto-btn::after,
.skeleto-button::after {
    border-radius: var(--bs-radius-button, 30px) !important;
}

.skeleto-image::after {
    border-radius: var(--bs-radius-image, 8px) !important;
}

/* --- SHAPE UTILITIES --- */
.skeleto-square {
    aspect-ratio: 1/1 !important;
}

.skeleto-circle,
.skeleto-avatar {
    border-radius: 50% !important;
    overflow: hidden;
    aspect-ratio: 1/1 !important;
}

.skeleto-circle::after,
.skeleto-avatar::after {
    border-radius: 50% !important;
}

/* --- TEXT UTILITIES --- */
.skeleto-text {
    height: 3.5em !important;
    width: 100% !important;
    display: block !important;
    border-radius: 4px !important;
    background-color: transparent !important;
    background-image:
        linear-gradient(#e0e0e0 100%, transparent 0),
        linear-gradient(#e0e0e0 100%, transparent 0),
        linear-gradient(#e0e0e0 100%, transparent 0) !important;

    background-repeat: no-repeat !important;

    background-size:
        100% 0.5em,
        90% 0.5em,
        65% 0.5em !important;

    background-position:
        0 0.5em,
        0 1.5em,
        0 2.5em !important;

    margin-bottom: 1rem !important;
    margin-top: 5px !important;
    pointer-events: none !important;
}

.skeleto-line,
.skeleto-title {
    height: 15px !important;
    margin-bottom: 0.25em !important;
    width: 75% !important;
    display: block !important;
    border-radius: 8px !important;
    margin-top: 5px !important;
}

/* --- LAYOUT UTILITIES --- */
.skeleto-block {
    min-height: auto !important;
    width: 100%;
    display: block;
}

/* Masonry Gallery: 9 Staggered segments */
body .skeleto-gallery-masonry {
    min-height: 450px !important;
    background-color: transparent !important;
    background-image:
        linear-gradient(#e0e0e0, #e0e0e0), linear-gradient(#e0e0e0, #e0e0e0), linear-gradient(#e0e0e0, #e0e0e0),
        linear-gradient(#e0e0e0, #e0e0e0), linear-gradient(#e0e0e0, #e0e0e0), linear-gradient(#e0e0e0, #e0e0e0),
        linear-gradient(#e0e0e0, #e0e0e0), linear-gradient(#e0e0e0, #e0e0e0), linear-gradient(#e0e0e0, #e0e0e0) !important;
    background-size: 30% 140px, 30% 80px, 30% 160px, 30% 100px, 30% 150px, 30% 70px, 30% 120px, 30% 130px, 30% 90px !important;
    background-position:
        0% 0, 50% 0, 100% 0,
        0% 155px, 50% 95px, 100% 175px,
        0% 270px, 50% 260px, 100% 260px !important;
    background-repeat: no-repeat !important;
    border-radius: var(--bs-radius-gallery-masonry, 8px) !important;
}

/* --- COMPLEX LAYOUTS --- */

.skeleto-list {
    min-height: 80px;
    background: #d1d1d1 !important;
    background:
        radial-gradient(circle at 35px 40px, #c0c0c0 24px, transparent 25px),
        linear-gradient(to right, #c0c0c0 0%, #c0c0c0 100%),
        linear-gradient(to right, #c0c0c0 0%, #c0c0c0 100%),
        #d1d1d1 !important;
    background-size: 100% 100%, 60% 8px, 40% 8px;
    background-position: 0 0, 75px 30px, 75px 45px;
    background-repeat: no-repeat;
    border-radius: var(--bs-radius-card, 8px);
    margin-bottom: 20px !important;
}

.skeleto-item {
    margin-bottom: 20px !important;
}

.skeleto-table {
    min-height: 100px;
    background:
        linear-gradient(to right, #c0c0c0 20%, transparent 20%, transparent 25%, #c0c0c0 25%, #c0c0c0 65%, transparent 65%, transparent 70%, #c0c0c0 70%, #c0c0c0 90%),
        linear-gradient(to right, #c0c0c0 20%, transparent 20%, transparent 25%, #c0c0c0 25%, #c0c0c0 65%, transparent 65%, transparent 70%, #c0c0c0 70%, #c0c0c0 90%),
        #d1d1d1 !important;
    background-size: 100% 8px, 100% 8px;
    background-position: 0 20px, 0 50px;
    background-repeat: no-repeat;
    padding: 20px;
    border-radius: var(--bs-radius-card, 8px);
}

.skeleto-progress {
    height: 10px;
    background: #f0f0f0 !important;
    border-radius: 8px !important;
    position: relative;
    overflow: hidden;
}

.skeleto-progress::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 45%;
    background: #afafaf;
    border-radius: 8px;
    z-index: 5;
}

/* --- UI COMPONENTS --- */
.skeleto-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #d1d1d1;
    border-radius: 50% !important;
    animation: bs-spin 1s linear infinite !important;
    background: none !important;
}

@keyframes bs-spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleto-icon {
    width: 40px;
    height: 40px;
    border-radius: 99px;
}

.skeleto-badge,
.skeleto-tag {
    height: 20px;
    width: 60px;
    display: inline-block;
    border-radius: 10px;
}

.skeleto-textarea {
    min-height: 60px;
}

.skeleto-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.skeleto-radio {
    width: 18px;
    height: 18px;
    border-radius: 50% !important;
}

.skeleto-toggle {
    width: 36px;
    height: 15px;
    border-radius: 8px !important;
}

.skeleto-alert {
    width: 100%;
    min-height: 50px;
    border-left: 3px solid #d1d1d1;
    border-radius: 8px;
}

/* --- STRUCTURAL --- */
.skeleto-sidebar {
    width: 250px;
    height: 100%;
    min-height: 400px;
}

.skeleto-navbar,
.skeleto-footer,
.skeleto-header {
    width: 100%;
    height: 60px;
}