/**
 * Use Cases Grid Styles
 */

.use-cases-container {
    padding: 0;
}

/* Filter Styles - CloudTalk Inspired */
.use-cases-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.use-case-filter-dropdown {
    position: relative;
    min-width: 200px;
    max-width: 320px;
    width: 100%;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* 8px */
    padding: 0.5rem 0.75rem; /* 8px 12px - less chunky */
    background: #fff;
    border: 1px solid #d5d7da;
    border-radius: 0.5rem; /* 8px */
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(10, 13, 18, 0.05);
    position: relative;
    min-width: 0; /* Allow flex items to shrink */
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
    /* Removed min-height for less chunky appearance */
}

.filter-toggle::after {
    content: "";
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23717680' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center center;
    background-size: contain;
    margin-left: auto;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.use-case-filter-dropdown.open .filter-toggle::after {
    transform: rotate(180deg);
}

.filter-toggle:hover {
    border-color: #8495ff;
    background: #f8f9ff;
}

.use-case-filter-dropdown.open .filter-toggle {
    border-color: #8495ff;
    background: #f8f9ff;
    z-index: 101;
}

.filter-label-prefix {
    color: #181d27;
    font-weight: 500;
    font-size: 14px; /* Smaller font for less chunky appearance */
    line-height: 1.25rem; /* 20px */
    flex-shrink: 0;
    font-family: var(--e-global-typography-4a427e6-font-family, 'Silka', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
}

.filter-label-selected {
    color: #535862;
    font-weight: 400;
    font-size: 14px; /* Smaller font for less chunky appearance */
    line-height: 1.25rem; /* 20px */
    flex: 1;
    font-family: var(--e-global-typography-4a427e6-font-family, 'Silka', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0; /* Important for flex truncation */
    max-width: 100%;
}

/* Text part that can be truncated */
.filter-label-selected .label-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    /* Allow shrinking */
    flex: 1 1 auto;
    /* Allow to grow and shrink */
    max-width: calc(100% - 40px);
    /* Leave space for count badge */
}

/* When there's no count badge, text can use full width */
.filter-label-selected .label-text:only-child {
    max-width: 100%;
}

/* Label Extra Count Badge - CloudTalk Production Style */
.label-extra-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Silka', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
    line-height: 0.875rem; /* 14px */
    color: #3538cd; /* Blue color for light mode */
    text-align: center;
    background: #eef4ff; /* Light blue background */
    border: 1px solid #c7d7fe; /* Light blue border */
    padding: 0.125rem 0.5rem; /* 2px 8px */
    border-radius: 9999px; /* Fully rounded */
    transition: all 0.2s ease;
    flex-shrink: 0; /* Never shrink the count badge */
    margin-left: 4px;
    min-height: auto;
    height: auto;
}

/* Hover state when dropdown is open */
.use-case-filter-dropdown.open .label-extra-count {
    background: #dde8ff;
    border-color: #a4bcfd;
    color: #2d31a6;
}

/* Additional hover effect */
.filter-toggle:hover .label-extra-count {
    background: #dde8ff;
    border-color: #a4bcfd;
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e9eaeb;
    border-radius: 8px;
    box-shadow: 0 12px 16px -4px rgba(10, 13, 18, 0.08), 0 4px 6px -2px rgba(10, 13, 18, 0.03), 0 2px 2px -1px rgba(10, 13, 18, 0.04);
    z-index: 100;
    display: none;
    max-height: 256px;
    overflow-y: auto;
    padding: 6px;
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.use-case-filter-dropdown.open .filter-dropdown {
    display: block;
}

.filter-option {
    padding: 6px 10px; /* Less chunky padding */
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 2px 0;
    border-radius: 6px;
    font-size: 14px; /* Smaller font size */
    font-weight: 500;
    line-height: 1.25rem; /* 20px */
    color: #181d27;
    position: relative;
    font-family: var(--e-global-typography-4a427e6-font-family, 'Silka', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
}

.filter-option:hover {
    background: #fafafa;
}

.filter-option.selected {
    background: #fafafa;
    padding-right: 36px;
}

.filter-option.selected::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M16.6668 5L7.50016 14.1667L3.3335 10' stroke='%230420D5' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center center;
    background-size: contain;
}

.filter-option.all {
    font-weight: 600;
    color: #181d27;
}

/* Cards Grid */
.use-cases-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: center;
    margin-bottom: 40px;
}

.use-case-card {
    flex: 1 1 calc(33.333% - 24px);
    min-width: 300px;
    max-width: 400px;
    background: var(--e-global-color-dc801a3, #f8f9ff);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 300px;
}

.use-case-card:hover {
    background: linear-gradient(45deg, #fff 0%, #dde2ff 100%);
    box-shadow: 0 12px 16px -4px rgba(10, 13, 18, 0.08), 0 4px 6px -2px rgba(10, 13, 18, 0.03);
    transform: translateY(-2px);
}

.use-case-card.is-hidden {
    display: none;
}

/* Labels */
.use-case-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 16px;
}

.use-case-label {
    font-family: var(--e-global-typography-4a427e6-font-family, inherit);
    font-size: var(--e-global-typography-4a427e6-font-size, 12px);
    font-weight: var(--e-global-typography-4a427e6-font-weight, 500);
    line-height: var(--e-global-typography-4a427e6-line-height, 1.4);
    padding: 2px 10px;
    background: #fafafa;
    color: #414651;
    border-radius: 9999px;
    outline: 1px solid #e9eaeb;
    outline-offset: -1px;
    border: none;
    transition: all 0.2s ease;
}

.use-case-card:hover .use-case-label {
    background: #dde2ff;
    color: var(--e-global-color-69c5726, #5865F2);
    outline-color: #8495ff;
}

/* Title */
.use-case-title {
    font-family: var(--e-global-typography-a6124c1-font-family, inherit);
    font-size: 30px !important;
    font-weight: var(--e-global-typography-a6124c1-font-weight, 600);
    line-height: var(--e-global-typography-a6124c1-line-height, 1.4);
    color: #020d55;
    margin: 0 0 16px 0;
    transform: translateY(16px);
    transition: transform 0.2s ease;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.use-case-card:hover .use-case-title {
    transform: translateY(0);
}

/* Content */
.use-case-content {
    transform: translateY(40px);
    transition: transform 0.2s ease;
    margin-top: auto;
}

.use-case-card:hover .use-case-content {
    transform: translateY(0);
}

.use-case-description {
    font-family: var(--e-global-typography-51730ab-font-family, inherit);
    font-size: var(--e-global-typography-51730ab-font-size, 14px);
    font-weight: var(--e-global-typography-51730ab-font-weight, 400);
    line-height: var(--e-global-typography-51730ab-line-height, 1.6);
    color: var(--e-global-color-84f6386, #666);
    margin: 16px 0 0 0;
    padding-top: 16px;
    border-top: 1px solid #dde2ff;
}

.use-case-description strong {
    color: var(--e-global-color-3002a95, #020d55);
    font-weight: 600;
}

/* Read More */
.use-case-read-more {
    font-family: var(--e-global-typography-a3f92e9-font-family, inherit);
    font-size: var(--e-global-typography-a3f92e9-font-size, 14px);
    font-weight: var(--e-global-typography-a3f92e9-font-weight, 600);
    line-height: var(--e-global-typography-a3f92e9-line-height, 1.4);
    color: var(--e-global-color-69c5726, #5865F2);
    margin: 16px 0 0 0;
    opacity: 0;
    transition: opacity 0.2s ease;
    position: relative;
    display: inline-block;
}

.use-case-card:hover .use-case-read-more {
    opacity: 1;
}

.use-case-read-more::after {
    content: '→';
    margin-left: 8px;
    transform: translateX(4px);
    transition: transform 0.2s ease;
    display: inline-block;
}

.use-case-card:hover .use-case-read-more::after {
    transform: translateX(12px);
}

/* Load More Button - CloudTalk Style */
.use-cases-load-more {
    width: 100%;
    margin: 48px 0 0 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

/* Decorative lines on both sides of the button */
.use-cases-load-more::before,
.use-cases-load-more::after {
    content: "";
    display: block;
    flex: 1;
    height: 1px;
    background: #e9eaeb;
}

/* WordPress Button Block Styles matching CloudTalk */
.wp-block-button.btn-regular.btn-ghost.btn-load-more {
    display: inline-block;
    text-align: center;
}

/* Load More Button - CloudTalk Production Ghost Style */
.wp-block-button__link.wp-element-button,
.use-cases-load-more-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px 24px !important;
    /* Default state - CloudTalk ghost button */
    background: #fff !important;
    color: #414651 !important;
    border: none !important;
    outline: 1px solid #d5d7da !important;
    outline-offset: -1px !important;
    border-radius: 8px !important;
    font-family: var(--e-global-typography-4a427e6-font-family, 'Silka', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 20px !important;
    letter-spacing: -0.01em !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    position: relative !important;
    box-shadow: none !important;
    min-height: 44px !important;
    /* No transform or animation */
    transform: none !important;
}

/* Ghost button hover state - CloudTalk Production */
.wp-block-button__link.wp-element-button:hover,
.use-cases-load-more-btn:hover {
    color: #252b37 !important;
    background: #fafafa !important;
    outline: 1px solid #d5d7da !important;
    outline-offset: -1px !important;
    /* No transform or shadow animation */
    transform: none !important;
    box-shadow: none !important;
}

/* Active/pressed state */
.wp-block-button__link.wp-element-button:active,
.use-cases-load-more-btn:active {
    color: #252b37 !important;
    background: #f5f5f5 !important;
    outline: 1px solid #d5d7da !important;
    outline-offset: -1px !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Focus state for accessibility */
.wp-block-button__link.wp-element-button:focus,
.wp-block-button__link.wp-element-button:focus-visible,
.use-cases-load-more-btn:focus,
.use-cases-load-more-btn:focus-visible {
    outline: 2px solid #0527ff !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

/* Loading state */
.use-cases-load-more-btn.loading {
    pointer-events: none !important;
    opacity: 0.7 !important;
}

.use-cases-load-more-btn.loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid #031aaa;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btnSpinner 0.6s linear infinite;
}

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

/* No Results Message */
.use-cases-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    display: none;
}

.use-cases-no-results.show {
    display: block;
}

/* Responsive Design */
@media (min-width: 768px) {
    .use-cases-filters {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .use-case-filter-dropdown {
        flex-basis: 30%;
        flex-grow: 1;
    }
}

@media (min-width: 1280px) {

    .use-cases-filters {
        gap: 16px;
        margin-bottom: 48px;
    }

    .use-case-filter-dropdown {
        max-width: 300px;
    }

    .filter-toggle {
        padding: 10px 16px;
    }

    .use-cases-cards {
        gap: 32px;
    }

    .use-case-card {
        flex: 1 1 calc(30% - 24px);
        max-width: 398px;
    }

    .use-case-title {
        font-size: 30px;
        line-height: 2rem;
    }

    .use-case-description {
        font-size: 16px;
        line-height: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .use-case-title {
        font-size: 18px;
        line-height: 1.3;
    }

    .use-case-card {
        flex: 1 1 calc(50% - 16px);
    }
}

@media (max-width: 767px) {
    .use-cases-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .use-case-filter-dropdown {
        width: 100%;
        max-width: 100%;
    }

    .filter-dropdown {
        left: 0;
        right: 0;
        width: 100%;
    }

    .use-cases-cards {
        gap: 16px;
    }

    .use-case-card {
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
    }

    .use-case-title {
        font-size: 18px;
        line-height: 1.3;
    }

    .use-case-label {
        font-size: var(--e-global-typography-bac4957-font-size, 11px);
        font-weight: var(--e-global-typography-bac4957-font-weight, 500);
        line-height: var(--e-global-typography-bac4957-line-height, 1.3);
    }
}