/* Random Categories Listing Styling */


.random-categories-page .category__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.random-categories-page .category__item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid #eaeaea;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.random-categories-page .category__item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: #d1d1d1;
}

.random-categories-page .random-category-card__image-wrap {
    position: relative;
    overflow: hidden;
}

.random-categories-page .category__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.random-categories-page .category__item:hover .category__img {
    transform: scale(1.05);
}

.random-categories-page .category__title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin: 25px 0 15px;
    text-align: center;
    padding: 0 20px;
    text-transform: uppercase;
}

.random-categories-page .category__desc {
    font-size: 1.6rem;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
    padding: 0 20px;
}

.random-categories-page .category__action {
    margin: 10px 15px 15px;
    margin-top: auto;
    padding: 12px 0;
    color: var(--primary-color);
    text-align: center;
    font-size: 1.6rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 999px;
    transition: background 0.3s ease;
    text-decoration: none;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--primary-color);
}

.random-category-card>.random-category-card__popup {
    display: none;
}

.random-category-card {
    position: relative;
}

.random-category-floating-popup {
    display: block;
    position: fixed;
    z-index: 1100;
    width: min(340px, calc(100vw - 20px));
    background:
        radial-gradient(120% 140% at 12% 0%, rgba(27, 75, 143, 0.55), rgba(8, 13, 32, 0.95) 46%),
        linear-gradient(160deg, rgba(9, 20, 45, 0.96), rgba(7, 11, 28, 0.97));
    color: #f4f7ff;
    border: 1px solid rgba(90, 180, 255, 0.3);
    border-radius: 16px;
    box-shadow:
        0 14px 34px rgba(3, 8, 23, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 14px rgba(33, 113, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.97);
    transform-origin: 50% 100%;
    transition: opacity 0.18s ease, transform 0.18s ease;
    padding: 12px;
    overflow: hidden;
}

.random-category-floating-popup::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(130deg, rgba(80, 210, 255, 0.12), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.random-category-floating-popup::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 18px;
    height: 18px;
    transform: translateX(-50%) rotate(45deg);
    background: rgba(7, 11, 28, 0.96);
    border-right: 2px solid rgba(90, 180, 255, 0.5);
    border-bottom: 2px solid rgba(90, 180, 255, 0.5);
    box-shadow: 2px 2px 10px rgba(3, 8, 23, 0.35);
}

.random-category-floating-popup.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.random-category-floating-popup.is-below {
    transform: translateY(0) scale(1);
    transform-origin: 50% 0%;
}

.random-category-floating-popup.is-below::after {
    top: -8px;
    bottom: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 2px solid rgba(90, 180, 255, 0.5);
    border-top: 2px solid rgba(90, 180, 255, 0.5);
    box-shadow: -2px -2px 10px rgba(3, 8, 23, 0.35);
}

.random-category-card__popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 10px;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.random-category-card__popup-kicker {
    font-size: 1.1rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #d9ecff;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(136, 198, 255, 0.45);
    background: linear-gradient(180deg, rgba(76, 143, 230, 0.45), rgba(24, 63, 122, 0.35));
    box-shadow: 0 10px 20px rgba(10, 35, 77, 0.35) inset;
}

.random-category-card__overlay-text {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    color: rgba(238, 246, 255, 0.95);
    text-shadow: 0 1px 6px rgba(24, 100, 210, 0.22);
}

.random-category-card__popup-account {
    margin: 0;
    flex: 1 1 100%;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #7dd3fc;
    text-shadow: 0 0 8px rgba(125, 211, 252, 0.2);
}

.random-category-floating-popup.latest-account-theme .random-category-card__popup-account {
    color: #99f6e4;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.random-category-card__popup-account .title-kep {
    display: inline-block;
    margin-left: 4px;
    color: #fb923c;
    font-weight: 900;
}

.random-category-card__preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    position: relative;
    z-index: 2;
}

.random-category-floating-popup.preview-count-1 {
    width: min(210px, calc(100vw - 20px));
}

.random-category-floating-popup.preview-count-2 {
    width: min(280px, calc(100vw - 20px));
}

.random-category-floating-popup.preview-count-4 {
    width: min(280px, calc(100vw - 20px));
}

.random-category-floating-popup.preview-count-1 .random-category-card__preview-grid {
    grid-template-columns: 1fr;
}

.random-category-floating-popup.preview-count-2 .random-category-card__preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.random-category-floating-popup.preview-count-3 .random-category-card__preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.random-category-floating-popup.preview-count-4 .random-category-card__preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.random-category-card__preview-item {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(153, 214, 255, 0.4);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 7px 14px rgba(2, 6, 19, 0.28);
    opacity: 0;
    transform: translateY(8px) scale(0.92);
}

.random-category-card__preview-img {
    display: block;
    width: 100%;
    height: 82px;
    object-fit: cover;
}

.random-category-floating-popup.is-visible .random-category-card__preview-item {
    animation: randomPopupItemIn 320ms ease forwards;
}

.random-category-floating-popup.is-visible .random-category-card__preview-item:nth-child(1) {
    animation-delay: 20ms;
}

.random-category-floating-popup.is-visible .random-category-card__preview-item:nth-child(2) {
    animation-delay: 40ms;
}

.random-category-floating-popup.is-visible .random-category-card__preview-item:nth-child(3) {
    animation-delay: 60ms;
}

.random-category-floating-popup.is-visible .random-category-card__preview-item:nth-child(4) {
    animation-delay: 80ms;
}

.random-category-floating-popup.is-visible .random-category-card__preview-item:nth-child(5) {
    animation-delay: 100ms;
}

.random-category-floating-popup.is-visible .random-category-card__preview-item:nth-child(6) {
    animation-delay: 120ms;
}

@keyframes randomPopupItemIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* No Results */
.random-categories-page .no-results {
    grid-column: 1 / -1;
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.random-categories-page .no-results__icon {
    font-size: 4rem;
    color: var(--second-color);
    margin-bottom: 20px;
}

.random-categories-page .no-results__title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.random-categories-page .no-results__message {
    font-size: 1.6rem;
    color: #666;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .random-categories-page .category__list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }

    .random-categories-page .category__img {
        height: 180px;
    }

    .random-categories-page .category__title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {

    .random-categories-page .category__list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .random-categories-page .category__title {
        font-size: 1.8rem;
        margin: 20px 0 10px;
    }

}

@media (max-width: 600px) {
    .random-categories-page .category__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .random-categories-page .category__img {
        height: 130px;
    }

    .random-categories-page .category__title {
        font-size: 1.5rem;
        margin: 12px 0 8px;
        padding: 0 10px;
    }
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--second-color));
    border-radius: 3px;
}