/* GLOBAL SAFETY */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* SEARCH CONTAINER */
.search-container {
    padding-top: 6px;
    padding-bottom: inherit;
}

/* ANIMATED BACKGROUND */
.animated-bg {
    background: #becaed;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    animation: floatBg 3s ease-in-out infinite alternate;

    width: 100%;
    max-width: 100%;
    padding: 12px;
    margin: 0 8px;

    overflow: hidden; /* 🔥 CRITICAL */
}

@keyframes floatBg {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

.search-box {
    display: flex;
    gap: 8px; /* moderate gap */
    justify-content: center;
    align-items: center;

    width: 100%;
    max-width: 680px;
    margin: auto;

    overflow: hidden;
}

.search-input-auto {
    flex-grow: 1; /* input takes all available space */
    flex-shrink: 1;
    flex-basis: 0;

    height: 40px;
    line-height: 40px;

    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid #d1d1d1;

    font-size: 15px;
    background: #fff;

    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
    min-width: 0; /* prevent overflow */
}

.search-input-auto::placeholder {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

/* BUTTON */
.search-btn {
    flex-shrink: 0; /* button does not shrink */
    min-width: 90px; /* fixed minimum width */
    height: 40px;
    line-height: 40px;
    padding: 0 22px;

    border-radius: 12px;
    font-weight: 600;
    color: #fff;
    border: none;

    background: linear-gradient(135deg, #34c759, #00c6ff);
}


/* ================= MOBILE FIX (≤ 504px) ================= */
@media (max-width: 504px) {

    .search-box {
        flex-direction: column;
        align-items: stretch;
        gap: 10px; /* add vertical gap when stacked */
    }

    .search-input-auto,
    .search-btn {
        width: 100%;
        max-width: 100%;
    }
}



/* Professional Pagination */
.custom-pagination {
    gap: 10px;
    flex-wrap: wrap;
    padding: 0;
}

.custom-pagination .page-item {
    list-style: none;
}

.custom-pagination .page-link {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 14px;
    background: #fff;
    color: #334155;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 12px rgba(15, 23, 42, 0.08),
        0 1px 2px rgba(15, 23, 42, 0.04);
    transition: all 0.25s ease;
    padding: 0;
}

.custom-pagination .page-link:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    transform: translateY(-3px);
    box-shadow:
        0 10px 20px rgba(37, 99, 235, 0.28);
}

.custom-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    transform: scale(1.05);
    box-shadow:
        0 10px 22px rgba(245, 158, 11, 0.35);
}

.custom-pagination .page-item.disabled .page-link {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.8;
}

.custom-pagination .page-item:first-child .page-link,
.custom-pagination .page-item:last-child .page-link {
    width: 50px;
}

@media (max-width: 576px) {
    .custom-pagination {
        gap: 7px;
    }

    .custom-pagination .page-link {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 13px;
    }

    .custom-pagination .page-item:first-child .page-link,
    .custom-pagination .page-item:last-child .page-link {
        width: 42px;
    }
}
