/* Skeleton container aligns visually with results grid */
#search-engine-skeleton {
    margin-top: 12px;
    width: 100%;
    /* Explicit full width */
    max-width: 100%;
    display: block;
    /* Ensure block flow */
    overflow: hidden;
    /* Prevent collapse */
    min-height: 50vh;
}

#search-engine-skeleton .se-skeleton.se-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
    /* Fill parent */
    min-height: 50vh;
    /* Prevent collapse */
}

/* Cards */
#search-engine-skeleton .se-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    min-height: 220px;
    height: 100%;
    width: 100%;
    position: relative;
}

/* Image placeholder */
#search-engine-skeleton .se-card::before {
    content: "";
    display: block;
    width: 100%;
    height: 140px;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
    background-size: 400% 100%;
    animation: se-shimmer 1.2s ease-in-out infinite;
}

/* Text lines */
#search-engine-skeleton .se-card::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 48px;
    background:
        linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%) 0 0 / 400% 100% no-repeat,
        linear-gradient(#eee, #eee) 0 0 / 70% 10px no-repeat,
        linear-gradient(#eee, #eee) 0 16px / 50% 10px no-repeat;
    animation: se-shimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 1200px) {
    #search-engine-skeleton .se-skeleton.se-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    #search-engine-skeleton .se-skeleton.se-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    #search-engine-skeleton .se-skeleton.se-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

@keyframes se-shimmer {
    0% {
        background-position: 0% 0;
    }

    100% {
        background-position: -135% 0;
    }
}

@keyframes se-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}