/* Avantsec Category Modal — Styles */

.avs-category-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.avs-category-modal[aria-hidden=false],
.avs-category-modal:not([hidden]) {
    display: flex;
}

/* Backdrop */
.avs-category-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(13, 21, 32, 0.92);
    animation: avsModalFadeIn 0.25s ease;
}

/* Panel */
.avs-category-modal__panel {
    position: relative;
    z-index: 1;
    width: 92%;
    max-width: 1100px;
    max-height: 85vh;
    background: #0d1520;
    border: 1px solid rgba(0, 107, 182, 0.3);
    border-radius: 12px;
    padding: 2rem 2rem 1.5rem;
    overflow-y: auto;
    animation: avsModalSlideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* Header */
.avs-category-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.avs-category-modal__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
}

/* Close button */
.avs-category-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: transparent;
    color: #b0b8c1;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.avs-category-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.avs-category-modal__close:focus-visible {
    outline: 2px solid #00b4d8;
    outline-offset: 2px;
}

/* Grid */
.avs-category-modal__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Card */
.avs-category-modal__card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 107, 182, 0.2);
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    cursor: pointer;
    min-height: 54px;
}

.avs-category-modal__card:hover {
    background: rgba(0, 180, 216, 0.1);
    border-color: rgba(0, 180, 216, 0.4);
    text-decoration: none;
    color: #ffffff;
}

.avs-category-modal__card:focus-visible {
    outline: 2px solid #00b4d8;
    outline-offset: 2px;
}

.avs-category-modal__card-name {
    font-size: 20px;
    font-weight: 500;
    color: #e9ecef;
    line-height: 1.3;
}

.avs-category-modal__card-arrow {
    flex-shrink: 0;
    margin-left: 0.75rem;
    font-size: 0.85rem;
    color: #5c728a;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.avs-category-modal__card:hover .avs-category-modal__card-arrow {
    color: #00b4d8;
    transform: translateX(3px);
}

/* Loading */
.avs-category-modal__loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #7a8a9e;
    font-size: 1rem;
}

.avs-category-modal__spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(0, 180, 216, 0.2);
    border-top-color: #00b4d8;
    border-radius: 50%;
    margin-right: 0.75rem;
    animation: avsSpinner 0.7s linear infinite;
}

/* Error */
.avs-category-modal__error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1rem;
    color: #b0b8c1;
}

.avs-category-modal__error-text {
    margin-bottom: 1rem;
    font-size: 20px;
}

.avs-category-modal__retry {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 180, 216, 0.15);
    border: 1px solid rgba(0, 180, 216, 0.4);
    border-radius: 6px;
    color: #00b4d8;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.avs-category-modal__retry:hover {
    background: rgba(0, 180, 216, 0.25);
}

/* Show all button */
.avs-category-modal__show-all-wrap {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.avs-category-modal__show-all {
    padding: 0.6rem 2rem;
    background: transparent;
    border: 1px solid rgba(0, 180, 216, 0.4);
    border-radius: 8px;
    color: #00b4d8;
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.avs-category-modal__show-all:hover {
    background: rgba(0, 180, 216, 0.15);
    color: #ffffff;
}

.avs-category-modal__show-all:focus-visible {
    outline: 2px solid #00b4d8;
    outline-offset: 2px;
}

/* Animations */
@keyframes avsModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes avsModalSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes avsSpinner {
    to { transform: rotate(360deg); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .avs-category-modal__backdrop,
    .avs-category-modal__panel,
    .avs-category-modal__card,
    .avs-category-modal__card-arrow {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Tablet */
@media (max-width: 991px) {
    .avs-category-modal__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .avs-category-modal__panel {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .avs-category-modal__title {
        font-size: 1.3rem;
    }
}

/* Mobile */
@media (max-width: 575px) {
    .avs-category-modal__grid {
        grid-template-columns: 1fr;
    }

    .avs-category-modal__panel {
        width: 95%;
        padding: 1.25rem 1rem 1rem;
        max-height: 90vh;
        border-radius: 8px;
    }

    .avs-category-modal__title {
        font-size: 20px;
    }

    .avs-category-modal__header {
        margin-bottom: 1.25rem;
    }
}

/* Mobile: larger category names */
@media (max-width: 575px) {
    .avs-category-modal__card-name {
        font-size: 22px;
    }
    .avs-category-modal__show-all {
        font-size: 22px;
    }
}
