/**
 * Portfolio Filter Component Styles - DROPDOWN VERSION
 * Modern searchable dropdown filter
 */

/* ==========================================================================
   FILTER WRAPPER - CENTERED
   ========================================================================== */

.cpp-filter-wrapper {
    background: transparent; /* ✅ Changed from #ffffff to transparent */
    padding: 25px 20px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   FILTER CONTAINER - CENTERED LAYOUT
   ========================================================================== */

.cpp-filter-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

/* Filter Title */
.cpp-filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    letter-spacing: 0.5px;
    text-transform: capitalize; /* ✅ Changed from lowercase */
}

/* ==========================================================================
   CUSTOM DROPDOWN WRAPPER
   ========================================================================== */

.cpp-dropdown-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

/* ==========================================================================
   DROPDOWN BUTTON (TRIGGER)
   ========================================================================== */

button.cpp-dropdown-btn{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #ffffff;
    border: 2px solid #e5e5e5;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    outline: none;
    text-transform: capitalize; /* ✅ Changed from uppercase */
    letter-spacing: 0.5px; /* ✅ Reduced from 1px */
}

button.cpp-dropdown-btn:hover {
    border-color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

button.cpp-dropdown-btn.active {
    border-color: #1a1a1a;
    background: #f9f9f9;
}

/* Dropdown Button Text */
.cpp-dropdown-text {
    flex: 1;
    text-align: left;
    padding-left: 8px;
}

/* Dropdown Icon (Arrow) */
.cpp-dropdown-icon {
    font-size: 12px;
    margin-left: 10px;
    transition: transform 0.3s ease;
    color: #666;
}

button.cpp-dropdown-btn.active .cpp-dropdown-icon {
    transform: rotate(180deg);
}

/* ==========================================================================
   DROPDOWN MENU (OPTIONS LIST)
   ========================================================================== */

.cpp-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #ffffff;
    border: 2px solid #e5e5e5;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 8px 0; /* ✅ Added padding since no search box */
}

.cpp-dropdown-menu.show {
    max-height: 320px; /* ✅ Adjusted height */
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   DROPDOWN OPTIONS LIST
   ========================================================================== */

.cpp-dropdown-options {
    max-height: 280px;
    overflow-y: auto;
    padding: 0; /* ✅ Removed padding */
}

/* Custom Scrollbar */
.cpp-dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.cpp-dropdown-options::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.cpp-dropdown-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.cpp-dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ==========================================================================
   DROPDOWN OPTION ITEMS
   ========================================================================== */

.cpp-dropdown-option {
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    text-align: left;
    text-transform: capitalize; /* ✅ Added capitalize */
}

.cpp-dropdown-option:hover {
    background: #f9f9f9;
    color: #1a1a1a;
    padding-left: 28px;
}

.cpp-dropdown-option.active {
    background: #1a1a1a;
    color: #ffffff;
    font-weight: 600;
}

.cpp-dropdown-option.active:hover {
    background: #2a2a2a;
}

/* ✅ REMOVED: Option Check Icon - Hide completely */
.cpp-option-check {
    display: none; /* ✅ Completely hidden */
}

/* No Results Message */
.cpp-dropdown-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* ==========================================================================
   PORTFOLIO ITEMS - FILTERING STATES
   ========================================================================== */

.cpp-home-item {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.cpp-home-item.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
    left: -9999px;
}

.cpp-home-item.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    position: relative;
    left: auto;
}

/* ==========================================================================
   NO RESULTS MESSAGE (GRID)
   ========================================================================== */

.cpp-no-filter-results {
    text-align: center;
    padding: 80px 20px;
    color: #666;
    display: none;
    grid-column: 1 / -1;
}

.cpp-no-filter-results.show {
    display: block;
}

.cpp-no-filter-results h3 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333;
}

.cpp-no-filter-results p {
    font-size: 16px;
    margin: 0;
    color: #666;
}

/* ==========================================================================
   RESPONSIVE - MOBILE & TABLET
   ========================================================================== */

@media (max-width: 768px) {
    .cpp-filter-wrapper {
        padding: 25px 15px;
    }

    .cpp-filter-container {
        max-width: 100%;
    }

    .cpp-dropdown-wrapper {
        max-width: 100%;
    }

    button.cpp-dropdown-btn {
        padding: 14px 20px;
        font-size: 14px;
    }

    .cpp-filter-title {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .cpp-dropdown-menu {
        border-radius: 12px;
    }

    .cpp-dropdown-options {
        max-height: 240px;
    }
}

@media (max-width: 480px) {
    .cpp-filter-wrapper {
        padding: 20px 15px;
    }

    button.cpp-dropdown-btn {
        padding: 12px 18px;
        font-size: 13px;
    }

    .cpp-filter-title {
        font-size: 15px;
    }

    .cpp-dropdown-option {
        padding: 12px 20px;
        font-size: 13px;
    }

    .cpp-search-input {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ==========================================================================
   ANIMATION ENHANCEMENTS
   ========================================================================== */

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cpp-dropdown-menu.show {
    animation: dropdownFadeIn 0.3s ease;
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.cpp-filter-loading .cpp-home-grid {
    opacity: 0.5;
    pointer-events: none;
}

/* ✅ UPDATED: Transparent overlay that allows clicking through */
.cpp-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    display: none;
    background: rgba(0, 0, 0, 0.3); /* ✅ Semi-transparent dark overlay */
    backdrop-filter: blur(2px); /* ✅ Optional: slight blur effect */
}

.cpp-dropdown-overlay.active {
    display: block;
}