/**
 * AJAX Portfolio Filter Styles
 */

/* Filter Wrapper */

/* Mobile Dropdown - Hidden on desktop */
.apf-filter-dropdown {
    display: none;
    align-items: center;
    gap: 12px;
}

.apf-filter-label {
    font-size: 16px;
    font-weight: 500;
    color: #7A7A7A;
    white-space: nowrap;
    font-family: inherit;
}

.apf-filter-select {
    width: 450px;
    max-width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-family: inherit;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.apf-filter-select:focus {
    outline: none;
    border-color: #a259ff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Filter Tabs Container - Shown on desktop */
.apf-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: center;
}

/* Individual Filter Tab */
.apf-filter-tab {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 5px 0 !important;
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    color: #7A7A7A !important;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    font-family: inherit;
    line-height: 1.5;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
}

.apf-filter-tab:hover {
    color: #000 !important;
    background: none !important;
    background-color: transparent !important;
}

.apf-filter-tab:focus {
    outline: none !important;
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Active Tab */
.apf-filter-tab.active {
    color: #a259ff !important;
    font-weight: 500 !important;
    background: none !important;
    background-color: transparent !important;
}

/* Active Tab Underline */
.apf-filter-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #a259ff;
}

/* Responsive - Mobile */
@media (max-width: 768px) {

    /* Show dropdown on mobile */
    .apf-filter-dropdown {
        display: flex;
    }

    /* Hide tabs on mobile */
    .apf-filter-tabs {
        display: none;
    }
}

/* Loading Overlay */
.apf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Spinner */
.apf-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(124, 58, 237, 0.1);
    border-left-color: #7C3AED;
    border-radius: 50%;
    animation: apf-spin 1s linear infinite;
}

@keyframes apf-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Fix for Elementor loop items after AJAX - ensure excerpts on small cards are hidden */
/* Hide excerpts on ALL small cards by default (regardless of taxonomy) */
.gv--portfolio__grid .type-company .excerpt {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show excerpt on hover for all cards */
.gv--portfolio__grid .company:hover .excerpt {
    opacity: 1 !important;
    visibility: visible !important;
}

/* EXCEPTION: Ensure big cards (18n+3 and 18n+10 in Fund IV) always show their excerpt */
.gv--portfolio__grid .portfolio-category-graphite-fund-iv:nth-of-type(18n+3) .excerpt,
.gv--portfolio__grid .portfolio-category-graphite-fund-iv:nth-of-type(18n+10) .excerpt {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Skeleton Loading Effect */
.apf-skeleton-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    animation: apf-skeleton-fade-in 0.3s ease-in-out;
    width: 100%;
}

.apf-skeleton-item:nth-child(1) {
    animation-delay: 0s;
}

.apf-skeleton-item:nth-child(2) {
    animation-delay: 0.05s;
}

.apf-skeleton-item:nth-child(3) {
    animation-delay: 0.1s;
}

.apf-skeleton-item:nth-child(4) {
    animation-delay: 0.15s;
}

.apf-skeleton-item:nth-child(5) {
    animation-delay: 0.2s;
}

.apf-skeleton-item:nth-child(6) {
    animation-delay: 0.25s;
}

.apf-skeleton-item:nth-child(7) {
    animation-delay: 0.3s;
}

.apf-skeleton-item:nth-child(8) {
    animation-delay: 0.35s;
}

.apf-skeleton-item:nth-child(n+9) {
    animation-delay: 0.4s;
}

.apf-skeleton-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: apf-skeleton-loading 1.5s ease-in-out infinite;
}

.apf-skeleton-content {
    padding: 20px;
}

.apf-skeleton-title {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: apf-skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 12px;
    width: 70%;
}

.apf-skeleton-text {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: apf-skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.apf-skeleton-text:last-child {
    width: 50%;
    margin-bottom: 0;
}

@keyframes apf-skeleton-loading {
    0% {
        background-position: 200% 0;
    }

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

@keyframes apf-skeleton-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error state */
.apf-error {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 16px;
}