/* ============================================
   SHIMMER LOADER STYLES
   Modern, animated loading skeletons
   ============================================ */

/* Base Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Shimmer Base Class */
.shimmer {
    background: linear-gradient(90deg,
            #f0f0f0 0%,
            #f8f8f8 20%,
            #f0f0f0 40%,
            #f0f0f0 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 8px;
    display: inline-block;
}

/* Dark Mode Shimmer */
.shimmer-dark {
    background: linear-gradient(90deg,
            #2a2a2a 0%,
            #3a3a3a 20%,
            #2a2a2a 40%,
            #2a2a2a 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

/* ============================================
   SHIMMER COMPONENTS
   ============================================ */

/* Full Page Loader */
.shimmer-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.shimmer-loader-overlay.hidden {
    display: none;
}

/* Spinner Loader (for quick actions) */
.spinner-loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.spinner-loader-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

.spinner-loader-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* ============================================
   TABLE SHIMMER
   ============================================ */

.shimmer-table {
    width: 100%;
}

.shimmer-table-row {
    border-bottom: 1px solid #f0f0f0;
}

.shimmer-table-row td {
    padding: 1rem;
    vertical-align: middle;
}

.shimmer-table-cell {
    height: 20px;
    background: linear-gradient(90deg,
            #f0f0f0 0%,
            #f8f8f8 20%,
            #f0f0f0 40%,
            #f0f0f0 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 4px;
}

/* ============================================
   FORM SHIMMER
   ============================================ */

.shimmer-form {
    padding: 20px;
}

.shimmer-form-group {
    margin-bottom: 20px;
}

.shimmer-label {
    width: 120px;
    height: 16px;
    margin-bottom: 8px;
}

.shimmer-input {
    width: 100%;
    height: 45px;
}

.shimmer-button {
    width: 150px;
    height: 45px;
    margin-top: 10px;
}

/* ============================================
   CARD SHIMMER
   ============================================ */

.shimmer-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.shimmer-card-image {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.shimmer-card-title {
    width: 70%;
    height: 24px;
    margin-bottom: 10px;
}

.shimmer-card-text {
    width: 100%;
    height: 16px;
    margin-bottom: 8px;
}

.shimmer-card-text:last-child {
    width: 80%;
}

/* ============================================
   LIST SHIMMER
   ============================================ */

.shimmer-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.shimmer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
}

.shimmer-list-content {
    flex: 1;
}

.shimmer-list-title {
    width: 60%;
    height: 18px;
    margin-bottom: 8px;
}

.shimmer-list-subtitle {
    width: 40%;
    height: 14px;
}

/* ============================================
   DASHBOARD SHIMMER
   ============================================ */

.shimmer-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.shimmer-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.shimmer-stat-value {
    width: 80px;
    height: 32px;
    margin-bottom: 8px;
}

.shimmer-stat-label {
    width: 120px;
    height: 16px;
}

/* ============================================
   TEXT SHIMMER
   ============================================ */

.shimmer-text {
    height: 16px;
    margin-bottom: 8px;
}

.shimmer-text-sm {
    height: 12px;
}

.shimmer-text-lg {
    height: 20px;
}

.shimmer-text-xl {
    height: 28px;
}

.shimmer-text-full {
    width: 100%;
}

.shimmer-text-75 {
    width: 75%;
}

.shimmer-text-50 {
    width: 50%;
}

.shimmer-text-25 {
    width: 25%;
}

/* ============================================
   BUTTON LOADER
   ============================================ */

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-loading .btn-text {
    visibility: hidden;
}

/* ============================================
   INLINE LOADER
   ============================================ */

.inline-loader {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.inline-loader-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================
   PULSE ANIMATION (Alternative)
   ============================================ */

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.shimmer-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .shimmer-table-row {
        flex-direction: column;
    }

    .shimmer-table-cell {
        width: 100% !important;
        flex: none !important;
    }

    .shimmer-card-image {
        height: 150px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.shimmer-rounded {
    border-radius: 50%;
}

.shimmer-rounded-lg {
    border-radius: 12px;
}

.shimmer-rounded-md {
    border-radius: 8px;
}

.shimmer-rounded-sm {
    border-radius: 4px;
}

/* Hide content while loading */
.loading-content {
    display: none;
}

.loading-content.loaded {
    display: block;
}

/* Fade in animation when content loads */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}