/* Instagram DM Style Tools Modal Overhaul */
.models-modal-content {
    background: #ffffff;
    backdrop-filter: blur(25px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 35px 35px 0 0;
    padding: 2rem 1rem;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.1);
}

.tools-modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: #111;
    text-align: right;
    padding-right: 15px;
    border-right: 5px solid #8f73ff;
}

.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 2.5rem;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: #f5f5f7;
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    width: 100%;
}

.tool-card:active {
    transform: scale(0.96);
    background: rgba(143, 115, 255, 0.1);
}

.tool-card.popular {
    background: rgba(143, 115, 255, 0.03);
    border-color: rgba(143, 115, 255, 0.15);
}

.tool-card-icon {
    width: 52px;
    height: 52px;
    background: #ffffff;
    border-radius: 50%;
    /* Instagram Icon Circle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.tool-card-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-grow: 1;
    text-align: right;
}

.tool-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111;
}

.tool-card-msg {
    font-size: 0.85rem;
    color: #a1a1aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.autonomous-badge {
    position: absolute;
    top: -8px;
    left: 15px;
    font-size: 0.65rem;
    color: #b9a8ff;
    font-weight: 700;
    background: rgba(143, 115, 255, 0.2);
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(143, 115, 255, 0.3);
}

.tools-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #71717a;
    margin: 2rem 0 0.8rem 0;
    padding-right: 8px;
    font-weight: 800;
}

.tool-tag {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #8f73ff;
    font-weight: 700;
}

@keyframes slideUpModal {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.models-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    display: none;
}

.models-modal.active {
    display: block;
    animation: slideUpModal 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    z-index: 1999;
    display: none;
}

.modal-overlay.active {
    display: block;
}

@media (min-width: 768px) {
    .models-modal {
        bottom: 0;
        top: 0;
        height: 100vh;
        align-items: center;
        justify-content: center;
    }

    .models-modal.active {
        display: flex !important;
        animation: fadeInModal 0.3s ease;
    }

    .models-modal-content {
        margin: auto;
        width: 100%;
        max-width: 500px;
        border-radius: 24px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    }
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}