/* AKoT Search Plugin Styles */
#page-wrapper{
    padding-bottom:0 !important;
}

.akot-search2-categories {
    border-right: 1px solid #e9ecef;
    padding-right: 20px;
    width: 275px !important;
}

.akot-search2-category-btn {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 12px 16px !important;
    margin-bottom: 8px !important;
    font-size: 18px !important;
    text-align: left !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    white-space: nowrap !important;
}

.akot-search2-category-btn:hover {
    background-color: #dff1ee !important;
    color: #212529 !important;
}
.akot-search2-category-btn:focus {
    box-shadow: none !important;
}

.akot-search2-category-btn.active {
    background-color: #2fd1c9 !important;
    color: white !important;
    font-weight: 1000 !important;
}

.akot-search2-category-btn .badge {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    border: none !important;
    font-weight: 500;
    font-size: 13px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
}

.akot-search2-category-btn.active .badge {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    font-weight: 1000;
}

.akot-search-result-item,
.akot-search-result-item-simple {
    display: flex;
    flex-direction: column;
    height: 500px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease;
}

.akot-search-result-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.akot-search-item-logo {
    width: 100%;
    height: 150px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* News/Newsletter items - taller images */
.akot-search2-category-results[data-category="news"] .akot-search-item-logo {
    height: 200px;
    position: relative;
}

/* Add "NEWS" text for empty news image containers */
.akot-search2-category-results[data-category="news"] .akot-search-item-logo:empty::after,
.akot-search2-category-results[data-category="news"] .akot-search-item-logo:not(:has(img))::after {
    content: "NEWS";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 4px;
    color: rgb(89, 219, 213);
    text-shadow: 1px 3px 2px rgba(0, 0, 0, 0.2);
}

/* Jobs - no image area */
.akot-search2-category-results[data-category="jobs"] .akot-search-item-logo {
    display: none;
}

/* Adjust card content for jobs without images */
.akot-search2-category-results[data-category="jobs"] .akot-search-item-content {
    padding-top: 30px;
}

.akot-search-item-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.akot-search-item-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.akot-search-item-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #212529;
}

.akot-search-item-excerpt {
    flex: 1;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 16px;
    overflow: hidden;
}

.akot-search-item-content .details {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #6c757d;
}

.akot-search-item-content .details span {
    display: inline-block;
}

/* Style for simple items (like other programs) */
.akot-search-result-item-simple {
    padding: 20px;
    justify-content: center;
}

.akot-search-result-item-simple .akot-search-item-title {
    margin-bottom: 8px;
}

.akot-search-result-item-simple .akot-search-item-address {
    color: #6c757d;
    font-size: 14px;
}

/* Mobile Menu Button */
.akot-mobile-menu-button {
    position: fixed;
    bottom: 95px; /* Positioned above the back-to-top button (adjust based on your button) */
    right: 15px;
    width: 40px; /* Typical back-to-top button size */
    height: 40px; /* Typical back-to-top button size */
    font-size: 40px;
    background-color: #59dbd5; /* Common neutral color - adjust to match yours */
    color: #fff;
    border-radius: 40px; /* Square with rounded corners instead of circle */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    transform: scale(0.8);
}

.akot-mobile-menu-button.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.akot-mobile-menu-button:hover {
    background-color: #5a6268; /* Darker shade on hover */
    transform: scale(1.1);
}

.akot-mobile-menu-button:active {
    transform: scale(0.95);
}

/* Mobile Menu Overlay */
.akot-mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.akot-mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Panel */
.akot-mobile-menu-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.akot-mobile-menu-panel.active {
    transform: translateY(0);
}

/* Mobile Menu Header */
.akot-mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Mobile Menu Categories */
.akot-mobile-menu-categories {
    padding: 20px;
}

.akot-mobile-category-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.akot-mobile-category-btn:active {
    transform: scale(0.98);
}

.akot-mobile-category-btn.active {
    background-color: #007bff !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.akot-mobile-category-btn.active .badge {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

/* Mobile Responsive Styles */
@media (max-width: 767px) {
    /* Adjust wrapper to be a column layout on mobile */
    .akot-search2-wrapper {
        flex-direction: column !important;
        gap: 20px !important;
    }

    /* Make categories section full width and visible at top */
    .akot-search2-categories {
        display: block !important; /* Override the display: none */
        width: 100% !important;
        border-right: none !important;
        padding-right: 0 !important;
        margin-bottom: 20px;
    }

    /* Remove sticky positioning on mobile */
    .akot-search2-categories > div {
        position: static !important;
    }

    /* Mobile search info styling */
    .akot-search-info {
        background-color: #f8f9fa;
        padding: 16px;
        border-radius: 8px;
        margin-bottom: 16px !important;
        border-bottom: none !important;
    }

    /* Stack category buttons nicely on mobile */
    .akot-category-navigation {
        display: flex !important;
        flex-direction: column !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        padding-bottom: 0 !important;
    }

    /* Style category buttons for mobile */
    .akot-search2-category-btn {
        margin-right: 0 !important;
        margin-bottom: 8px !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 8px !important;
        padding: 14px 16px !important;
        font-size: 16px !important;
        min-width: 100% !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease !important;
    }

    .akot-search2-category-btn:last-child {
        margin-bottom: 0 !important;
    }

    .akot-search2-category-btn:active {
        transform: scale(0.98);
    }

    .akot-search2-category-btn.active {
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3) !important;
    }

    /* Ensure results take full width on mobile */
    .akot-search2-results {
        width: 100% !important;
    }

    .akot-search2-results-grid {
        grid-template-columns: 1fr !important;
    }

    /* Mobile card height adjustments */
    .akot-search-result-item,
    .akot-search-result-item-simple {
        height: auto !important;
        max-height: 500px !important;
        min-height: auto !important;
    }

    /* Keep image heights consistent on mobile */
    .akot-search-item-logo {
        flex-shrink: 0; /* Prevent image area from shrinking */
    }

    /* Let content area shrink to fit */
    .akot-search-item-content {
        min-height: 0;
        flex: 0 1 auto; /* Allow shrinking but not growing */
    }

    /* Ensure excerpt doesn't push card too tall */
    .akot-search-item-excerpt {
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 4; /* Limit to 4 lines on mobile */
        -webkit-box-orient: vertical;
    }

    /* Show mobile menu button only on mobile */
    .akot-mobile-menu-button {
        display: flex !important;
    }
}

/* Ensure desktop styles work properly */
@media (min-width: 768px) {
    /* Hide all mobile menu components on desktop */
    .akot-mobile-menu-button,
    .akot-mobile-menu-overlay,
    .akot-mobile-menu-panel {
        display: none !important;
    }

    /* Show desktop categories */
    .akot-search2-categories {
        display: block !important;
        width: 275px !important;
        flex-shrink: 0 !important;
    }

    /* Adjust grid for wider cards on desktop */
    .akot-search2-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(375px, 1fr)) !important;
    }

    /* Ensure button text doesn't wrap on desktop */
    .akot-search2-category-btn span {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin-right: 10px !important;
    }
}