/* Enable smooth scroll behavior on the AI tools page */
html {
  scroll-behavior: smooth;
}

.ai-tools-grid {
    display: grid;
    grid-auto-rows: minmax(300px, auto);
    gap: 80px;
    width: 100%;
    margin-top: 80px;
}

.ai-tools-grid .ai-tool-card:nth-child(3n+1) {
    grid-column: 1 / -1;
}

.ai-tool-card {
    width: 100%;
    position: relative;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    background: radial-gradient(circle farthest-corner at 50% 50%, rgb(255 255 255) 15%, rgb(239 239 239) 100%);
    color: #0d0d12;
    padding: 40px;
    border: 1px solid #dddddd;
}

.ai-tool-card__feature {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.ai-tool-card__header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 40%;
    z-index: 2;
}

.ai-tool-card__title {
    color: #0d0d12;
    font-size: 40px;
    font-weight: 700;
    line-height: 48px;
    letter-spacing: -0.4px;
    margin-bottom: 8px;
}

.ai-tool-card__subtitle {
    color: #0d0d12;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: -0.064px;
}

.ai-tool-card__logo {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at top left, #e9deff, #3d008d);
    box-shadow: 0 0 20px rgb(128 51 201 / 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.ai-tool-card:has(.ai-tool-card__cta) .ai-tool-card__logo {
    top: 40%;
}

.ai-tool-card:not(:has(.ai-tool-card__cta)) .ai-tool-card__logo {
    top: 50%;
}

.ai-tool-card__logo img {
    width: 100px;
}

.ai-tool-card__cta {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    backdrop-filter: blur(10px);
    border-radius: 999px;
    padding: 8px 30px;
    color: #6e00ff;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s ease;
    border: 1px solid #dddddd;
}

.ai-tool-card__cta:hover {
    background: #6e00ff;
    color: white;
}

.ai-tool-card__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    gap: 12px;
    z-index: 2;
}

.ai-tool-link {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #dddddd;
    border-radius: 30px;
    padding: 12px 14px;
    color: #0d0d12;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    width: 195px;
}

.ai-tool-link:hover {
    border-color: #a2a2a2;
    transform: translateY(-1px);
    color: #0d0d12;
}

.ai-tool-link__icon {
    display: inline-flex;
    width: 35px;
    height: 35px;
    border-radius: 50px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgb(50 50 50 / 18%), rgba(255, 255, 255, 0.04));
    border: 1px solid rgb(0 0 0 / 18%);
    color: #0d0d12;
    font-size: 18px;
}

.ai-tool-link__text {
    font-size: 16px;
}

.ai-tool-link__badge {
    color: #6e00ff;
    align-items: baseline;
    display: flex;
    gap: 5px;
    justify-content: center;
}

.ai-tools-breadcrumb {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
}

.ai-tools-breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-tools-breadcrumb-item span {
    color: #909090;
    font-size: 14px;
    font-weight: 500;
    line-height: 28px;
    transition: 200ms;
    cursor: pointer;
}

.ai-tools-breadcrumb-item span:hover {
    color: #6E00FF;
}

.ai-tools-breadcrumb-item i {
    color: #909090;
    font-size: 16px;
    justify-content: center;
    align-items: center;
    display: flex;
}

.ai-tools-breadcrumb hr {
    width: 100%;
    color: #EAEAEA;
    height: 1%;
    margin: 0;
}

/* Category Tabs */
.ai-tool-list-category-container {
    margin-top: 24px;
}

.ai-tool-categories {
    display: flex;
    gap: 8px;
    background: #f1f2f4;
    border: 1px solid #e4e6eb;
    border-radius: 999px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    user-select: none;
    cursor: grab;
}

.ai-tool-categories::-webkit-scrollbar {
    display: none;
}

.ai-tool-categories:active {
    cursor: grabbing;
}

.ai-tool-category {
    white-space: nowrap;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    text-decoration: none;
}

.ai-tool-category:hover {
    background: #e7e9ee;
    color: #111827;
}

.ai-tool-category.is-active {
    background: linear-gradient(135deg, #7c3aed, #6e00ff);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(110, 0, 255, 0.25);
}

.ai-tool-sort-and-category {
    margin-top: 12px;
}

.ai-tool-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ai-tool-sort--right {
    justify-content: flex-end;
}

.ai-tool-sort__label {
    color: #6b7280;
    font-weight: 600;
}

.ai-tool-sort__select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #e5e7eb;
    color: #111827;
    background: transparent;
    padding: 8px 36px 8px 12px;
    border-radius: 50px;
}

.ai-dropdown {
    position: relative;
}

.ai-dropdown__button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
}

.ai-dropdown__chevron {
    font-size: 18px;
    color: #6b7280;
}

.ai-dropdown__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 6px;
    display: none;
    z-index: 10;
}

.ai-dropdown.is-open .ai-dropdown__menu {
    display: block;
}

.ai-dropdown__item {
    list-style: none;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.ai-dropdown__item:hover {
    background: #f3f4f6;
}

.ai-dropdown__item.is-active {
    background: #f6f3ff;
}

.ai-tool-card__badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-tool-badge {
    font-size: 14px;
    color: #6e00ff;
    background: #e7dfff;
    padding: 4px 10px;
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 1199px) {
    .ai-tools-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .ai-tools-grid .ai-tool-card:nth-child(3n+1) {
        grid-column: auto;
    }

    .ai-tool-card {
        height: auto;
        padding: 24px;
        border-radius: 20px;
        overflow: visible;
        background: linear-gradient(135deg, #ffffff, #ededed, #dadada);
    }

    .ai-tool-card__feature {
        display: block;
        border-radius: 20px;
        padding: 24px;
    }

    .ai-tool-card__header {
        width: 100%;
        margin-top: 70px;
        padding-right: 0;
    }

    .ai-tool-card__actions {
        position: absolute;
        top: 24px;
        right: 24px;
        display: flex;
        align-items: center;
        gap: 10px;
        width: auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }

    .ai-tool-card__actions:has(.ai-tool-link:only-child) {
        justify-content: flex-end;
    }

    .ai-tool-card__subtitle {
        margin-bottom: 0;
    }

    .ai-tool-card__subtitle p {
        margin-bottom: 0;
    }

    .ai-tool-card__logo {
        position: absolute;
        top: -30px;
        left: -20px;
        transform: none;
        margin: 0;
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background: radial-gradient(circle at top left, #e9deff, #3d008d);
        box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
        z-index: 3;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .ai-tool-card__logo img {
        width: 70px;
    }

    .ai-tool-card__cta {
        position: static;
        transform: none;
        display: inline-flex;
        padding: 5px 8px;
        gap: 6px;
        backdrop-filter: blur(10px);
        justify-content: center;
        align-items: center;
        margin-top: 12px;
        width: 100%;
        background: white;
        border-radius: 999px;
        color: #6e00ff;
        font-size: 1rem;
        cursor: pointer;
        transition: 0.3s ease;
        border: 1px solid #dddddd;
    }

    .ai-tool-card__title {
        margin: 0;
    }

    .ai-tool-card__actions .ai-tool-link {
        border-radius: 22px;
        border: 1px solid #dddddd;
        padding: 6px 10px;
        gap: 6px;
        background: #fff;
    }

    .ai-tool-card__actions .ai-tool-link .ai-tool-link__icon {
        width: 35px;
        height: 35px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
    }

    .ai-tool-card__actions .ai-tool-link .ai-tool-link__text {
        font-size: 14px;
    }

    .ai-tool-card__actions .ai-tool-link .ai-tool-link__text {
        display: none;
    }

    .ai-tool-card__actions .ai-tool-link {
        width: auto;
        height: auto;
        padding: 5px 10px;
        border-radius: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        border: 1px solid #cfcfcf;
    }

    .ai-tool-card__actions .ai-tool-link .ai-tool-link__icon {
        width: auto;
        height: auto;
        border: 0;
        background: none;
        font-size: 14px;
    }

}

@media (max-width: 768px) {
    .ai-tool-link__badge {
        font-size: 12px !important;
    }
}

@media (max-width: 768px) {
    .ai-tool-card__title {
        font-size: 30px;
    }

}

@media (max-width: 1199px) {
    .ai-tools-container {
        margin-top: 50px;
    }
}

@media (max-width: 370px) {
    .ai-tool-card__header {
        margin-top: 110px;
    }

    .ai-tool-card__actions {
        top: 80px;
        left: 20px;
        right: auto;
    }

    .ai-tool-card__actions:has(.ai-tool-link:only-child) {
        left: auto;
        right: 20px;
    }

    .ai-tool-card__links {
        justify-content: flex-start;
        margin-top: 60px;
    }
}

@media (max-width: 1199px) {
    .ai-tool-card:not(:has(.ai-tool-card__cta)) .ai-tool-card__logo {
        top: -30px;
    }

    .ai-tool-card:has(.ai-tool-card__cta) .ai-tool-card__logo {
        top: -30px;
    }
}